AWS::ApiGatewayV2::DomainName - AWS CloudFormation

AWS::ApiGatewayV2::DomainName

The AWS::ApiGatewayV2::DomainName resource specifies a custom domain name for your API in Amazon API Gateway (API Gateway).

You can use a custom domain name to provide a URL that's more intuitive and easier to recall. For more information about using custom domain names, see Set up Custom Domain Name for an 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::DomainName", "Properties" : { "DomainName" : String, "DomainNameConfigurations" : [ DomainNameConfiguration, ... ], "MutualTlsAuthentication" : MutualTlsAuthentication, "Tags" : {Key: Value, ...} } }

YAML

Type: AWS::ApiGatewayV2::DomainName Properties: DomainName: String DomainNameConfigurations: - DomainNameConfiguration MutualTlsAuthentication: MutualTlsAuthentication Tags: Key: Value

Properties

DomainName

The custom domain name for your API in Amazon API Gateway. Uppercase letters and the underscore (_) character are not supported.

Required: Yes

Type: String

Update requires: Replacement

DomainNameConfigurations

The domain name configurations.

Required: No

Type: Array of DomainNameConfiguration

Update requires: No interruption

MutualTlsAuthentication

The mutual TLS authentication configuration for a custom domain name.

Required: No

Type: MutualTlsAuthentication

Update requires: No interruption

Tags

The collection of tags associated with a domain name.

Required: No

Type: Object of String

Pattern: .*

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the domain name, such as example.mydomain.com.

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.

RegionalDomainName

The domain name associated with the regional endpoint for this custom domain name. You set up this association by adding a DNS record that points the custom domain name to this regional domain name.

RegionalHostedZoneId

The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint.

Examples

Domain name creation example

The following example creates a DomainName resource called MyDomainName.

JSON

{ "MyDomainName": { "Type": "AWS::ApiGatewayV2::DomainName", "Properties": { "DomainName": "mydomainame.us-east-1.com", "DomainNameConfigurations": [ { "EndpointType": "REGIONAL", "CertificateArn": "arn:aws:acm:us-east-1:123456789012:certificate/1a2b3c4d-aaaa-aaaa-aaaa-1a2b3c4d5e6f", "CertificateName": "testCertificate" } ] } } }

YAML

MyDomainName: Type: 'AWS::ApiGatewayV2::DomainName' Properties: DomainName: mydomainame.us-east-1.com DomainNameConfigurations: - EndpointType: REGIONAL CertificateArn: >- arn:aws:acm:us-east-1:123456789012:certificate/1a2b3c4d-aaaa-aaaa-aaaa-1a2b3c4d5e6f CertificateName: testCertificate

See also