Last active
January 31, 2024 23:34
-
-
Save samg/aae5cdde497d7dc9c662ba1a81978dd5 to your computer and use it in GitHub Desktop.
example logging curl command for CFN custom resources
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
module.exports = async message => { | |
/* Custom resources have timeouts on the order of hours. If a resource fails | |
* to deploy, we can look at the logs to at least be able to manually fail the | |
* resource action so we can try again quickly. */ | |
const failureResponse = { | |
Status: 'FAILED', | |
Reason: 'Manually cancelled', | |
PhysicalResourceId: message.PhysicalResourceId || 'resource', | |
StackId: message.StackId, | |
RequestId: message.RequestId, | |
LogicalResourceId: message.LogicalResourceId | |
}; | |
console.log('To forcibly fail this provision, execute this cURL command:'); | |
console.log(`curl -X PUT '${message.ResponseURL}' -H 'Content-Type:' -d '${JSON.stringify(failureResponse)}'`); | |
// more code goes here... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment