Skip to content

Commit 869e52b

Browse files
committed
Revert "Replacing policy with an AWS predefined one"
This reverts commit 69a5d2a.
1 parent 69a5d2a commit 869e52b

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

autoscaling.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ resource "aws_iam_role" "ecs_autoscale_role" {
66
assume_role_policy = file("${path.module}/files/iam/ecs_autoscale_iam_role.json")
77
}
88

9-
resource "aws_iam_role_policy_attachment" "ecs_autoscale_role_policy_attach" {
10-
role = aws_iam_role.ecs_autoscale_role.name
11-
policy_arn = "arn:aws:iam::aws:policy/aws-service-role/AWSApplicationAutoscalingECSServicePolicy"
9+
resource "aws_iam_role_policy" "ecs_autoscale_role_policy" {
10+
name = "${var.name_preffix}-ecs-autoscale-role-policy"
11+
role = aws_iam_role.ecs_autoscale_role.id
12+
policy = file(
13+
"${path.module}/files/iam/ecs_autoscale_iam_role_policy.json",
14+
)
1215
}
1316

1417
#------------------------------------------------------------------------------
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"Version": "2012-10-17",
3+
"Statement": [
4+
{
5+
"Effect": "Allow",
6+
"Action": [
7+
"ecs:DescribeServices",
8+
"ecs:UpdateService"
9+
],
10+
"Resource": [
11+
"*"
12+
]
13+
},
14+
{
15+
"Effect": "Allow",
16+
"Action": [
17+
"cloudwatch:DescribeAlarms"
18+
],
19+
"Resource": [
20+
"*"
21+
]
22+
}
23+
]
24+
}

0 commit comments

Comments
 (0)