DomainConfiguration - AWS Serverless Application Model

DomainConfiguration

Configures a custom domain for an API.

Syntax

To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.

Properties

BasePath

List of basepaths to be configured with the API Gateway Domain Name.

Type: List

Required: No

Default: /

AWS CloudFormation Compatibility: This property is similar to the BasePath property of an AWS::ApiGateway::BasePathMapping resource. SAM will create multiple AWS::ApiGateway::BasePathMapping resources, one per BasePath specified in this property.

CertificateArn

The reference to an AWS-managed certificate for use by the endpoint for this domain name. AWS Certificate Manager is the only supported source.

Type: String

Required: Yes

AWS CloudFormation Compatibility: This property is similar to the CertificateArn property of an AWS::ApiGateway::DomainName resource. If EndpointConfiguration is set to REGIONAL (the default value), CertificateArn maps to RegionalCertificateArn in AWS::ApiGateway::DomainName. If the EndpointConfiguration is set to EDGE, CertificateArn maps to CertificateArn in AWS::ApiGateway::DomainName.

Additional Notes: For an EDGE endpoint, the certificate must be created in the us-east-1 region.

DomainName

The custom domain name for your API Gateway API. Uppercase letters are not supported.

AWS SAM generates an AWS::ApiGateway::DomainName resource when this property is set. For information about this scenario, see DomainName Property Is Specified. For general information about generated AWS CloudFormation resources, see Generated AWS CloudFormation Resources.

Type: String

Required: Yes

AWS CloudFormation Compatibility: This property is passed directly to the DomainName property of an AWS::ApiGateway::DomainName resource.

EndpointConfiguration

Property to define the type of API Gateway endpoint to be mapped to the custom domain. The value of this property controls how the CertificateArn property gets mapped in AWS CloudFormation. See CertificateArn above.

Valid values are REGIONAL or EDGE.

Type: String

Required: No

Default: REGIONAL

AWS CloudFormation Compatibility: This property is unique to AWS SAM and doesn't have an AWS CloudFormation equivalent.

Route53

Property that adds Route53 configuration based on the values defined.

Type: Route53Configuration

Required: No

AWS CloudFormation Compatibility: This property is unique to AWS SAM and doesn't have an AWS CloudFormation equivalent.

Examples

DomainName

DomainName example

YAML

Domain: DomainName: www.example.com CertificateArn: arn-example EndpointConfiguration: EDGE Route53: HostedZoneId: Z1PA6795UKMFR9 BasePath: - /foo - /bar