File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,27 @@ resource "aws_iam_role_policy" "ssm_policy" {
6969EOF
7070}
7171
72+ # https://docs.aws.amazon.com/AmazonECR/latest/userguide/vpc-endpoints.html#ecr-setting-up-s3-gateway
73+ resource "aws_iam_role_policy" "s3_policy" {
74+ name = " ecs-s3-policy"
75+ role = aws_iam_role. ecs_task . name
76+
77+ policy = << EOF
78+ {
79+ "Version": "2012-10-17",
80+ "Statement": [
81+ {
82+ "Action": [
83+ "s3:GetObject"
84+ ],
85+ "Effect": "Allow",
86+ "Resource": ["arn:aws:s3:::prod-${ data . aws_region . current . name } -starport-layer-bucket/*"]
87+ }
88+ ]
89+ }
90+ EOF
91+ }
92+
7293resource "aws_iam_role_policy_attachment" "extra_task_policies_arn" {
7394 for_each = toset (try (var. extra_task_policies_arn , []))
7495 role = aws_iam_role. ecs_task . name
You can’t perform that action at this time.
0 commit comments