Skip to content

Custom Domains - Support for HostedZoneName instead of HostedZoneId #1402

@mbarneyjr

Description

@mbarneyjr

Support using HostedZoneName instead of HostedZoneId in the Domain section of an AWS::Serverless::Api, like this:

Globals:
  Api:
    Domain:
      DomainName: www.domain.com
      CertificateArn: arn:aws:acm:us-east-1:000000000000:certificate/abcxyz
      EndpointConfiguration: REGIONAL
      Route53:
        HostedZoneName: www.domain.com
        DistributionDomainName: www.domain.com

This property would just need to be passed directly to the HostedZoneName property of the AWS::Route53::RecordSet created resource, since CloudFormation itself handles looking up the hosted zone ID.

When you create a stack using an AWS::Route53::RecordSet that specifies HostedZoneName, AWS CloudFormation attempts to find a hosted zone whose name matches the HostedZoneName. If AWS CloudFormation cannot find a hosted zone with a matching domain name, or if there is more than one hosted zone with the specified domain name, AWS CloudFormation will not create the stack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions