Skip to content

Instantly share code, notes, and snippets.

@chtz
Last active May 11, 2020 07:19
Show Gist options
  • Save chtz/f99c90d136d05cb51e57bb1bc7d6ef8d to your computer and use it in GitHub Desktop.
Save chtz/f99c90d136d05cb51e57bb1bc7d6ef8d to your computer and use it in GitHub Desktop.
AWS SDK JavaScript update A Record in Route53
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