Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

I cant get update lambda serverless express with pipe atlassian/aws-lambda-deploy

Hi, 

I try to update my lambda with a bitbucket pipeline. My proyect is built with node and express.  

The pipe is built correctly , but lambda does not work. But if I deploy with claudia js in a terminal, I have no problem and the lambda works fine

I think the problem is with de zip file, I'm not sure if params for the zip command are right. The content size of lambda is smaller when is deployed with pipe than is deployed with claudia js. In AWS console, when the pipe is executed, the lambda code is visible and it`s seems right, but when is executed by claudia, code is not visible.

Anyone knows if my pipe code is right to execute an express serverless?

This is my  step pipeline yaml file:

- step: 
# Build and package the Lambda function.
name: Build and package
script: - apt-get update && apt-get install -y zip
-
zip code.zip *
# Upload the Lambda - make the version number
# available to subsequent steps via artifacts.
-
pipe: atlassian/aws-lambda-deploy:0.6.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-function'
COMMAND: 'update'
ZIP_FILE: 'code.zip'
# Read results from the update pipe into environment variables
-
apt-get install -y jq
-
BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes"
-
VERSION=$(jq --raw-output '.Version' $BITBUCKET_PIPE_SHARED_STORAGE_DIR/aws-lambda-deploy-env)
- pipe: atlassian/aws-lambda-deploy:0.6.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-function'
COMMAND: 'alias'
ALIAS: 'development'
VERSION: '${VERSION}'

2 answers

1 accepted

1 vote
Answer accepted

Hi,

I've found my issue. I wasn´t executed npm install command before the pipe.

Now is working. 

 

Thanks!

- step: name: Deploy to test deployment: test # trigger: manual # Uncomment to make this a manual deployment. script: - echo "Deploying to test environment"

Suggest an answer

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

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

497 views 16 17
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