Skip to content

Commit 66f6240

Browse files
committed
Add custom policy for data replication access
1 parent d7b8aab commit 66f6240

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

  • terraform/data_replication

terraform/data_replication/iam.tf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,25 @@ resource "aws_iam_role_policy_attachment" "ecs_task_fargate" {
6464
role = aws_iam_role.ecs_task_role.name
6565
policy_arn = aws_iam_policy.shell_access_policy.arn
6666
}
67+
68+
resource "aws_iam_policy" "data_replication_access" {
69+
name = "DataReplicationAccessPolicy"
70+
policy = jsonencode({
71+
Version = "2012-10-17"
72+
Statement = [
73+
{
74+
Effect = "Allow"
75+
Action = [
76+
"ecs:ListTasks",
77+
"ecs:DescribeTasks",
78+
"ecs:ExecuteCommand"
79+
]
80+
Resource = [
81+
"arn:aws:ecs:eu-west-2:393416225559:cluster/mavis-${var.environment}-data-replication*",
82+
"arn:aws:ecs:eu-west-2:393416225559:task/mavis-${var.environment}-data-replication*/*",
83+
"arn:aws:ecs:eu-west-2:393416225559:container-instance/mavis-${var.environment}-data-replication*/*"
84+
]
85+
}
86+
]
87+
})
88+
}

0 commit comments

Comments
 (0)