Inactive Lambda vs Bitbucket Pipelines Pipe: AWS Lambda Deploy
Asked by Joao Clemente:

Bitbucket Pipelines Pipe: AWS Lambda Deploy {#toc-hId--495713799}
-----------------------------------------------------------------

(<https://bitbucket.org/atlassian/aws-lambda-deploy>) {#toc-hId-1991799034}
---------------------------------------------------------------------------

Dear support, I am troubleshooting a Bitbucket pipeline our company has leveraged to deploy an AWS Lambda function. We have found out that the pipeline fails to update a function if this is in a "Inactive" state.

Indeed, the documentation of the Pipeline Pipe says

"

Details {#toc-hId-184344571}
----------------------------

This pipe checks for lambda to be in `Active` State and LastUpdateStatus `Successful` before start executing.

Information about lambda states: [AWS lambda states](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html).

"

However, by reading the AWS documentation, it is not obvious for me/us why is the pipeline checking for that particular state, and does not act also on "Inactive State":

- In our case, the Lambda we are trying to update is in "Inactive State" and "LastUpdateStatus `Successful`"

- If I'm reading the AWS documentation correctly (<https://aws.amazon.com/blogs/compute/tracking-the-state-of-lambda-functions/>), it says "**NOTE** : Functions can only be updated if they are in the *Active* or ***Inactive*** state. Update commands issued against functions that aren't in the *Active* or *Inactive* state will fail before execution."

Could you please clarify or accept a suggestion to update the Pipeline code to also work when the function is on "Inactive State" ?

Thank you


Answers:
author: Igor Stoyanov
body: [@Joao Clemente](/t5/user/viewprofilepage/user-id/5130073) hi. Thanks for investigation.

Good catch. We will additionally check this and notify you about new version if we decide to implement your suggestion.

Regards, Igor

comments: author: Joao Clemente
body: Thanks you Igor for the acknowledgement. Let me know if I can help any further ( e.g. submitting an PR - I think this would be a "one-liner" against <https://bitbucket.org/atlassian/aws-lambda-deploy/src/master/pipe/pipe.py#lines-257> ).

Is there any way to know if this was tracked internally (maybe as an issue in your "PIPES" project), so that we could have a reference to a tracker and an expectation of when possibly we would see an update merged into master?

Thank you!


author: Igor Stoyanov
body: [@Joao Clemente](/t5/user/viewprofilepage/user-id/5130073) our team has this task in JIRA backlog (where you do not have access), scheduled on next sprint, so new version will approximately be available on February 20 if nothing changes.

We have an option to create issues to track status, for this issues we collecting votes and then decide if we should include the feature to our pipe. But since current task is already in our internal JIRA, we skipped this process.  

I will notify in this topic when new version will become available.  

If you do not want to wait so much time and want to have changes "right now" there is a way to write your own pipe based on our version of the pipe. More info [here](https://bitbucket.org/blog/build-flexible-ci-cd-pipelines-with-custom-pipes).

Also you could create a pr to existing pipe. Check [contributing page.](https://bitbucket.org/atlassian/aws-lambda-deploy/src/master/CONTRIBUTING.md)

For your case i suggest you to wait official release or create your custom own pipe.

<br />

Regards, Igor.


author: Igor Stoyanov
body: [@Joao Clemente](/t5/user/viewprofilepage/user-id/5130073) hi. Our team released a [new version 1.8.0 of aws-lambda-deploy pipe.](https://bitbucket.org/atlassian/aws-lambda-deploy/src/1.8.0/)

According to README, now:

This pipe checks for lambda to be in `Active` or `Inactive` State and LastUpdateStatus not equal `InProgress` before start executing.

Regards, Igor


author: Joao Clemente
body: Thank you Igor and entire team, we updated and to the new release and it is working correctly now under our conditions! Problem solved :-) I'll click the "Accept Answer" now.

With Best Regards,

Joao


Tags: bitbucket-cloud

cloud