Skip to content

Latest commit

 

History

History
 
 

container-image

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Example of blue/green deployment of a containerized function

Creates a containerized AWS Lambda function deployed using AWS CodePipeline and CodeDeploy.

usage

terraform init
terraform plan

Note that this example may create resources which cost money. Run terraform destroy to destroy those resources.

deploy

Push an updated container image to ECR to start the deployment pipeline:

aws ecr get-login-password --region {region} | docker login --username AWS --password-stdin {account_id}.dkr.ecr.{region}.amazonaws.com
docker build --tag {account_id}.dkr.ecr.{region}.amazonaws.com/with-ecr-deployment:production {context}
docker push {account_id}.dkr.ecr.{region}.amazonaws.com/with-ecr-deployment:production

Requirements

Name Version
terraform >= 1.3
aws >= 5.32
null >= 3.2

Providers

Name Version
aws >= 5.32
null >= 3.2

Modules

Name Source Version
deployment ../../../modules/deployment n/a
lambda ../../../ n/a

Resources

Name Type
aws_ecr_repository.this resource
aws_lambda_alias.this resource
null_resource.initial_image resource

Inputs

Name Description Type Default Required
region n/a string "eu-west-1" no

Outputs

No outputs.