AWS CloudFormation
User Guide (Version )

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

AWS::ApiGatewayV2::ApiMapping

The AWS::ApiGatewayV2::ApiMapping resource contains an API mapping. For more information, see CreateApiMapping in the Amazon API Gateway V2 API Reference.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::ApiGatewayV2::ApiMapping", "Properties" : { "ApiId" : String, "ApiMappingKey" : String, "DomainName" : String, "Stage" : String } }

YAML

Type: AWS::ApiGatewayV2::ApiMapping Properties: ApiId: String ApiMappingKey: String DomainName: String Stage: String

Properties

ApiId

The identifier of the API.

Required: Yes

Type: String

Update requires: Replacement

ApiMappingKey

The API mapping key.

Required: No

Type: String

Update requires: No interruption

DomainName

The domain name.

Required: Yes

Type: String

Update requires: Replacement

Stage

The API stage.

Required: Yes

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 API mapping resource ID.

For more information about using the Ref function, see Ref.

Examples

API mapping creation example

The following example creates an ApiMapping resource called MyApiMapping.

JSON

{ "MyApiMapping": { "Type": "AWS::ApiGatewayV2::ApiMapping", "Properties": { "DomainName": "mydomainame.us-east-1.com", "ApiId": { "Ref": "MyApi" }, "Stage": { "Ref": "MyStage" } } } }

YAML

MyApiMapping: Type: 'AWS::ApiGatewayV2::ApiMapping' Properties: DomainName: mydomainame.us-east-1.com ApiId: !Ref MyApi Stage: !Ref MyStage

See Also