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.RestApi
resourcebody
argument), no special dependency setup is needed beyond referencing theid
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 thetriggers
argument or explicit resource references using the resourcedependsOn
custom option. Thetriggers
argument should be preferred overdepends_on
, sincedepends_on
can only capture dependency ordering and will not cause the resource to recreate (redeploy the REST API) with upstream configuration changes.
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,
region: 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",
Region = "string",
Triggers =
{
{ "string", "string" },
},
Variables =
{
{ "string", "string" },
},
});
example, err := apigateway.NewDeployment(ctx, "deploymentResource", &apigateway.DeploymentArgs{
RestApi: pulumi.Any("string"),
Description: pulumi.String("string"),
Region: pulumi.String("string"),
Triggers: pulumi.StringMap{
"string": pulumi.String("string"),
},
Variables: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var deploymentResource = new com.pulumi.aws.apigateway.Deployment("deploymentResource", com.pulumi.aws.apigateway.DeploymentArgs.builder()
.restApi("string")
.description("string")
.region("string")
.triggers(Map.of("string", "string"))
.variables(Map.of("string", "string"))
.build());
deployment_resource = aws.apigateway.Deployment("deploymentResource",
rest_api="string",
description="string",
region="string",
triggers={
"string": "string",
},
variables={
"string": "string",
})
const deploymentResource = new aws.apigateway.Deployment("deploymentResource", {
restApi: "string",
description: "string",
region: "string",
triggers: {
string: "string",
},
variables: {
string: "string",
},
});
type: aws:apigateway:Deployment
properties:
description: string
region: 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:
- Rest
Api string | string - REST API identifier.
- Description string
- Description of the deployment.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- 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 related stage.
- Rest
Api string | string - REST API identifier.
- Description string
- Description of the deployment.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- 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 related stage.
- rest
Api String | String - REST API identifier.
- description String
- Description of the deployment.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- 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 related stage.
- rest
Api string | RestApi - REST API identifier.
- description string
- Description of the deployment.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- 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 related stage.
- rest_
api str | str - REST API identifier.
- description str
- Description of the deployment.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- 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 related stage.
- rest
Api String | - REST API identifier.
- description String
- Description of the deployment.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- triggers Map<String>
- Map of arbitrary keys and values that, when changed, will trigger a redeployment.
- variables Map<String>
- Map to set on the related stage.
Outputs
All input properties are implicitly available as output properties. Additionally, the Deployment resource produces the following output properties:
- Created
Date string - Creation date of the deployment
- Id string
- The provider-assigned unique ID for this managed resource.
- Created
Date string - Creation date of the deployment
- Id string
- The provider-assigned unique ID for this managed resource.
- created
Date String - Creation date of the deployment
- id String
- The provider-assigned unique ID for this managed resource.
- created
Date string - Creation date of the deployment
- id string
- The provider-assigned unique ID for this managed resource.
- created_
date str - Creation date of the deployment
- id str
- The provider-assigned unique ID for this managed resource.
- created
Date String - Creation date of the deployment
- id String
- The provider-assigned unique ID for this managed resource.
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,
region: Optional[str] = None,
rest_api: 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)
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.
- Created
Date string - Creation date of the deployment
- Description string
- Description of the deployment.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Rest
Api string | string - REST API identifier.
- 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 related stage.
- Created
Date string - Creation date of the deployment
- Description string
- Description of the deployment.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Rest
Api string | string - REST API identifier.
- 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 related stage.
- created
Date String - Creation date of the deployment
- description String
- Description of the deployment.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rest
Api String | String - REST API identifier.
- 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 related stage.
- created
Date string - Creation date of the deployment
- description string
- Description of the deployment.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rest
Api string | RestApi - REST API identifier.
- 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 related stage.
- created_
date str - Creation date of the deployment
- description str
- Description of the deployment.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rest_
api str | str - REST API identifier.
- 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 related stage.
- created
Date String - Creation date of the deployment
- description String
- Description of the deployment.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rest
Api String | - REST API identifier.
- triggers Map<String>
- Map of arbitrary keys and values that, when changed, will trigger a redeployment.
- variables Map<String>
- Map to set on the related stage.
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 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.