aws-greengrass-provisioner
aws-greengrass-provisioner copied to clipboard
Can't update existing lambda function because of lambda update status 'in progess'
Hi, @timmattison
Updating existing lambda with greengrass provisioner isn't working because of 'lambda state especially LastUpdateStatus.
refer to https://aws.amazon.com/ko/blogs/compute/coming-soon-expansion-of-aws-lambda-states-to-all-functions/
When greengrass provisioner update existing lambda by uploading zip file to S3, lambda that updated is in LastUpdateStatus 'in progress' like following image.
After few seconds, lambda that updated is in LastUpdateStatus Successful status and successfully updated. (creating function)
But 'greengrass provisioner' doesn't wait for this status changing (In progress -> Successful) so updating is failed. (updating lambda configuration, version, alias etc..)
We need to wait state changing delay for LastUpateStatus in https://github.com/awslabs/aws-greengrass-provisioner/blob/4c971f1df490c7f57f0699962368bb52e089d7db/src/main/java/com/awslabs/aws/greengrass/provisioner/implementations/helpers/BasicLambdaHelper.java#L230
I think this looks reasonable. Let me check in tomorrow and do some testing and then I'll merge it if it looks good.
Thank you for filing this issue AND creating a PR! Sorry it was overlooked for a while.