aws-iot-builder-tools / aws-greengrass-provisioner

Simplifies provisioning Greengrass Cores and building Greengrass Lambda functions
Apache License 2.0
54 stars 15 forks source link

Can't update existing lambda function because of lambda update status 'in progess' #968

Closed kimsehwan96 closed 1 year ago

kimsehwan96 commented 2 years ago

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/

스크린샷 2021-11-25 오후 11 08 37

When greengrass provisioner update existing lambda by uploading zip file to S3, lambda that updated is in LastUpdateStatus 'in progress' like following image.

스크린샷 2021-11-25 오후 11 10 51

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

timmattison commented 2 years ago

I think this looks reasonable. Let me check in tomorrow and do some testing and then I'll merge it if it looks good.

timmattison commented 2 years ago

Thank you for filing this issue AND creating a PR! Sorry it was overlooked for a while.