Reputation: 1
When I deploy an AWS CloudFormation stack (using [email protected] for deployment), my custom resource sometimes crashes with an error like this:
Received response status [FAILED] from custom resource. Message returned: AccessDeniedException: Resource is not in the state functionActiveV2 at Object.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:61:27) at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/rest_json.js:61:8) at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20) at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10) at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:686:14) at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10) at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12) at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10 at Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9) at Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:688:12) (RequestId: 72e32292-82df-4f5a-8229-6c3fdf79bf63)
This happens with different custom resources.
Could someone explain what this is and how to deal with it?
I tried to install dependencies between custom resources, but I can’t understand whether it helps or not, since this error occurs rarely and I can’t understand the logic in its appearance.
Upvotes: 0
Views: 408
Reputation: 21
I had the exact same issue and opened a ticket with the AWS Support. They requested me to add the "lambda:GetFunction" action to the Custom Resource Provider role policy (not the Lambda role). This worked and I was succesffully able to deploy my stack.
Upvotes: 2