Skip to content

🛠️ Terraform example for building and publishing a docker image to ECR using the new CodePipeline action ECRBuildAndPublish.

Notifications You must be signed in to change notification settings

daniele-salvagni/codepipeline-ecr-build-and-publish-tf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CodePipeline Example: Build and Publish a Docker image to ECR

This is a Terraform example for building and publishing a simple Docker image to ECR using AWS CodePipeline without a buildspec file. This is done by using the new ECRBuildAndPublish action (November 2024).

Blog post

This example is part of the following blog post: Simplify ECR image building and publishing with CodePipeline V2

How to deploy

To deploy this example, rename the terraform.tfvars.example file to terraform.tfvars and fill in the variables. For creating a GitHub connection, see the instructions below.

cd terraform
terraform init
terraform plan
terraform apply

Creating a GitHub Connection

aws codestar-connections create-connection --provider-type GitHub --connection-name my-github-connection

If successful, this command returns the connection ARN. You can then continue to setup the connection using the AWS Console: https://docs.aws.amazon.com/dtconsole/latest/userguide/connections-update.html

Resources

About

🛠️ Terraform example for building and publishing a docker image to ECR using the new CodePipeline action ECRBuildAndPublish.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published