Skip to content

Instantly share code, notes, and snippets.

@pierskarsenbarg
Last active March 31, 2021 17:07
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 pierskarsenbarg/bc2934026d3294a6e302d82888a29539 to your computer and use it in GitHub Desktop.
Save pierskarsenbarg/bc2934026d3294a6e302d82888a29539 to your computer and use it in GitHub Desktop.
function getFileHash(): string {
const filename = path.basename(__filename);
const fileContents = fs.readFileSync(filename);
return crypto.createHash("sha256").update(fileContents).digest("hex");
}
const deployment = new aws.apigateway.Deployment("deployment", {
restApi: Api.id,
triggers: {
filechanged: getFileHash(),
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment