Skip to content

Example of CI/CD using AWS Lambda's container image support and terraform

License

Notifications You must be signed in to change notification settings

hi1280/aws-lambda-container-cicd-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-lambda-container-cicd-example

This is an example of CI/CD using AWS Lambda's container image support and terraform.

Usage

create a dummy container image in ecr repository

$ FUNCTION_NAME=aws-lambda-container-cicd-example
$ REGION=$(aws configure get region)
$ ACCOUNTID=$(aws sts get-caller-identity --output text --query Account)
$ docker build -t ${FUNCTION_NAME} .
$ aws ecr create-repository --repository-name ${FUNCTION_NAME}
$ docker tag ${FUNCTION_NAME}:latest ${ACCOUNTID}.dkr.ecr.${REGION}.amazonaws.com/${FUNCTION_NAME}:latest
$ aws ecr get-login-password | docker login --username AWS --password-stdin ${ACCOUNTID}.dkr.ecr.${REGION}.amazonaws.com
$ docker push ${ACCOUNTID}.dkr.ecr.${REGION}.amazonaws.com/${FUNCTION_NAME}:latest

terraform apply

$ cd terraform
$ terraform init
$ terraform apply

automatically deployed to Lambda function with each push.

About

Example of CI/CD using AWS Lambda's container image support and terraform

Resources

License

Stars

Watchers

Forks