-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathusers.tf
36 lines (31 loc) · 827 Bytes
/
users.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
resource "aws_iam_user" "ci_user" {
name = "${module.labels.id}-ci"
tags = module.labels.tags
}
resource "aws_iam_access_key" "ci_user" {
user = aws_iam_user.ci_user.name
}
resource "aws_iam_user_policy_attachment" "ci_user_ecr" {
user = aws_iam_user.ci_user.name
policy_arn = "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryFullAccess"
}
data "aws_iam_policy_document" "ci_user" {
statement {
actions = [
"ecs:UpdateService",
"ecs:DescribeTaskDefinition",
"ecs:RegisterTaskDefinition",
"iam:PassRole",
"ecs:DescribeServices",
"lambda:*"
]
resources = [
"*",
]
}
}
resource "aws_iam_user_policy" "ci_user" {
name = "${module.labels.id}-ci-user"
user = aws_iam_user.ci_user.name
policy = data.aws_iam_policy_document.ci_user.json
}