Last active
May 11, 2020 07:19
-
-
Save chtz/f99c90d136d05cb51e57bb1bc7d6ef8d to your computer and use it in GitHub Desktop.
AWS SDK JavaScript update A Record in Route53
This file contains 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
const AWS = require('aws-sdk'); | |
const route53 = new AWS.Route53(); | |
await route53.changeResourceRecordSets({ | |
ChangeBatch: { | |
Changes: [ | |
{ | |
Action: "UPSERT", | |
ResourceRecordSet: { | |
Name: domain, | |
ResourceRecords: [ | |
{ | |
Value: ip | |
} | |
], | |
TTL: 60, | |
Type: "A" | |
} | |
} | |
], | |
Comment: "Updated by " + user | |
}, | |
HostedZoneId: hostedZoneId | |
}).promise(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment