Last active
January 1, 2019 06:02
-
-
Save li0nel/124022c6d5b2ccd752bb6cd2bc2098b0 to your computer and use it in GitHub Desktop.
Migrate Route53 DNS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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