Last active
August 22, 2021 06:53
-
-
Save stephennancekivell/cd5a0b1f342b8914d6ca1551315e553f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
IP=$(curl ifconfig.me) | |
echo "ip is $IP" | |
MSG="{ | |
\"Changes\": [ | |
{ | |
\"Action\": \"UPSERT\", | |
\"ResourceRecordSet\": { | |
\"Name\": \"$RECORD_SET\", | |
\"Type\": \"A\", | |
\"TTL\": 60, | |
\"ResourceRecords\": [ | |
{ | |
\"Value\": \"$IP\" | |
} | |
] | |
} | |
} | |
] | |
}" | |
echo $MSG | |
aws route53 change-resource-record-sets --hosted-zone-id "$HOSTED_ZONE" --change-batch "$MSG" | cat | |
echo "$RECORD_SET set to $IP" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment