Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,979
Community Members
 
Community Events
165
Community Groups

AWS Lambda function update pipeline failing with "Error parsing parameter '--zip-file......' "

Hello everyone.

I'm having a pprblem trying to set up a pipeline for update an AWS Lambda function.

Once the deploy is triggered, it fails with the following error:

Status: Downloaded newer image for bitbucketpipelines/aws-lambda-deploy:0.2.3
INFO: Updating Lambda function.
aws lambda update-function-code --function-name apikey-token-authorizer2 --publish --zip-file fileb://apiGatewayAuthorizer.zip
Error parsing parameter '--zip-file': Unable to load paramfile fileb://apiGatewayAuthorizer.zip: [Errno 2] No such file or directory: 'apiGatewayAuthorizer.zip'
✖ Failed to update Lambda function code.

Looks like the script couldn't find the artifact, but I don't know why. 

Here is the bitbucket-pipelines.yml file content:

image: node:16

# Workflow Configuration

pipelines:

default:

- parallel:

- step:

name: Build and Test

caches:

- node

script:

- echo Installing source YARN dependencies.

- yarn install

branches:

testing:

- parallel:

- step:

name: Build

script:

- apt update && apt install zip

# Exclude files to be ignored

- echo Zipping package.

- zip -r apiGatewayAuthorizer.zip . -x *.git* bitbucket-pipelines.yml

artifacts:

- apiGatewayAuthorizer.zip

- step:

name: Deploy to testing - Update Lambda code

deployment: Test

trigger: manual

script:

- pipe: atlassian/aws-lambda-deploy:0.2.3

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: $LAMBDA_FUNCTION_NAME

COMMAND: 'update'

ZIP_FILE: 'apiGatewayAuthorizer.zip'

Does anyone knows what am I missing here?
Thanks in advance.

1 answer

1 accepted

0 votes
Answer accepted
Mark C Atlassian Team May 29, 2022

Hi @Ariel Mantovani

Welcome to the community.

Based on your YAML configuration, I can see that you're using Parallel steps.

According to the documentation:

Parallel steps can only use artifacts produced by previous steps, not by steps in the same parallel set.

Hence, this is why the artifacts is not generated in the "Build" step because those 2 steps are within a parallel set.

For that, you can just remove the parallel configuration and use multi-steps instead.
This way, the first step can generate the artifact and pass it on to the second step.

Hope it helps and let me know how it goes.

Regards,
Mark C

Thank you , Mark! That worked like a charm. 

Our pipeline is working and deploying to Lambda without errors.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,263 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you