AWS::ApiGatewayV2::ApiMapping
The AWS::ApiGatewayV2::ApiMapping
resource contains an API mapping.
An API mapping relates a path of your custom domain name to a stage of your API. A
custom domain name can have multiple API mappings, but the paths can't overlap. A
custom domain can map only to APIs of the same protocol type. 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 API identifier.
Required: Yes
Type: String
Update requires: No interruption
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
.
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
.
ApiMappingId
-
The API mapping resource ID.
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
-
CreateApiMapping in the Amazon API Gateway Version 2 API Reference