Deploy AWS Lambda on AWS S3 using Azure DevOps CI-CD

AWS lambda deployment using azure DevOps

Once your AWS Lambda function is ready to deploy, you can choose many ways to deploy it on S3, I choose azure DevOps version control here to deploy it on S3.

AWS lambda deployment using azure Devops ci cd

The designed .yaml file is below on Ubuntu OS:

Note: Please set up your environment variables in Azure Library (AWS_Configuration_Variables) and defined them in the .yaml file.

# (see https://aka.ms/yaml for the YAML schema reference)

trigger:

branches:

include:

- main

paths:

include:

- /Migrations

pool:

vmImage: ‘ubuntu-latest’

variables:

- group: AWS_Configuration_Variables

steps:

- task: Bash@3

inputs:

targetType: ‘inline’

script: |

echo ‘Starting aws cli’

sudo apt install aws cli

aws — version

echo ‘configure aws cli’

export AWS_ACCESS_KEY_ID=$(AWS_ACCESS_KEY_ID)

export AWS_SECRET_ACCESS_KEY=$(AWS_SECRET_ACCESS_KEY)

export AWS_DEFAULT_REGION=$(AWS_DEFAULT_REGION)

echo ‘ — — — — — — -Zip the project folder — — — — — — -’

zip -r9 $(PROJECT_FOLDER)/snowfunc.zip .

echo ‘ — — — — — — — — — — -zip complete at ‘$(PROJECT_FOLDER)

aws s3 cp $(PROJECT_FOLDER)/snowfunc.zip s3://parts-data-blobs3/snowfunc.zip

echo ‘ — — — uploaded on AWS S3 — — — — — — — ‘

AWS lambda update-function-code — function-name snowfunc — region $(AWS_DEFAULT_REGION) — s3-bucket parts-data-blobs3 — s3-key snowfunc.zip

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — -

happy deployment 😊

--

--

--

A data scientist in cloud data warehouse

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

DevOps as a Culture

ICPC Tehran Site Analysis

How To Debug Jupyter Notebooks in Visual Studio Code

Firebase Function to extract data from Airtable

“The cucumber is bitter? Then throw it out. There are brambles in the path? Then go around them.”

A person holding a phone with the Android 11 easter egg of turning a volume knob up to 11.

I Also Wrote a Bot for HQ Trivia

Confused over reverse, reversed, and asReveresed ? in Kotlin

How to use GraphQL Context to shared data efficiently between DataFetchers ??

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
Vidit tyagi

Vidit tyagi

A data scientist in cloud data warehouse

More from Medium

Docker Architecture, Life Cycle of Docker Containers and Data Management

Configuring Snowflake to access S3 bucket

Stress Testing with AWS pt.2 — Terraform

AWS Cli — ECR display only image tags in the repository