Grace Hopper Jeopardy ECR Pipeline

This solution will create a working Docker image ECR pipeline which pulls AmazonLinux base image from DockerHub, then pushes to ECR and scans new images on each push. The following resources will be created:

  • ECR Repository with Docker image scanning enabled by default
  • CodeBuild Project
  • S3 Bucket for CodePipeline artifacts
  • IAM Roles for related services

Deployment instructions

Note:

Create a Personal Access Token for your Github account for the AWS webhook.

Link:

https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token

This application is deployed using AWS CloudFormation.

CloudFormation Parameters: (required)

  • GitHubRepo
  • GitHubBranch
  • GitHubToken (do not commit this value)
  • GitHubUser
  • RepositoryName (ECR repository name to be created)

CloudFormation deployment options:

Create ECR pipeline resources: (add parameters)

aws cloudformation deploy --stack-name amazonlinux-ecr-pipeline --template-file cfn/ecr-pipeline-stack.yml --capabilities CAPABILITY_NAMED_IAM
Cleanup:

Delete S3 objects for CodeSuite before deleting CloudFormation stacks

Delete Stacks:

aws cloudformation delete-stack --stack-name amazonlinux-ecr-pipeline

Credits

License

This library is licensed under the MIT License.