-
Notifications
You must be signed in to change notification settings - Fork 582
/
route53-record-set.sh
executable file
·34 lines (28 loc) · 1.3 KB
/
route53-record-set.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
HOSTEDZONEID="id"
profile="xyz"
cat > change-batch.json << EOL
{"Comment":"test","Changes":[{"Action":"CREATE","ResourceRecordSet":{"Name":"mail.shawnwoodford.com","Type":"CNAME","Region":"us-east-1","TTL":300,"ResourceRecords":[{"Value":"ghs.googlehosted.com"}]}}]}
EOL
# aws route53 change-resource-record-sets --hosted-zone-id $HOSTEDZONEID --profile $profile --cli-input-json '
# {
# "HostedZoneId": "$HOSTEDZONEID",
# "ChangeBatch": {
# "Comment": "test",
# "Changes": [{
# "Action": "CREATE",
# "ResourceRecordSet": {
# "Name": "mail.shawnwoodford.com",
# "Type": "CNAME",
# "Region": "us-east-1",
# "TTL": 300,
# "ResourceRecords": [{
# "Value": "ghs.googlehosted.com"
# }]
# }
# }]
# }
# }'
# rm change-batch.json
# aws route53 change-resource-record-sets --hosted-zone-id $HOSTEDZONEID --profile $profile --cli-input-json '{"HostedZoneId":"$HOSTEDZONEID","ChangeBatch":{"Comment":"test","Changes":[{"Action":"CREATE","ResourceRecordSet":{"Name":"mail.shawnwoodford.com","Type":"CNAME","Region":"us-east-1","TTL":300,"ResourceRecords":[{"Value":"ghs.googlehosted.com"}]}}]}}'
aws route53 change-resource-record-sets --hosted-zone-id $HOSTEDZONEID --profile $profile --change-batch file://change-batch.json