1. Packages
  2. AWS Classic
  3. API Docs
  4. apigateway
  5. Deployment

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

aws.apigateway.Deployment

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

    Manages an API Gateway REST Deployment. A deployment is a snapshot of the REST API configuration. The deployment can then be published to callable endpoints via the aws.apigateway.Stage resource and optionally managed further with the aws.apigateway.BasePathMapping resource, aws.apigateway.DomainName resource, and aws_api_method_settings resource. For more information, see the API Gateway Developer Guide.

    To properly capture all REST API configuration in a deployment, this resource must have dependencies on all prior resources that manage resources/paths, methods, integrations, etc.

    • For REST APIs that are configured via OpenAPI specification (aws.apigateway.RestApi resource body argument), no special dependency setup is needed beyond referencing the id attribute of that resource unless additional resources have further customized the REST API.
    • When the REST API configuration involves other resources (aws.apigateway.Integration resource), the dependency setup can be done with implicit resource references in the triggers argument or explicit resource references using the resource dependsOn custom option. The triggers argument should be preferred over depends_on, since depends_on can only capture dependency ordering and will not cause the resource to recreate (redeploy the REST API) with upstream configuration changes.

    !> WARNING: It is recommended to use the aws.apigateway.Stage resource instead of managing an API Gateway Stage via the stage_name argument of this resource. When this resource is recreated (REST API redeployment) with the stage_name configured, the stage is deleted and recreated. This will cause a temporary service interruption, increase provide plan differences, and can require a second apply to recreate any downstream stage configuration such as associated aws_api_method_settings resources.

    Example Usage

    Create Deployment Resource

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

    Constructor syntax

    new Deployment(name: string, args: DeploymentArgs, opts?: CustomResourceOptions);
    @overload
    def Deployment(resource_name: str,
                   args: DeploymentArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def Deployment(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   rest_api: Optional[str] = None,
                   description: Optional[str] = None,
                   stage_description: Optional[str] = None,
                   stage_name: Optional[str] = None,
                   triggers: Optional[Mapping[str, str]] = None,
                   variables: Optional[Mapping[str, str]] = None)
    func NewDeployment(ctx *Context, name string, args DeploymentArgs, opts ...ResourceOption) (*Deployment, error)
    public Deployment(string name, DeploymentArgs args, CustomResourceOptions? opts = null)
    public Deployment(String name, DeploymentArgs args)
    public Deployment(String name, DeploymentArgs args, CustomResourceOptions options)
    
    type: aws:apigateway:Deployment
    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 DeploymentArgs
    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 DeploymentArgs
    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 DeploymentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DeploymentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DeploymentArgs
    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 deploymentResource = new Aws.ApiGateway.Deployment("deploymentResource", new()
    {
        RestApi = "string",
        Description = "string",
        StageDescription = "string",
        StageName = "string",
        Triggers = 
        {
            { "string", "string" },
        },
        Variables = 
        {
            { "string", "string" },
        },
    });
    
    example, err := apigateway.NewDeployment(ctx, "deploymentResource", &apigateway.DeploymentArgs{
    	RestApi:          pulumi.Any("string"),
    	Description:      pulumi.String("string"),
    	StageDescription: pulumi.String("string"),
    	StageName:        pulumi.String("string"),
    	Triggers: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Variables: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var deploymentResource = new Deployment("deploymentResource", DeploymentArgs.builder()        
        .restApi("string")
        .description("string")
        .stageDescription("string")
        .stageName("string")
        .triggers(Map.of("string", "string"))
        .variables(Map.of("string", "string"))
        .build());
    
    deployment_resource = aws.apigateway.Deployment("deploymentResource",
        rest_api="string",
        description="string",
        stage_description="string",
        stage_name="string",
        triggers={
            "string": "string",
        },
        variables={
            "string": "string",
        })
    
    const deploymentResource = new aws.apigateway.Deployment("deploymentResource", {
        restApi: "string",
        description: "string",
        stageDescription: "string",
        stageName: "string",
        triggers: {
            string: "string",
        },
        variables: {
            string: "string",
        },
    });
    
    type: aws:apigateway:Deployment
    properties:
        description: string
        restApi: string
        stageDescription: string
        stageName: string
        triggers:
            string: string
        variables:
            string: string
    

    Deployment 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 Deployment resource accepts the following input properties:

    RestApi string | string
    REST API identifier.
    Description string
    Description of the deployment
    StageDescription string
    Description to set on the stage managed by the stage_name argument.
    StageName string
    Name of the stage to create with this deployment. If the specified stage already exists, it will be updated to point to the new deployment. We recommend using the aws.apigateway.Stage resource instead to manage stages.
    Triggers Dictionary<string, string>
    Map of arbitrary keys and values that, when changed, will trigger a redeployment.
    Variables Dictionary<string, string>
    Map to set on the stage managed by the stage_name argument.
    RestApi string | string
    REST API identifier.
    Description string
    Description of the deployment
    StageDescription string
    Description to set on the stage managed by the stage_name argument.
    StageName string
    Name of the stage to create with this deployment. If the specified stage already exists, it will be updated to point to the new deployment. We recommend using the aws.apigateway.Stage resource instead to manage stages.
    Triggers map[string]string
    Map of arbitrary keys and values that, when changed, will trigger a redeployment.
    Variables map[string]string
    Map to set on the stage managed by the stage_name argument.
    restApi String | String
    REST API identifier.
    description String
    Description of the deployment
    stageDescription String
    Description to set on the stage managed by the stage_name argument.
    stageName String
    Name of the stage to create with this deployment. If the specified stage already exists, it will be updated to point to the new deployment. We recommend using the aws.apigateway.Stage resource instead to manage stages.
    triggers Map<String,String>
    Map of arbitrary keys and values that, when changed, will trigger a redeployment.
    variables Map<String,String>
    Map to set on the stage managed by the stage_name argument.
    restApi string | RestApi
    REST API identifier.
    description string
    Description of the deployment
    stageDescription string
    Description to set on the stage managed by the stage_name argument.
    stageName string
    Name of the stage to create with this deployment. If the specified stage already exists, it will be updated to point to the new deployment. We recommend using the aws.apigateway.Stage resource instead to manage stages.
    triggers {[key: string]: string}
    Map of arbitrary keys and values that, when changed, will trigger a redeployment.
    variables {[key: string]: string}
    Map to set on the stage managed by the stage_name argument.
    rest_api str | str
    REST API identifier.
    description str
    Description of the deployment
    stage_description str
    Description to set on the stage managed by the stage_name argument.
    stage_name str
    Name of the stage to create with this deployment. If the specified stage already exists, it will be updated to point to the new deployment. We recommend using the aws.apigateway.Stage resource instead to manage stages.
    triggers Mapping[str, str]
    Map of arbitrary keys and values that, when changed, will trigger a redeployment.
    variables Mapping[str, str]
    Map to set on the stage managed by the stage_name argument.
    restApi String |
    REST API identifier.
    description String
    Description of the deployment
    stageDescription String
    Description to set on the stage managed by the stage_name argument.
    stageName String
    Name of the stage to create with this deployment. If the specified stage already exists, it will be updated to point to the new deployment. We recommend using the aws.apigateway.Stage resource instead to manage stages.
    triggers Map<String>
    Map of arbitrary keys and values that, when changed, will trigger a redeployment.
    variables Map<String>
    Map to set on the stage managed by the stage_name argument.

    Outputs

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

    CreatedDate string
    Creation date of the deployment
    ExecutionArn string
    Execution ARN to be used in lambda_permission's source_arn when allowing API Gateway to invoke a Lambda function, e.g., arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
    Id string
    The provider-assigned unique ID for this managed resource.
    InvokeUrl string
    URL to invoke the API pointing to the stage, e.g., https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
    CreatedDate string
    Creation date of the deployment
    ExecutionArn string
    Execution ARN to be used in lambda_permission's source_arn when allowing API Gateway to invoke a Lambda function, e.g., arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
    Id string
    The provider-assigned unique ID for this managed resource.
    InvokeUrl string
    URL to invoke the API pointing to the stage, e.g., https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
    createdDate String
    Creation date of the deployment
    executionArn String
    Execution ARN to be used in lambda_permission's source_arn when allowing API Gateway to invoke a Lambda function, e.g., arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
    id String
    The provider-assigned unique ID for this managed resource.
    invokeUrl String
    URL to invoke the API pointing to the stage, e.g., https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
    createdDate string
    Creation date of the deployment
    executionArn string
    Execution ARN to be used in lambda_permission's source_arn when allowing API Gateway to invoke a Lambda function, e.g., arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
    id string
    The provider-assigned unique ID for this managed resource.
    invokeUrl string
    URL to invoke the API pointing to the stage, e.g., https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
    created_date str
    Creation date of the deployment
    execution_arn str
    Execution ARN to be used in lambda_permission's source_arn when allowing API Gateway to invoke a Lambda function, e.g., arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
    id str
    The provider-assigned unique ID for this managed resource.
    invoke_url str
    URL to invoke the API pointing to the stage, e.g., https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
    createdDate String
    Creation date of the deployment
    executionArn String
    Execution ARN to be used in lambda_permission's source_arn when allowing API Gateway to invoke a Lambda function, e.g., arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
    id String
    The provider-assigned unique ID for this managed resource.
    invokeUrl String
    URL to invoke the API pointing to the stage, e.g., https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod

    Look up Existing Deployment Resource

    Get an existing Deployment 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?: DeploymentState, opts?: CustomResourceOptions): Deployment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_date: Optional[str] = None,
            description: Optional[str] = None,
            execution_arn: Optional[str] = None,
            invoke_url: Optional[str] = None,
            rest_api: Optional[str] = None,
            stage_description: Optional[str] = None,
            stage_name: Optional[str] = None,
            triggers: Optional[Mapping[str, str]] = None,
            variables: Optional[Mapping[str, str]] = None) -> Deployment
    func GetDeployment(ctx *Context, name string, id IDInput, state *DeploymentState, opts ...ResourceOption) (*Deployment, error)
    public static Deployment Get(string name, Input<string> id, DeploymentState? state, CustomResourceOptions? opts = null)
    public static Deployment get(String name, Output<String> id, DeploymentState 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:
    CreatedDate string
    Creation date of the deployment
    Description string
    Description of the deployment
    ExecutionArn string
    Execution ARN to be used in lambda_permission's source_arn when allowing API Gateway to invoke a Lambda function, e.g., arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
    InvokeUrl string
    URL to invoke the API pointing to the stage, e.g., https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
    RestApi string | string
    REST API identifier.
    StageDescription string
    Description to set on the stage managed by the stage_name argument.
    StageName string
    Name of the stage to create with this deployment. If the specified stage already exists, it will be updated to point to the new deployment. We recommend using the aws.apigateway.Stage resource instead to manage stages.
    Triggers Dictionary<string, string>
    Map of arbitrary keys and values that, when changed, will trigger a redeployment.
    Variables Dictionary<string, string>
    Map to set on the stage managed by the stage_name argument.
    CreatedDate string
    Creation date of the deployment
    Description string
    Description of the deployment
    ExecutionArn string
    Execution ARN to be used in lambda_permission's source_arn when allowing API Gateway to invoke a Lambda function, e.g., arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
    InvokeUrl string
    URL to invoke the API pointing to the stage, e.g., https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
    RestApi string | string
    REST API identifier.
    StageDescription string
    Description to set on the stage managed by the stage_name argument.
    StageName string
    Name of the stage to create with this deployment. If the specified stage already exists, it will be updated to point to the new deployment. We recommend using the aws.apigateway.Stage resource instead to manage stages.
    Triggers map[string]string
    Map of arbitrary keys and values that, when changed, will trigger a redeployment.
    Variables map[string]string
    Map to set on the stage managed by the stage_name argument.
    createdDate String
    Creation date of the deployment
    description String
    Description of the deployment
    executionArn String
    Execution ARN to be used in lambda_permission's source_arn when allowing API Gateway to invoke a Lambda function, e.g., arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
    invokeUrl String
    URL to invoke the API pointing to the stage, e.g., https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
    restApi String | String
    REST API identifier.
    stageDescription String
    Description to set on the stage managed by the stage_name argument.
    stageName String
    Name of the stage to create with this deployment. If the specified stage already exists, it will be updated to point to the new deployment. We recommend using the aws.apigateway.Stage resource instead to manage stages.
    triggers Map<String,String>
    Map of arbitrary keys and values that, when changed, will trigger a redeployment.
    variables Map<String,String>
    Map to set on the stage managed by the stage_name argument.
    createdDate string
    Creation date of the deployment
    description string
    Description of the deployment
    executionArn string
    Execution ARN to be used in lambda_permission's source_arn when allowing API Gateway to invoke a Lambda function, e.g., arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
    invokeUrl string
    URL to invoke the API pointing to the stage, e.g., https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
    restApi string | RestApi
    REST API identifier.
    stageDescription string
    Description to set on the stage managed by the stage_name argument.
    stageName string
    Name of the stage to create with this deployment. If the specified stage already exists, it will be updated to point to the new deployment. We recommend using the aws.apigateway.Stage resource instead to manage stages.
    triggers {[key: string]: string}
    Map of arbitrary keys and values that, when changed, will trigger a redeployment.
    variables {[key: string]: string}
    Map to set on the stage managed by the stage_name argument.
    created_date str
    Creation date of the deployment
    description str
    Description of the deployment
    execution_arn str
    Execution ARN to be used in lambda_permission's source_arn when allowing API Gateway to invoke a Lambda function, e.g., arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
    invoke_url str
    URL to invoke the API pointing to the stage, e.g., https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
    rest_api str | str
    REST API identifier.
    stage_description str
    Description to set on the stage managed by the stage_name argument.
    stage_name str
    Name of the stage to create with this deployment. If the specified stage already exists, it will be updated to point to the new deployment. We recommend using the aws.apigateway.Stage resource instead to manage stages.
    triggers Mapping[str, str]
    Map of arbitrary keys and values that, when changed, will trigger a redeployment.
    variables Mapping[str, str]
    Map to set on the stage managed by the stage_name argument.
    createdDate String
    Creation date of the deployment
    description String
    Description of the deployment
    executionArn String
    Execution ARN to be used in lambda_permission's source_arn when allowing API Gateway to invoke a Lambda function, e.g., arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j/prod
    invokeUrl String
    URL to invoke the API pointing to the stage, e.g., https://z4675bid1j.execute-api.eu-west-2.amazonaws.com/prod
    restApi String |
    REST API identifier.
    stageDescription String
    Description to set on the stage managed by the stage_name argument.
    stageName String
    Name of the stage to create with this deployment. If the specified stage already exists, it will be updated to point to the new deployment. We recommend using the aws.apigateway.Stage resource instead to manage stages.
    triggers Map<String>
    Map of arbitrary keys and values that, when changed, will trigger a redeployment.
    variables Map<String>
    Map to set on the stage managed by the stage_name argument.

    Import

    Using pulumi import, import aws_api_gateway_deployment using REST-API-ID/DEPLOYMENT-ID. For example:

    $ pulumi import aws:apigateway/deployment:Deployment example aabbccddee/1122334
    

    The stage_name, stage_description, and variables arguments cannot be imported. Use the aws_api_gateway_stage resource to import and manage stages.

    The triggers argument cannot be imported.

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi