Lambda fails to deploy when provisoned_executions > 0
See original GitHub issueThis code fails to deploy with:
Provisioned Concurrency configuration failed to be applied.
Reason: FUNCTION_ERROR_INIT_FAILURE
However, if I change provisioned_executions from 10 to 0, it deploys correctly.
def addValidationFunction(self):
self.validationDlq = Queue(self, 'validationDLQ')
curTime = round(time.time())
fnName = "IssFn{}".format(curTime)
self.validationFunction = Function(self, fnName,
runtime=Runtime.PYTHON_3_6,
code=Code.asset('lambda/issuer'),
handler='validation_function.lambda_handler',
timeout=core.Duration.seconds(900),
layers=[self.depLayer],
dead_letter_queue=self.validationDlq
)
verName = "IssFnVer{}".format(curTime)
self.validationVersion = self.validationFunction.add_version(name=verName, provisioned_executions=10)
lambdaPolicy = PolicyStatement()
lambdaPolicy.add_all_resources()
lambdaPolicy.add_actions("secretsmanager:GetSecretValue")
self.validationFunction.add_to_role_policy(lambdaPolicy)
StringParameter(self, "issuerValidationFunctionArn",
parameter_name="ISSUER_VALIDATION_FN_ARN",
string_value=self.validationVersion.function_arn,
simple_name=True
)
Environment
- CLI Version :
- Framework Version: CDK 1.20.0
- OS : OSX
- Language : Python
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Troubleshoot deployment issues in Lambda
Deployment errors prevent the new version from being used and can arise from issues with your deployment package, code, permissions, or tools.
Read more >CloudFormation stack fails to deploy due to Resource of type ...
I'm deploying a CloudFromation stack via CDK, and it fails to deploy due to lambdas failing to stabilize.
Read more >When Lambda deployments aren't zero-downtime (and how to ...
In this case, for some period of time, the function will be called with an incompatible combination of code and configuration, and the...
Read more >terraform-aws-modules/lambda/aws
Note that this module does not copy prebuilt packages into S3 bucket. ... Make sure, you deploy Lambda@Edge functions into US East (N....
Read more >AWS Lambda Guide - Serverless.yml Reference
'warn' reports deprecations on the go, 'error' will result with an ... the S3 bucket used by Serverless Framework to deploy code packages...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@sblackstone this issue doesn’t seem specific to CDK. it’s likely that you’d see the same error working with cloudformation directly.
When you pre-provision a lambda, it is bootstrapped in the same call that creates the cloudformation resource. if the bootstrapping either fails or times out,
FUNCTION_ERROR_INIT_FAILURE
is thrown.So, the question is, why is this code failing to initialize in a timely manner. Can you try some other code in this lambda, or perhaps a stripped-down version of your current code?
Closing this issue since there hasn’t been a response in a while. Feel free to reopen.