Skip to content

Instantly share code, notes, and snippets.

@Efrat19
Created February 19, 2020 09:40
Show Gist options
  • Save Efrat19/755b847ab6264e597971cda5a3e49650 to your computer and use it in GitHub Desktop.
Save Efrat19/755b847ab6264e597971cda5a3e49650 to your computer and use it in GitHub Desktop.
#!/bin/bash
KEY=dr.newadmin
VALUE=a88dd1213cf1811e9803406c5e12f321-536496363.eu-west-1.elb.amazonaws.com
HOSTED_ZONE_ID=Z2JG04O2LDY5NZ
# Creates route 53 records based on KEY name
aws route53 change-resource-record-sets --hosted-zone-id $HOSTED_ZONE_ID --change-batch '{ "Comment": "Testing creating a record set", "Changes": [ { "Action": "CREATE", "ResourceRecordSet": { "Name": "'"$KEY"'.hosted.zone.com", "Type": "CNAME", "TTL": 120, "ResourceRecords": [ { "Value": "'"$VALUE"'" } ] } } ] }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment