AWS CloudFormation
User Guide (Version )

AWS::ApiGatewayV2::Deployment

The AWS::ApiGatewayV2::Deployment resource creates a deployment for an API. For more information, see Deploy a WebSocket API in API Gateway in the API Gateway Developer Guide.

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: String Description: String StageName: 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 the Stage resource for the Deployment resource to create.

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.

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