Last active
March 31, 2021 17:07
-
-
Save pierskarsenbarg/bc2934026d3294a6e302d82888a29539 to your computer and use it in GitHub Desktop.
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
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