AWS::ApiGateway::BasePathMappingV2 - AWS CloudFormation

AWS::ApiGateway::BasePathMappingV2

The AWS::ApiGateway::BasePathMappingV2 resource creates a base path that clients who call your API must use in the invocation URL. Supported only for private custom domain names.

Syntax

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

JSON

{ "Type" : "AWS::ApiGateway::BasePathMappingV2", "Properties" : { "BasePath" : String, "DomainNameArn" : String, "RestApiId" : String, "Stage" : String } }

YAML

Type: AWS::ApiGateway::BasePathMappingV2 Properties: BasePath: String DomainNameArn: String RestApiId: String Stage: String

Properties

BasePath

The base path name that callers of the private API must provide as part of the URL after the domain name.

Required: No

Type: String

Update requires: Replacement

DomainNameArn

The ARN of the domain name for the BasePathMappingV2 resource to be described.

Required: Yes

Type: String

Update requires: Replacement

RestApiId

The private API's identifier. This identifier is unique across all of your APIs in API Gateway.

Required: Yes

Type: String

Update requires: No interruption

Stage

Represents a unique identifier for a version of a deployed private RestApi that is callable by users. The Stage must depend on the RestApi's stage. To create a dependency, add a DependsOn attribute to the BasePathMappingV2 resource.

Required: No

Type: String

Update requires: No interruption

Examples

Base path mapping creation example

The following example creates a BasePathMappingV2 resource called MyBasePathMappingV2.

JSON

{ "MyBasePathMappingV2": { "Type": "AWS::ApiGateway::BasePathMappingV2", "DependsOn": [ "PrivateApiStage" ], "Properties": { "BasePath": "prod", "DomainNameArn": { "Fn::GetAtt": [ "MyDomainName", "DomainNameArn" ] }, "RestApiId": "a1b2c3", "Stage": "users" } } }

YAML

MyBasePathMappingV2: Type: AWS::ApiGateway::BasePathMappingV2 DependsOn: - PrivateApiStage Properties: BasePath: prod DomainNameArn: !GetAtt MyDomainName.DomainNameArn RestApiId: a1b2c3 Stage: users