Last active
September 8, 2020 13:26
-
-
Save jlamoree/1ddd654fced6d3b13e8ea82407c92763 to your computer and use it in GitHub Desktop.
Bash script to update a record on AWS Route53
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
#!/usr/bin/env bash | |
# This could be updated to receive the hostname and address as arguments, if needed. | |
profile=route53 | |
zone_id=ZXXXXXXXXXX | |
fqdn=foo.aws.lamoree.net | |
ip=1.2.3.4 | |
aws --profile $profile route53 change-resource-record-sets --hosted-zone-id $zone_id \ | |
--change-batch '{"Changes":[{"Action": "UPSERT","ResourceRecordSet":{"Name":"'$fqdn'","Type":"A","TTL":300,"ResourceRecords":[{"Value":"'$ip'"}]}}]}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment