Skip to content

Instantly share code, notes, and snippets.

@li0nel
Last active January 1, 2019 06:02
Show Gist options
  • Save li0nel/124022c6d5b2ccd752bb6cd2bc2098b0 to your computer and use it in GitHub Desktop.
Save li0nel/124022c6d5b2ccd752bb6cd2bc2098b0 to your computer and use it in GitHub Desktop.
Migrate Route53 DNS
# Add an ALIAS record to ELB URL
aws route53 change-resource-record-sets 
--hosted-zone-id /hostedzone/YOUR_HOSTED_ZONE_ID
--change-batch '{
"Changes":[
{
"Action":"CREATE",
"ResourceRecordSet":{
"Name":"laravelaws.com.",
"Type":"A",
"AliasTarget":{
"DNSName":"laravelaws2-1297867430.ap-southeast-2.elb.amazonaws.com",
"EvaluateTargetHealth":true,
"HostedZoneId":"YOUR_HOSTED_ZONE_ID"
}
}
}
]
}'
# Track the propagation of the record
aws route53 get-change --id /change/YOUR_CHANGE_ID
# Test your record even before it is propagated
aws route53 test-dns-answer
--hosted-zone-id /hostedzone/YOUR_HOSTED_ZONE_ID
--record-name laravelaws.com 
--record-type A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment