Continuous Deployment to Lambda function using Bitbucket pipeline

Please visit my website and subscribe to my youtube channel for more articles

https://devops4solutions.com/

In this blog, we will setup the Continuous Deployment to Lambda function using Bitbucket pipeline

CI/CD Flow:

5. Upload zip file to S3 bucket

6. Update the lambda function that will take the new artifacts from S3 buckets

Prerequisite:

How to setup a Continuous Deployment to Lambda function using Bitbucket pipeline

AWS_SECRET_ACCESS_KEY
AWS_ACCESS_KEY_ID
AWS_REGION
AWS_LAMBDA_FUNCTION_NAME
AWS_ROLE

All the above variables are required to connect to s3 bucket and the lambda function from bitbucket pipeline.

3. We are setting up a Continuous Deployment to Lambda function using Bitbucket pipeline for nodejs application

image: lambci/lambda:build-nodejs6.10pipelines:default:- step:deployment: productionscript:- npm install- npm install node-lambda -g- zip test.zip ./node_modules index.js test.js- aws s3 cp test.zip s3://test-bucket-carnival-  aws lambda update-function-code --function-name lambdatest --s3-bucket test-bucket-carnival --s3-key test.zip#- node-lambda deploy -a $AWS_ACCESS_KEY_ID -s $AWS_SECRET_ACCESS_KEY -o $AWS_ROLE -r $AWS_REGION -n $AWS_LAMBDA_FUNCTION_NAME --excludeGlobs "bitbucket-pipelines.yml"caches:- node
Image for post
Image for post

Congratulations, we have successfully setup the Continuous Deployment to Lambda function using Bitbucket pipeline

Devops Automation Enginneer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store