-
-
Save lantrix/3f8fbe8c8b18469d0472279634d90fb9 to your computer and use it in GitHub Desktop.
Revisions
-
lantrix revised this gist
Jan 18, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -16,12 +16,12 @@ cat > ./dnsupdate.json <<EOF { "Action": "UPSERT", "ResourceRecordSet": { "Name": "${domain_name}", "Type": "A", "TTL": 300, "ResourceRecords": [ { "Value": "${ip_address}" } ] } -
lantrix revised this gist
Jan 18, 2019 . 1 changed file with 4 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,13 @@ #!/bin/bash hosted_zone_id='Z57Q212345678' domain_name='server.example.com' # Abort script on any errors set -e # Get new IP address ip_address=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4) # Build temporary file cat > ./dnsupdate.json <<EOF @@ -31,5 +31,4 @@ cat > ./dnsupdate.json <<EOF EOF # Call Route53 to update DNS aws route53 change-resource-record-sets --hosted-zone-id ${hosted_zone_id} --change-batch file://./dnsupdate.json -
TonyFNZ created this gist
Oct 9, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ #!/bin/bash hosted_zone_id="<your Route53 hosted zone id>" domain_name="<your domain name>" # Abort script on any errors set -e # Get new IP address ip_address=`curl http://169.254.169.254/latest/meta-data/public-ipv4` # Build temporary file cat > ./dnsupdate.json <<EOF { "Changes": [ { "Action": "UPSERT", "ResourceRecordSet": { "Name": "$domain_name", "Type": "A", "TTL": 300, "ResourceRecords": [ { "Value": "$ip_address" } ] } } ] } EOF # Call Route53 to update DNS aws route53 change-resource-record-sets --hosted-zone-id $hosted_zone_id --change-batch file://./dnsupdate.json