custom-resources: provider-framework ignores Status response from user lambdas #27208
Labels
@aws-cdk/custom-resources
Related to AWS CDK Custom Resources
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the bug
There is (IMO) a bug in the custom resource provider framework CDK code here.
This custom resource provider function calls my user defined Lambda and gets a result back. My user Lambda can fail, and when it does it returns a JSON object that contains
{ "Status": "FAILED" }
(this is even in the object on line 37). But, then this CDK provider framework code ignore this status on line 43 and sendsSUCCESS
back which does not fail the deployment. The same happens on line 86, too, but that's not my codepath.Expected Behavior
I expect the status to be equal to the one in my Lambda response, which may be 'FAILED'. This should fail the deployment.
Current Behavior
The response is hard coded as 'SUCCESS' and the deployment will always succeed.
Reproduction Steps
Create a Lambda that always replies with the
{ "Status": "FAILED" }
and use it in a custom resource like this, then deploy the stack. It will succeed.Possible Solution
Honor the response from the Lambda.
Additional Information/Context
No response
CDK CLI Version
2.95.1 (build ae455d8)
Framework Version
No response
Node.js Version
18.16.0
OS
Linux
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: