1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. apigateway
  5. AppAttachment
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

alicloud.apigateway.AppAttachment

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform_example";
    const exampleGroup = new alicloud.apigateway.Group("exampleGroup", {description: name});
    const exampleApi = new alicloud.apigateway.Api("exampleApi", {
        groupId: exampleGroup.id,
        description: name,
        authType: "APP",
        forceNonceCheck: false,
        requestConfig: {
            protocol: "HTTP",
            method: "GET",
            path: "/example/path",
            mode: "MAPPING",
        },
        serviceType: "HTTP",
        httpServiceConfig: {
            address: "http://apigateway-backend.alicloudapi.com:8080",
            method: "GET",
            path: "/web/cloudapi",
            timeout: 12,
            aoneName: "cloudapi-openapi",
        },
        requestParameters: [{
            name: "example",
            type: "STRING",
            required: "OPTIONAL",
            "in": "QUERY",
            inService: "QUERY",
            nameService: "exampleservice",
        }],
        stageNames: [
            "RELEASE",
            "TEST",
        ],
    });
    const exampleApp = new alicloud.apigateway.App("exampleApp", {description: name});
    const exampleAppAttachment = new alicloud.apigateway.AppAttachment("exampleAppAttachment", {
        apiId: exampleApi.apiId,
        groupId: exampleGroup.id,
        appId: exampleApp.id,
        stageName: "PRE",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform_example"
    example_group = alicloud.apigateway.Group("exampleGroup", description=name)
    example_api = alicloud.apigateway.Api("exampleApi",
        group_id=example_group.id,
        description=name,
        auth_type="APP",
        force_nonce_check=False,
        request_config=alicloud.apigateway.ApiRequestConfigArgs(
            protocol="HTTP",
            method="GET",
            path="/example/path",
            mode="MAPPING",
        ),
        service_type="HTTP",
        http_service_config=alicloud.apigateway.ApiHttpServiceConfigArgs(
            address="http://apigateway-backend.alicloudapi.com:8080",
            method="GET",
            path="/web/cloudapi",
            timeout=12,
            aone_name="cloudapi-openapi",
        ),
        request_parameters=[alicloud.apigateway.ApiRequestParameterArgs(
            name="example",
            type="STRING",
            required="OPTIONAL",
            in_="QUERY",
            in_service="QUERY",
            name_service="exampleservice",
        )],
        stage_names=[
            "RELEASE",
            "TEST",
        ])
    example_app = alicloud.apigateway.App("exampleApp", description=name)
    example_app_attachment = alicloud.apigateway.AppAttachment("exampleAppAttachment",
        api_id=example_api.api_id,
        group_id=example_group.id,
        app_id=example_app.id,
        stage_name="PRE")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/apigateway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform_example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		exampleGroup, err := apigateway.NewGroup(ctx, "exampleGroup", &apigateway.GroupArgs{
    			Description: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		exampleApi, err := apigateway.NewApi(ctx, "exampleApi", &apigateway.ApiArgs{
    			GroupId:         exampleGroup.ID(),
    			Description:     pulumi.String(name),
    			AuthType:        pulumi.String("APP"),
    			ForceNonceCheck: pulumi.Bool(false),
    			RequestConfig: &apigateway.ApiRequestConfigArgs{
    				Protocol: pulumi.String("HTTP"),
    				Method:   pulumi.String("GET"),
    				Path:     pulumi.String("/example/path"),
    				Mode:     pulumi.String("MAPPING"),
    			},
    			ServiceType: pulumi.String("HTTP"),
    			HttpServiceConfig: &apigateway.ApiHttpServiceConfigArgs{
    				Address:  pulumi.String("http://apigateway-backend.alicloudapi.com:8080"),
    				Method:   pulumi.String("GET"),
    				Path:     pulumi.String("/web/cloudapi"),
    				Timeout:  pulumi.Int(12),
    				AoneName: pulumi.String("cloudapi-openapi"),
    			},
    			RequestParameters: apigateway.ApiRequestParameterArray{
    				&apigateway.ApiRequestParameterArgs{
    					Name:        pulumi.String("example"),
    					Type:        pulumi.String("STRING"),
    					Required:    pulumi.String("OPTIONAL"),
    					In:          pulumi.String("QUERY"),
    					InService:   pulumi.String("QUERY"),
    					NameService: pulumi.String("exampleservice"),
    				},
    			},
    			StageNames: pulumi.StringArray{
    				pulumi.String("RELEASE"),
    				pulumi.String("TEST"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleApp, err := apigateway.NewApp(ctx, "exampleApp", &apigateway.AppArgs{
    			Description: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = apigateway.NewAppAttachment(ctx, "exampleAppAttachment", &apigateway.AppAttachmentArgs{
    			ApiId:     exampleApi.ApiId,
    			GroupId:   exampleGroup.ID(),
    			AppId:     exampleApp.ID(),
    			StageName: pulumi.String("PRE"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform_example";
        var exampleGroup = new AliCloud.ApiGateway.Group("exampleGroup", new()
        {
            Description = name,
        });
    
        var exampleApi = new AliCloud.ApiGateway.Api("exampleApi", new()
        {
            GroupId = exampleGroup.Id,
            Description = name,
            AuthType = "APP",
            ForceNonceCheck = false,
            RequestConfig = new AliCloud.ApiGateway.Inputs.ApiRequestConfigArgs
            {
                Protocol = "HTTP",
                Method = "GET",
                Path = "/example/path",
                Mode = "MAPPING",
            },
            ServiceType = "HTTP",
            HttpServiceConfig = new AliCloud.ApiGateway.Inputs.ApiHttpServiceConfigArgs
            {
                Address = "http://apigateway-backend.alicloudapi.com:8080",
                Method = "GET",
                Path = "/web/cloudapi",
                Timeout = 12,
                AoneName = "cloudapi-openapi",
            },
            RequestParameters = new[]
            {
                new AliCloud.ApiGateway.Inputs.ApiRequestParameterArgs
                {
                    Name = "example",
                    Type = "STRING",
                    Required = "OPTIONAL",
                    In = "QUERY",
                    InService = "QUERY",
                    NameService = "exampleservice",
                },
            },
            StageNames = new[]
            {
                "RELEASE",
                "TEST",
            },
        });
    
        var exampleApp = new AliCloud.ApiGateway.App("exampleApp", new()
        {
            Description = name,
        });
    
        var exampleAppAttachment = new AliCloud.ApiGateway.AppAttachment("exampleAppAttachment", new()
        {
            ApiId = exampleApi.ApiId,
            GroupId = exampleGroup.Id,
            AppId = exampleApp.Id,
            StageName = "PRE",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.apigateway.Group;
    import com.pulumi.alicloud.apigateway.GroupArgs;
    import com.pulumi.alicloud.apigateway.Api;
    import com.pulumi.alicloud.apigateway.ApiArgs;
    import com.pulumi.alicloud.apigateway.inputs.ApiRequestConfigArgs;
    import com.pulumi.alicloud.apigateway.inputs.ApiHttpServiceConfigArgs;
    import com.pulumi.alicloud.apigateway.inputs.ApiRequestParameterArgs;
    import com.pulumi.alicloud.apigateway.App;
    import com.pulumi.alicloud.apigateway.AppArgs;
    import com.pulumi.alicloud.apigateway.AppAttachment;
    import com.pulumi.alicloud.apigateway.AppAttachmentArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform_example");
            var exampleGroup = new Group("exampleGroup", GroupArgs.builder()        
                .description(name)
                .build());
    
            var exampleApi = new Api("exampleApi", ApiArgs.builder()        
                .groupId(exampleGroup.id())
                .description(name)
                .authType("APP")
                .forceNonceCheck(false)
                .requestConfig(ApiRequestConfigArgs.builder()
                    .protocol("HTTP")
                    .method("GET")
                    .path("/example/path")
                    .mode("MAPPING")
                    .build())
                .serviceType("HTTP")
                .httpServiceConfig(ApiHttpServiceConfigArgs.builder()
                    .address("http://apigateway-backend.alicloudapi.com:8080")
                    .method("GET")
                    .path("/web/cloudapi")
                    .timeout(12)
                    .aoneName("cloudapi-openapi")
                    .build())
                .requestParameters(ApiRequestParameterArgs.builder()
                    .name("example")
                    .type("STRING")
                    .required("OPTIONAL")
                    .in("QUERY")
                    .inService("QUERY")
                    .nameService("exampleservice")
                    .build())
                .stageNames(            
                    "RELEASE",
                    "TEST")
                .build());
    
            var exampleApp = new App("exampleApp", AppArgs.builder()        
                .description(name)
                .build());
    
            var exampleAppAttachment = new AppAttachment("exampleAppAttachment", AppAttachmentArgs.builder()        
                .apiId(exampleApi.apiId())
                .groupId(exampleGroup.id())
                .appId(exampleApp.id())
                .stageName("PRE")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform_example
    resources:
      exampleGroup:
        type: alicloud:apigateway:Group
        properties:
          description: ${name}
      exampleApi:
        type: alicloud:apigateway:Api
        properties:
          groupId: ${exampleGroup.id}
          description: ${name}
          authType: APP
          forceNonceCheck: false
          requestConfig:
            protocol: HTTP
            method: GET
            path: /example/path
            mode: MAPPING
          serviceType: HTTP
          httpServiceConfig:
            address: http://apigateway-backend.alicloudapi.com:8080
            method: GET
            path: /web/cloudapi
            timeout: 12
            aoneName: cloudapi-openapi
          requestParameters:
            - name: example
              type: STRING
              required: OPTIONAL
              in: QUERY
              inService: QUERY
              nameService: exampleservice
          stageNames:
            - RELEASE
            - TEST
      exampleApp:
        type: alicloud:apigateway:App
        properties:
          description: ${name}
      exampleAppAttachment:
        type: alicloud:apigateway:AppAttachment
        properties:
          apiId: ${exampleApi.apiId}
          groupId: ${exampleGroup.id}
          appId: ${exampleApp.id}
          stageName: PRE
    

    Create AppAttachment Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AppAttachment(name: string, args: AppAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def AppAttachment(resource_name: str,
                      args: AppAttachmentArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def AppAttachment(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      api_id: Optional[str] = None,
                      app_id: Optional[str] = None,
                      group_id: Optional[str] = None,
                      stage_name: Optional[str] = None)
    func NewAppAttachment(ctx *Context, name string, args AppAttachmentArgs, opts ...ResourceOption) (*AppAttachment, error)
    public AppAttachment(string name, AppAttachmentArgs args, CustomResourceOptions? opts = null)
    public AppAttachment(String name, AppAttachmentArgs args)
    public AppAttachment(String name, AppAttachmentArgs args, CustomResourceOptions options)
    
    type: alicloud:apigateway:AppAttachment
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args AppAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AppAttachmentArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AppAttachmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AppAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AppAttachmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var appAttachmentResource = new AliCloud.ApiGateway.AppAttachment("appAttachmentResource", new()
    {
        ApiId = "string",
        AppId = "string",
        GroupId = "string",
        StageName = "string",
    });
    
    example, err := apigateway.NewAppAttachment(ctx, "appAttachmentResource", &apigateway.AppAttachmentArgs{
    	ApiId:     pulumi.String("string"),
    	AppId:     pulumi.String("string"),
    	GroupId:   pulumi.String("string"),
    	StageName: pulumi.String("string"),
    })
    
    var appAttachmentResource = new AppAttachment("appAttachmentResource", AppAttachmentArgs.builder()        
        .apiId("string")
        .appId("string")
        .groupId("string")
        .stageName("string")
        .build());
    
    app_attachment_resource = alicloud.apigateway.AppAttachment("appAttachmentResource",
        api_id="string",
        app_id="string",
        group_id="string",
        stage_name="string")
    
    const appAttachmentResource = new alicloud.apigateway.AppAttachment("appAttachmentResource", {
        apiId: "string",
        appId: "string",
        groupId: "string",
        stageName: "string",
    });
    
    type: alicloud:apigateway:AppAttachment
    properties:
        apiId: string
        appId: string
        groupId: string
        stageName: string
    

    AppAttachment Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The AppAttachment resource accepts the following input properties:

    ApiId string
    The api_id that app apply to access.
    AppId string
    The app that apply to the authorization.
    GroupId string
    The group that the api belongs to.
    StageName string
    Stage that the app apply to access.
    ApiId string
    The api_id that app apply to access.
    AppId string
    The app that apply to the authorization.
    GroupId string
    The group that the api belongs to.
    StageName string
    Stage that the app apply to access.
    apiId String
    The api_id that app apply to access.
    appId String
    The app that apply to the authorization.
    groupId String
    The group that the api belongs to.
    stageName String
    Stage that the app apply to access.
    apiId string
    The api_id that app apply to access.
    appId string
    The app that apply to the authorization.
    groupId string
    The group that the api belongs to.
    stageName string
    Stage that the app apply to access.
    api_id str
    The api_id that app apply to access.
    app_id str
    The app that apply to the authorization.
    group_id str
    The group that the api belongs to.
    stage_name str
    Stage that the app apply to access.
    apiId String
    The api_id that app apply to access.
    appId String
    The app that apply to the authorization.
    groupId String
    The group that the api belongs to.
    stageName String
    Stage that the app apply to access.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AppAttachment resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing AppAttachment Resource

    Get an existing AppAttachment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: AppAttachmentState, opts?: CustomResourceOptions): AppAttachment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_id: Optional[str] = None,
            app_id: Optional[str] = None,
            group_id: Optional[str] = None,
            stage_name: Optional[str] = None) -> AppAttachment
    func GetAppAttachment(ctx *Context, name string, id IDInput, state *AppAttachmentState, opts ...ResourceOption) (*AppAttachment, error)
    public static AppAttachment Get(string name, Input<string> id, AppAttachmentState? state, CustomResourceOptions? opts = null)
    public static AppAttachment get(String name, Output<String> id, AppAttachmentState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ApiId string
    The api_id that app apply to access.
    AppId string
    The app that apply to the authorization.
    GroupId string
    The group that the api belongs to.
    StageName string
    Stage that the app apply to access.
    ApiId string
    The api_id that app apply to access.
    AppId string
    The app that apply to the authorization.
    GroupId string
    The group that the api belongs to.
    StageName string
    Stage that the app apply to access.
    apiId String
    The api_id that app apply to access.
    appId String
    The app that apply to the authorization.
    groupId String
    The group that the api belongs to.
    stageName String
    Stage that the app apply to access.
    apiId string
    The api_id that app apply to access.
    appId string
    The app that apply to the authorization.
    groupId string
    The group that the api belongs to.
    stageName string
    Stage that the app apply to access.
    api_id str
    The api_id that app apply to access.
    app_id str
    The app that apply to the authorization.
    group_id str
    The group that the api belongs to.
    stage_name str
    Stage that the app apply to access.
    apiId String
    The api_id that app apply to access.
    appId String
    The app that apply to the authorization.
    groupId String
    The group that the api belongs to.
    stageName String
    Stage that the app apply to access.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi