AWS Route 53 DNS - Simple Routing

- aws networking dns

This post is part of my note taking while studying for the AWS Certified Advanced Networking - Specialty certification.

AWS Route 53 Simple Routing Policy round-robins responses. Simple Routing has no health checks and no configuration beyond adding multiple results for one record.

Here is an example of configuring a Simple policy in the AWS console:

Route 53 Simple

Via the CLI, you need to create a JSON file of the record you want to create and then add it with change-resource-record-sets.

my-new-record.json

{
  "Comment": "my record set",
  "Changes": [
    {
      "Action": "CREATE",
      "ResourceRecordSet": {
        "Name": "mynewrecord.cloudynetworks.net.",
        "Type": "A",
        "TTL": 60,
        "ResourceRecords": [
          {
            "Value": "127.0.0.1"
          }
        ]
      }
    }
  ]
}



$ aws route53 change-resource-record-sets --hosted-zone-id Z1R8UBAEXAMPLE --change-batch file://my-new-record.json

Output:

{
  "ChangeInfo": {
    "Status": "PENDING",
    "Comment": "A new record set for the zone.",
    "SubmittedAt": "2017-01-03T00:00:00.000Z",
    "Id": "/change/CHANGEID123"
  }
}

You can poll the status of the change:

$ aws route53 get-change --id CHANGEID123

Output:

{
  "ChangeInfo": {
    "Status": "INSYNC",
    "Comment": "A new record set for the zone.",
    "SubmittedAt": "2013-01-03T00:00:00.000Z",
    "Id": "/change/CHANGEID123"
  }
}

Delete a record

Similar to a create, you need a JSON file with an Action of DELETE

delete-this-record.json

{
  "Comment": "delete record set",
  "Changes": [
    {
      "Action": "DELETE",
      "ResourceRecordSet": {
        "Name": "mynewrecord.cloudynetworks.net.",
        "Type": "A",
        "TTL": 60,
        "ResourceRecords": [
          {
            "Value": "127.0.0.1"
          }
        ]
      }
    }
  ]
}


$ aws route53 change-resource-record-sets --hosted-zone-id Z1R8UBAEXAMPLE --change-batch file://delete-this-record.json