Skip to content

Instantly share code, notes, and snippets.

@jlamoree
Last active September 8, 2020 13:26
Show Gist options
  • Save jlamoree/1ddd654fced6d3b13e8ea82407c92763 to your computer and use it in GitHub Desktop.
Save jlamoree/1ddd654fced6d3b13e8ea82407c92763 to your computer and use it in GitHub Desktop.
Bash script to update a record on AWS Route53
#!/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