-
Notifications
You must be signed in to change notification settings - Fork 0
/
iam.tf
41 lines (34 loc) · 995 Bytes
/
iam.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
31
32
33
34
35
36
37
38
39
40
/*
data "aws_iam_policy_document" "ecs_execution_role" {
statement {
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = ["ecs-tasks.amazonaws.com"]
}
}
}
data "aws_iam_policy_document" "ecs_execution_role_policy" {
statement {
actions = [
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
"logs:CreateLogStream",
"logs:PutLogEvents",
]
resources = ["*"]
}
}
resource "aws_iam_policy" "ecs_execution_role_policy" {
policy = "${data.aws_iam_policy_document.ecs_execution_role_policy.json}"
}
resource "aws_iam_role" "ecs_execution_role" {
assume_role_policy = "${data.aws_iam_policy_document.ecs_execution_role.json}"
}
resource "aws_iam_role_policy_attachment" "ecs_execution_role" {
role = "${aws_iam_role.ecs_execution_role.name}"
policy_arn = "${aws_iam_policy.ecs_execution_role_policy.arn}"
}
*/