aws.apigateway.Deployment
Explore with Pulumi AI
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.RestApiresourcebodyargument), no special dependency setup is needed beyond referencing theidattribute of that resource unless additional resources have further customized the REST API.
- When the REST API configuration involves other resources (aws.apigateway.Integrationresource), the dependency setup can be done with implicit resource references in thetriggersargument or explicit resource references using the resourcedependsOncustom option. Thetriggersargument should be preferred overdepends_on, sincedepends_oncan 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,
               canary_settings: Optional[DeploymentCanarySettingsArgs] = 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var deploymentResource = new Aws.ApiGateway.Deployment("deploymentResource", new()
{
    RestApi = "string",
    Description = "string",
    Triggers = 
    {
        { "string", "string" },
    },
    Variables = 
    {
        { "string", "string" },
    },
});
example, err := apigateway.NewDeployment(ctx, "deploymentResource", &apigateway.DeploymentArgs{
	RestApi:     pulumi.Any("string"),
	Description: 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")
    .triggers(Map.of("string", "string"))
    .variables(Map.of("string", "string"))
    .build());
deployment_resource = aws.apigateway.Deployment("deploymentResource",
    rest_api="string",
    description="string",
    triggers={
        "string": "string",
    },
    variables={
        "string": "string",
    })
const deploymentResource = new aws.apigateway.Deployment("deploymentResource", {
    restApi: "string",
    description: "string",
    triggers: {
        string: "string",
    },
    variables: {
        string: "string",
    },
});
type: aws:apigateway:Deployment
properties:
    description: string
    restApi: 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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Deployment resource accepts the following input properties:
- RestApi string | string
- REST API identifier.
- CanarySettings DeploymentCanary Settings 
- Input configuration for the canary deployment when the deployment is a canary release deployment.
See canary_settings below. Has no effect whenstage_name` is not set.
- Description string
- Description of the deployment
- StageDescription string
- Description to set on the stage managed by the stage_nameargument. Has no effect whenstage_nameis not set.
- 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.Stageresource 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_nameargument.
- RestApi string | string
- REST API identifier.
- CanarySettings DeploymentCanary Settings Args 
- Input configuration for the canary deployment when the deployment is a canary release deployment.
See canary_settings below. Has no effect whenstage_name` is not set.
- Description string
- Description of the deployment
- StageDescription string
- Description to set on the stage managed by the stage_nameargument. Has no effect whenstage_nameis not set.
- 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.Stageresource 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_nameargument.
- restApi String | String
- REST API identifier.
- canarySettings DeploymentCanary Settings 
- Input configuration for the canary deployment when the deployment is a canary release deployment.
See canary_settings below. Has no effect whenstage_name` is not set.
- description String
- Description of the deployment
- stageDescription String
- Description to set on the stage managed by the stage_nameargument. Has no effect whenstage_nameis not set.
- 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.Stageresource 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_nameargument.
- restApi string | RestApi 
- REST API identifier.
- canarySettings DeploymentCanary Settings 
- Input configuration for the canary deployment when the deployment is a canary release deployment.
See canary_settings below. Has no effect whenstage_name` is not set.
- description string
- Description of the deployment
- stageDescription string
- Description to set on the stage managed by the stage_nameargument. Has no effect whenstage_nameis not set.
- 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.Stageresource 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_nameargument.
- rest_api str | str
- REST API identifier.
- canary_settings DeploymentCanary Settings Args 
- Input configuration for the canary deployment when the deployment is a canary release deployment.
See canary_settings below. Has no effect whenstage_name` is not set.
- description str
- Description of the deployment
- stage_description str
- Description to set on the stage managed by the stage_nameargument. Has no effect whenstage_nameis not set.
- 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.Stageresource 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_nameargument.
- restApi String |
- REST API identifier.
- canarySettings Property Map
- Input configuration for the canary deployment when the deployment is a canary release deployment.
See canary_settings below. Has no effect whenstage_name` is not set.
- description String
- Description of the deployment
- stageDescription String
- Description to set on the stage managed by the stage_nameargument. Has no effect whenstage_nameis not set.
- 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.Stageresource 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_nameargument.
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'ssource_arnwhen 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'ssource_arnwhen 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'ssource_arnwhen 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'ssource_arnwhen 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'ssource_arnwhen 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'ssource_arnwhen 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,
        canary_settings: Optional[DeploymentCanarySettingsArgs] = 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) -> Deploymentfunc 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)resources:  _:    type: aws:apigateway:Deployment    get:      id: ${id}- 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.
