It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

aws sam deploy Edited

Hi dear community,

We're currently facing a problem with deploying lambda function's artefacts together with 3rd party libraries.

Could you please clarify, how to resolve and deploy properly these dependencies using aws-sam-deploy pipe?


* we use the last version of pipe.

variables in BBPL file:


To reproduce: 

add requirements.txt file( with e.g. psycopg2-binary) to your lambda source code. Deploy. In S3 bucket you'll see that the file uploaded to S3 bucket is too small and Lambda is not working.


Best Regards,


3 answers

Had exact same problem. The issue is that Bitbucket's pipeline doesn't actually use AWS' SAM command. It is doing something weird. If you try to deploy yourself using sam deploy, everything will be fine. Here's pipeline I made myself that works perfectly.

1. Run aws sam locally first to create samconfig.toml. Merge it to the branch.

2. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY variables in the repository's settings.

- step:
name: deploy to AWS
image: python:3.7
- apt-get update
- curl -LkSs -o aws-sam.tar.gz
- tar -xf aws-sam.tar.gz
- "cd ./aws-sam-*"
- make - cd ../
- samdev --version
- samdev build
- yes | samdev deploy


0 votes

Any updates on this?

I've faced with exact same problem. I need to deploy AWS stack, which contains some AWS services and Lambda. Lambda using 3rd party libraries. After deploy, Lambda code raises an error, because 3rd party libraries can't be found

0 votes
dmytro I'm New Here Apr 27, 2020

I think, this might be  somehow related to `aws-sam-deploy` pipe uses `sam package ---template-file",  and with it somehow packages are properly installed and uploaded. 

Suggest an answer

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

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

828 views 0 2
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