-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployers.tf
57 lines (47 loc) · 1.31 KB
/
deployers.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
resource "aws_iam_group" "deployers" {
name = "deployers-${local.resource_name}"
}
resource "aws_iam_group_policy" "deployers" {
name = "deployers-${local.resource_name}"
group = aws_iam_group.deployers.id
policy = data.aws_iam_policy_document.deployer.json
}
data "aws_iam_policy_document" "deployer" {
statement {
sid = "AllowEditTaskDefinitions"
effect = "Allow"
actions = [
"ecs:ListTaskDefinitions",
"ecs:DescribeTaskDefinition",
"ecs:RegisterTaskDefinition",
"ecs:DeregisterTaskDefinition",
]
resources = ["*"]
}
statement {
sid = "AllowHealthMonitor"
effect = "Allow"
resources = ["*"]
actions = [
"elasticloadbalancing:Describe*"
]
}
#bridgecrew:skip=CKV_AWS_111: Skipping "Write IAM policies without constraints". False positive because the actions are constrained by cluster in the "condition"
statement {
sid = "AllowClusterUpdates"
effect = "Allow"
actions = [
"ecs:DescribeServices",
"ecs:UpdateService",
"ecs:*Tasks",
"ecs:RunTask",
"ecs:ExecuteCommand",
]
resources = ["*"]
condition {
test = "ArnEquals"
variable = "ecs:cluster"
values = [aws_ecs_cluster.this.arn]
}
}
}