Create A Shared ECR Repository
This runbook describes how to create an ECR repository in the AWS Shared Services account. Images then created in the repository can then be pulled and deployed in other AWS accounts.
Creating the Repository
To create a new repository, it is simply a matter of adding the desired name of the repository to the exising list in ecr.tf in the staff-device-shared-services-infrastructure github repo.
- Clone the existing repo locally if needed.
Create a new branch from main
$ git checkout -b new_branch_nameNavigate to and open the file ecr.tf and add the new repository to the list.
module "ci-ecr" {
source = "./modules/ci-ecr"
#List of repositories to create
repositories = [
"mojo-nac",
"mojo-nac-nginx"
]
#Account ID's for dev, pre-prod and prod
accounts = [
"111111111111",
"222222222222",
"333333333333"
]
tags = module.label.tags
}
Run a terraform plan to confirm that the expected changes will be applied. Each new repository should create 3 resources. The repo itself, a permissions policy and a lifecycle policy.
$ make planIf the output looks as expected, commit and push the changes back into github, then raise a PR to merge into main.
Currently there are no working CI pipelines to deploy the changes, so they need to be deployed manually.
$ make apply