aws-cli

Route 53 Commands

Some useful commands:

# List hosted zones
aws route53 list-hosted-zones

# List resources in hosted zone:
aws route53 list-resource-record-sets --hosted-zone-id YOUR_HOSTED_ZONE_ID

# Delete a record (Must have all properties)
aws route53 change-resource-record-sets --hosted-zone-id /hostedzone/ABCDEFG --change-batch '{"Changes":[{"Action":"DELETE","ResourceRecordSet":{"Name":"subdomain.domain.com.","Type":"A","TTL":1800,"ResourceRecords":[{"Value":"1.2.3.4"}]}}]}'

# ^ Prints:
{
    "ChangeInfo": {
        "Id": "/change/ABCDEFGHIJKLMNOP",
        "Status": "PENDING",
        "SubmittedAt": "2023-12-16T24:22:52.886Z"
    }
}

# Create new record
aws route53 change-resource-record-sets --hosted-zone-id YOUR_HOSTED_ZONE_ID --change-batch '{"Changes":[{"Action":"CREATE","ResourceRecordSet":{"Name":"your.domain.com.","Type":"A","TTL":300,"ResourceRecords":[{"Value":"new_ip_address"}]}}]}'