- CanarySettings DeploymentCanary Settings 
- Input configuration for the canary deployment when the deployment is a canary release deployment.
See canary_settings below. Has no effect whenstage_name` is not set.
- CreatedDate string
- Creation date of the deployment
- Description string
- Description of the deployment
- ExecutionArn string
- Execution ARN to be used in lambda_permission'ssource_arnwhen 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_nameargument. Has no effect whenstage_nameis not set.
- 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.Stageresource 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_nameargument.
- CanarySettings DeploymentCanary Settings Args 
- Input configuration for the canary deployment when the deployment is a canary release deployment.
See canary_settings below. Has no effect whenstage_name` is not set.
- CreatedDate string
- Creation date of the deployment
- Description string
- Description of the deployment
- ExecutionArn string
- Execution ARN to be used in lambda_permission'ssource_arnwhen 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_nameargument. Has no effect whenstage_nameis not set.
- 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.Stageresource 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_nameargument.
- canarySettings DeploymentCanary Settings 
- Input configuration for the canary deployment when the deployment is a canary release deployment.
See canary_settings below. Has no effect whenstage_name` is not set.
- createdDate String
- Creation date of the deployment
- description String
- Description of the deployment
- executionArn String
- Execution ARN to be used in lambda_permission'ssource_arnwhen 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_nameargument. Has no effect whenstage_nameis not set.
- 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.Stageresource 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_nameargument.
- canarySettings DeploymentCanary Settings 
- Input configuration for the canary deployment when the deployment is a canary release deployment.
See canary_settings below. Has no effect whenstage_name` is not set.
- createdDate string
- Creation date of the deployment
- description string
- Description of the deployment
- executionArn string
- Execution ARN to be used in lambda_permission'ssource_arnwhen 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_nameargument. Has no effect whenstage_nameis not set.
- 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.Stageresource 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_nameargument.
- canary_settings DeploymentCanary Settings Args 
- Input configuration for the canary deployment when the deployment is a canary release deployment.
See canary_settings below. Has no effect whenstage_name` is not set.
- 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'ssource_arnwhen 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_nameargument. Has no effect whenstage_nameis not set.
- 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.Stageresource 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_nameargument.
- canarySettings Property Map
- Input configuration for the canary deployment when the deployment is a canary release deployment.
See canary_settings below. Has no effect whenstage_name` is not set.
- createdDate String
- Creation date of the deployment
- description String
- Description of the deployment
- executionArn String
- Execution ARN to be used in lambda_permission'ssource_arnwhen 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_nameargument. Has no effect whenstage_nameis not set.
- 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.Stageresource 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_nameargument.
Supporting Types
DeploymentCanarySettings, DeploymentCanarySettingsArgs      
- PercentTraffic double
- Percentage (0.0-100.0) of traffic routed to the canary deployment.
- StageVariable Dictionary<string, string>Overrides 
- Stage variable overrides used for the canary release deployment. They can override existing stage variables or add new stage variables for the canary release deployment. These stage variables are represented as a string-to-string map between stage variable names and their values.
- UseStage boolCache 
- Boolean flag to indicate whether the canary release deployment uses the stage cache or not.
- PercentTraffic float64
- Percentage (0.0-100.0) of traffic routed to the canary deployment.
- StageVariable map[string]stringOverrides 
- Stage variable overrides used for the canary release deployment. They can override existing stage variables or add new stage variables for the canary release deployment. These stage variables are represented as a string-to-string map between stage variable names and their values.
- UseStage boolCache 
- Boolean flag to indicate whether the canary release deployment uses the stage cache or not.
- percentTraffic Double
- Percentage (0.0-100.0) of traffic routed to the canary deployment.
- stageVariable Map<String,String>Overrides 
- Stage variable overrides used for the canary release deployment. They can override existing stage variables or add new stage variables for the canary release deployment. These stage variables are represented as a string-to-string map between stage variable names and their values.
- useStage BooleanCache 
- Boolean flag to indicate whether the canary release deployment uses the stage cache or not.
- percentTraffic number
- Percentage (0.0-100.0) of traffic routed to the canary deployment.
- stageVariable {[key: string]: string}Overrides 
- Stage variable overrides used for the canary release deployment. They can override existing stage variables or add new stage variables for the canary release deployment. These stage variables are represented as a string-to-string map between stage variable names and their values.
- useStage booleanCache 
- Boolean flag to indicate whether the canary release deployment uses the stage cache or not.
- percent_traffic float
- Percentage (0.0-100.0) of traffic routed to the canary deployment.
- stage_variable_ Mapping[str, str]overrides 
- Stage variable overrides used for the canary release deployment. They can override existing stage variables or add new stage variables for the canary release deployment. These stage variables are represented as a string-to-string map between stage variable names and their values.
- use_stage_ boolcache 
- Boolean flag to indicate whether the canary release deployment uses the stage cache or not.
- percentTraffic Number
- Percentage (0.0-100.0) of traffic routed to the canary deployment.
- stageVariable Map<String>Overrides 
- Stage variable overrides used for the canary release deployment. They can override existing stage variables or add new stage variables for the canary release deployment. These stage variables are represented as a string-to-string map between stage variable names and their values.
- useStage BooleanCache 
- Boolean flag to indicate whether the canary release deployment uses the stage cache or not.
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 awsTerraform Provider.