Skip to content

Instantly share code, notes, and snippets.

@virtualhobbit
Last active July 13, 2020 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save virtualhobbit/48b0b12d922be14c7498711c7bfeb7a3 to your computer and use it in GitHub Desktop.
Save virtualhobbit/48b0b12d922be14c7498711c7bfeb7a3 to your computer and use it in GitHub Desktop.
//Compute the full URL
var requestUrlString = "/2013-04-01/hostedzone/" + attHostedZone + "/rrset";
var request = attRestHost.createRequest("POST", requestUrlString, attBody);
//Set the authentication header
request.setHeader("Authorization", attAuthString);
request.setHeader("X-Amz-Content-Sha256", attHashedPayload);
request.setHeader("X-Amz-Date", attAmzDate);
//Execute the request and get the response
var response;
response = request.execute();
var statusCode = response.statusCode;
var responseContent = response.contentAsString;
System.log(responseContent);
System.log("StatusCode = " + statusCode);
if (statusCode != 200) {
System.error("Error:");
throw new Error("Failed to modify Route53 hosted zone: " + statusCode);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment