Skip to content

Commit

Permalink
Add AmazonEC2ContainerRegistryReadOnly policy to provide read-only …
Browse files Browse the repository at this point in the history
…access to `ECR` repositories (#15)
  • Loading branch information
aknysh authored Oct 3, 2017
1 parent 760479e commit 60d56ad
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ resource "aws_iam_role_policy_attachment" "ssm-automation" {
}
}

# http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker.container.console.html
# http://docs.aws.amazon.com/AmazonECR/latest/userguide/ecr_managed_policies.html#AmazonEC2ContainerRegistryReadOnly
resource "aws_iam_role_policy_attachment" "ecr-readonly" {
role = "${aws_iam_role.ec2.name}"
policy_arn = "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
}

resource "aws_ssm_activation" "ec2" {
name = "${module.label.id}"
iam_role = "${aws_iam_role.ec2.id}"
Expand Down

0 comments on commit 60d56ad

Please sign in to comment.