AWS Route 53 Record

This page shows how to write Terraform and CloudFormation for Route 53 Record and write them securely.

aws_route53_record (Terraform)

The Record in Route 53 can be configured in Terraform with the resource name aws_route53_record. The following sections describe 2 examples of how to use the resource and its parameters.

Example Usage from GitHub

gat-oz.tf#L2
resource "aws_route53_record" "training-vm-oz-0" {
  zone_id = data.aws_route53_zone.training-gxp-eu.zone_id
  name    = "gat-0.oz.training.galaxyproject.eu"
  type    = "A"
  ttl     = "7200"
  records = ["115.146.85.100"]
graphaware.com.tf#L5
resource "aws_route53_record" "osamaoracle_com__mx" {
  zone_id = aws_route53_zone.osamaoracle_com.zone_id
  name    = ""
  type    = "MX"
  ttl     = "300"

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides a Route53 record resource.

AWS::Route53::RecordSet (CloudFormation)

The RecordSet in Route53 can be configured in CloudFormation with the resource name AWS::Route53::RecordSet. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

base.yml#L68
    Type: AWS::Route53::RecordSet
    Properties:
      Name:
        Fn::ImportValue: !Sub '${HostedZoneStack}-name'
      HostedZoneId:
        Fn::ImportValue: !Sub '${HostedZoneStack}-id'
base.yml#L68
    Type: AWS::Route53::RecordSet
    Properties:
      Name:
        Fn::ImportValue: !Sub '${HostedZoneStack}-name'
      HostedZoneId:
        Fn::ImportValue: !Sub '${HostedZoneStack}-id'
base.yml#L68
    Type: AWS::Route53::RecordSet
    Properties:
      Name:
        Fn::ImportValue: !Sub '${HostedZoneStack}-name'
      HostedZoneId:
        Fn::ImportValue: !Sub '${HostedZoneStack}-id'
prod.yml#L15
    Type: "AWS::Route53::RecordSet"
    Properties:
      Name:
        !Sub
        - 'dev.${DomainName}'
        - DomainName:
prod.yml#L11
    Type: "AWS::Route53::RecordSet"
    Properties:
      Name: '_16963e3ff6d1efbe92bfdddaed549e39.suggpro.fr'
      HostedZoneName: 'suggpro.fr.'
      Type: CNAME
      TTL: 900
route53.json#L38
     "Type": "AWS::Route53::RecordSet",
      "Properties": {
        "HostedZoneName": "dirtybit.io.",
        "Name": "db-mon-m01.dirtybit.io.",
        "ResourceRecords": [ "217.100.96.52" ],
        "TTL": "3600",
recordset.json#L32
      "Type": "AWS::Route53::RecordSet",
      "Properties": {
        "HostedZoneName": {
          "Ref": "targetHostedZoneName"
        },
        "TTL": "900",
dev-umbraco.json#L281
                "Type" : "AWS::Route53::RecordSet",
                "Properties" : {
                "HostedZoneName" :  { "Ref" : "EnvironmentSuffix" },
                "Comment" : "DNS name for instance.",
                "Name" : { "Fn::Join" : [ "", ["sw-hit-",{ "Ref" : "EnvironmentName" },".",{ "Ref" : "EnvironmentSuffix" }]]},
                "Type" : "A",
myamazingtech-local-us-east-1-r53.json#L25
            "Type": "AWS::Route53::RecordSet",
            "Properties": {
                "HostedZoneId": {
                    "Ref": "R53HZROOT"
                },
                "Name": "myamazingtech.com",
dns.json#L21
      "Type": "AWS::Route53::RecordSet",
      "Properties": {
        "HostedZoneName": {
          "Fn::Sub": "${BaseDomainName}."
        },
        "Name": {

Parameters

Explanation in CloudFormation Registry

Information about the record that you want to create.

The AWS::Route53::RecordSet type can be used as a standalone resource or as an embedded property in the AWS::Route53::RecordSetGroup type. Note that some AWS::Route53::RecordSet properties are valid only when used within AWS::Route53::RecordSetGroup. For more information, see ChangeResourceRecordSets in the Amazon Route 53 API Reference.

Frequently asked questions

What is AWS Route 53 Record?

AWS Route 53 Record is a resource for Route 53 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Route 53 Record?

For Terraform, the galaxyproject/admin-training and OsamaOracle/infrastructure-scripts-terraform source code examples are useful. See the Terraform Example section for further details.

For CloudFormation, the Benjamin-99/Webapp, Benjamin-99/Webapp and Benjamin-99/Webapp source code examples are useful. See the CloudFormation Example section for further details.