AWS-LAMBDA-DEPLOY command update is not waiting for LastUpdateStatus Successful
Asked by Billy Vazquez:

The aws-lambda-deplopy pipe version 1.3.0 is not waiting on the LastUpdateStatus to be successful before proceeding.

In the case where we issue an update command with a function configuration, the code calls update_function_configuration first before calling update_function_code. To respect Lambda function states, the code uses a boto3 waiter. Here is where I believe the issue is, the call to get_waiter is using the parameter function_active. I believe the what it needs to do is call the get_waiter function with the parameter function_updated. This will make the pipe wait until the function configuration is correctly updated before calling update_function_code.

Attached are images showing the pipeline console and the error, a snippet of the code where I believe the change is needed

![Screen Shot 2021-11-19 at 10.19.02 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/170212iECBDA3BF92154968/image-size/large?v=v2&px=999 "Screen Shot 2021-11-19 at 10.19.02 AM.png")

![Screen Shot 2021-11-19 at 10.11.09 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/170205iABD3E4FEC9BC4BDA/image-size/large?v=v2&px=999 "Screen Shot 2021-11-19 at 10.11.09 AM.png")![Screen Shot 2021-11-19 at 10.13.18 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/170206iA62F7CC11B2D549F/image-size/large?v=v2&px=999 "Screen Shot 2021-11-19 at 10.13.18 AM.png")


Answers:
author: Billy Vazquez
body: Igor thanks for the 1.4.0 release. It fixes the issue with the pipe. You might want to add an example that uses the WAIT attribute for an update followed by an alias operation. In our case we had to add the WAIT attribute so that it waits for the update to complete before it tries the alias. ![Screen Shot 2021-12-03 at 9.26.17 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/172167i6D4E245CF949770F/image-size/large?v=v2&px=999 "Screen Shot 2021-12-03 at 9.26.17 AM.png")

comments: author: Igor Stoyanov
body: [@Billy Vazquez](/t5/user/viewprofilepage/user-id/3853482) hi. We have the simple example that describes wait parameter:

Update the function 'my-lambda-function' in region 'us-east-1' with the function code contained in 'my-function-code.zip' and wait until lambda update is successful.  

```
script:  - pipe: atlassian/aws-lambda-deploy:1.4.0    variables:      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY      AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION      FUNCTION_NAME: 'my-lambda-function'      COMMAND: 'update'      ZIP_FILE: 'my-function-code.zip'      WAIT: 'true'
```

but you are right, we should also provide such example in Combining Update with Alias paragraph.

Thanks.

Regards, Igor


author: Igor Stoyanov
body: [@Billy Vazquez](/t5/user/viewprofilepage/user-id/3853482) hi. We released new pipe version atlassian/aws-lambda-deploy:1.4.0 to fix this issue.

Regards, Igor.


author: Igor Stoyanov
body: [@Billy Vazquez](/t5/user/viewprofilepage/user-id/3853482) hi. Thanks for your investigation. We will fix this in near future.

Regards, Igor.


Tags: aws

bitbucket-pipelines

cloud

lambda