This was interfering with our deployments, as the provisioning takes some time and because of that, the updateLambdaCode that is called immediately after updateLambdaConfiguration was constantly giving the following error:
ResourceConflictException: The operation cannot be performed at this time. An update is in progress for resource: arn:aws:lambda:eu-west-1:xxx:function:api-xxx-function.
Amazon is rolling out Lambda states now, see: https://aws.amazon.com/blogs/compute/coming-soon-expansion-of-aws-lambda-states-to-all-functions/
This was interfering with our deployments, as the provisioning takes some time and because of that, the
updateLambdaCode
that is called immediately afterupdateLambdaConfiguration
was constantly giving the following error:ResourceConflictException: The operation cannot be performed at this time. An update is in progress for resource: arn:aws:lambda:eu-west-1:xxx:function:api-xxx-function
.The state change can take up to a minute: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#updateFunctionConfiguration-property
This PR adds a polling check between the two updates to wait for the Lambda state to return to Successful before continuing.