-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathecr.tf
30 lines (29 loc) · 798 Bytes
/
ecr.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
resource "aws_ecr_repository" "repository" {
name = local.ecr["repository_name"]
image_tag_mutability = "MUTABLE"
}
resource "aws_ecr_repository_policy" "policy" {
repository = aws_ecr_repository.repository.name
policy = <<EOF
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "adds full ecr access to the ${local.ecr["repository_name"]} repository",
"Effect": "Allow",
"Principal": "*",
"Action": [
"ecr:BatchCheckLayerAvailability",
"ecr:BatchGetImage",
"ecr:CompleteLayerUpload",
"ecr:GetDownloadUrlForLayer",
"ecr:GetLifecyclePolicy",
"ecr:InitiateLayerUpload",
"ecr:PutImage",
"ecr:UploadLayerPart"
]
}
]
}
EOF
}