DomainConfiguration
Configures a custom domain for an API.
Syntax
To declare this entity in your Amazon Serverless Application Model (Amazon SAM) template, use the following syntax.
YAML
AccessAssociation:DomainAccessAssociationBasePath:ListCertificateArn:StringDomainName:StringEndpointConfiguration:StringMutualTlsAuthentication:MutualTlsAuthenticationNormalizeBasePath:BooleanOwnershipVerificationCertificateArn:StringPolicy:JsonRoute53:Route53ConfigurationSecurityPolicy:String
Properties
-
AccessAssociation -
The configuration required to generate
AWS::ApiGateway::DomainNameAccessAssociationresource.Amazon SAM generates an AWS::ApiGateway::DomainNameAccessAssociation resource when this property is set. For information about generated Amazon CloudFormation resources, see Generated Amazon CloudFormation resources for Amazon SAM.
Type: DomainAccessAssociation
Required: No
Amazon CloudFormation compatibility: This property is unique to Amazon SAM and doesn't have an Amazon CloudFormation equivalent.
-
BasePath -
A list of the basepaths to configure with the Amazon API Gateway domain name.
Type: List
Required: No
Default: /
Amazon CloudFormation compatibility: This property is similar to the
BasePathproperty of anAWS::ApiGateway::BasePathMappingresource. Amazon SAM creates multipleAWS::ApiGateway::BasePathMappingresources, one perBasePathspecified in this property. -
CertificateArn -
The Amazon Resource Name (ARN) of an Amazon managed certificate this domain name's endpoint. Amazon Certificate Manager is the only supported source.
Type: String
Required: Yes
Amazon CloudFormation compatibility: This property is similar to the
CertificateArnproperty of anAWS::ApiGateway::DomainNameresource. IfEndpointConfigurationis set toREGIONAL(the default value),CertificateArnmaps to RegionalCertificateArn inAWS::ApiGateway::DomainName. If theEndpointConfigurationis set toEDGE,CertificateArnmaps to CertificateArn inAWS::ApiGateway::DomainName. IfEndpointConfigurationis set toPRIVATE, this property is passed to the AWS::ApiGateway::DomainNameV2 resource.Additional notes: For an
EDGEendpoint, you must create the certificate in theus-east-1Amazon Region. -
DomainName -
The custom domain name for your API Gateway API. Uppercase letters are not supported.
Amazon SAM generates an AWS::ApiGateway::DomainName resource when this property is set. For information about this scenario, see DomainName property is specified. For information about generated Amazon CloudFormation resources, see Generated Amazon CloudFormation resources for Amazon SAM.
Type: String
Required: Yes
Amazon CloudFormation compatibility: This property is passed directly to the
DomainNameproperty of anAWS::ApiGateway::DomainNameresource, or toAWS::ApiGateway::DomainNameV2when EndpointConfiguration is set toPRIVATE. -
EndpointConfiguration -
Defines the type of API Gateway endpoint to map to the custom domain. The value of this property determines how the
CertificateArnproperty is mapped in Amazon CloudFormation.Valid values:
EDGE,REGIONAL, orPRIVATEType: String
Required: No
Default:
REGIONALAmazon CloudFormation compatibility: This property is unique to Amazon SAM and doesn't have an Amazon CloudFormation equivalent.
-
MutualTlsAuthentication -
The mutual Transport Layer Security (TLS) authentication configuration for a custom domain name.
Type: MutualTlsAuthentication
Required: No
Amazon CloudFormation compatibility: This property is passed directly to the
MutualTlsAuthenticationproperty of anAWS::ApiGateway::DomainNameresource. -
NormalizeBasePath -
Indicates whether non-alphanumeric characters are allowed in basepaths defined by the
BasePathproperty. When set toTrue, non-alphanumeric characters are removed from basepaths.Use
NormalizeBasePathwith theBasePathproperty.Type: Boolean
Required: No
Default: True
Amazon CloudFormation compatibility: This property is unique to Amazon SAM and doesn't have an Amazon CloudFormation equivalent.
-
OwnershipVerificationCertificateArn -
The ARN of the public certificate issued by ACM to validate ownership of your custom domain. Required only when you configure mutual TLS and you specify an ACM imported or private CA certificate ARN for the
CertificateArn.Type: String
Required: No
Amazon CloudFormation compatibility: This property is passed directly to the
OwnershipVerificationCertificateArnproperty of anAWS::ApiGateway::DomainNameresource. -
Policy -
The IAM policy to attach to the API Gateway domain name. Only applicable when
EndpointConfigurationis set toPRIVATE.Type: Json
Required: No
Amazon CloudFormation compatibility: This property is passed directly to the
Policyproperty of anAWS::ApiGateway::DomainNameV2resource whenEndpointConfigurationis set toPRIVATE. For examples of valid policy documents, see AWS::ApiGateway::DomainNameV2. -
Route53 -
Defines an Amazon Route 53 configuration.
Type: Route53Configuration
Required: No
Amazon CloudFormation compatibility: This property is unique to Amazon SAM and doesn't have an Amazon CloudFormation equivalent.
-
SecurityPolicy -
The TLS version plus cipher suite for this domain name.
Type: String
Required: No
Amazon CloudFormation compatibility: This property is passed directly to the
SecurityPolicyproperty of anAWS::ApiGateway::DomainNameresource, or toAWS::ApiGateway::DomainNameV2whenEndpointConfigurationis set toPRIVATE. ForPRIVATEendpoints, only TLS_1_2 is supported.
Examples
DomainName
DomainName example
YAML
Domain: DomainName: www.example.com CertificateArn: arn-example EndpointConfiguration: EDGE Route53: HostedZoneId: Z1PA6795UKMFR9 BasePath: - foo - bar