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

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

Carlos Navarrete March 10, 2021

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
Carlos Navarrete March 11, 2021

Hi,

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

Now is working. 

 

Thanks!

0 votes
Daniel A Ramer March 12, 2021
- 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
AUG Leaders

Atlassian Community Events