In this recipe, we'll show you how to host a domain in Route 53 and add some records to it:
Hosting a domain
You technically don't need to have registered a domain name in order to proceed with this recipe, but it sure helps if you have a real domain that you can use.
- Create a new CloudFormation template and add the following
Parameter
to it:
Parameters: DomainName: Description: Your domain name (example.org) Type: String
- Next we need to add a
HostedZone
resource to our template, as follows:
Resources: DNSHostedZone: Type: AWS::Route53::HostedZone Properties: Name: !Ref DomainName
- You're now ready to go ahead and create your hosted zone in Route 53. You can do so via the CloudFormation web console, or use the following CLI command:
aws cloudformation create-stack \ --stack-name example-hosted-zone \ --template-body file://07-hosting-a-domain.yaml...