This is the new AWS CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the AWS CloudFormation User Guide.
AWS::ApiGatewayV2::Deployment
The AWS::ApiGatewayV2::Deployment resource creates a deployment for
an API.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::ApiGatewayV2::Deployment", "Properties" : { "ApiId" :String, "Description" :String, "StageName" :String} }
YAML
Type: AWS::ApiGatewayV2::Deployment Properties: ApiId:StringDescription:StringStageName:String
Properties
ApiId-
The API identifier.
Required: Yes
Type: String
Update requires: Replacement
Description-
The description for the deployment resource.
Required: No
Type: String
Update requires: No interruption
StageName-
The name of an existing stage to associate with the deployment.
Required: No
Type: String
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the deployment ID, such as
123abc.
For more information about using the Ref function, see Ref.
Fn::GetAtt
The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.
DeploymentId-
The deployment ID.
Examples
Deployment creation example
The following example creates a deployment resource for
the MyApi API, which has the MyRoute route
defined.
JSON
{ "Deployment": { "Type": "AWS::ApiGatewayV2::Deployment", "DependsOn": [ "MyRoute" ], "Properties": { "Description": "My deployment", "ApiId": { "Ref": "MyApi" }, "StageName": "Beta" } } }
YAML
Deployment: Type: 'AWS::ApiGatewayV2::Deployment' DependsOn: - MyRoute Properties: Description: My deployment ApiId: !Ref MyApi StageName: Beta
See also
-
CreateDeployment in the Amazon API Gateway Version 2 API Reference