-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdata.tf
52 lines (40 loc) · 1.02 KB
/
data.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
data "aws_region" "current" {}
data "aws_partition" "current" {}
data "aws_iam_policy_document" "assume_role_policy" {
statement {
effect = "Allow"
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = ["ecs-tasks.amazonaws.com"]
}
}
}
data "aws_iam_policy_document" "task_permissions" {
statement {
effect = "Allow"
resources = ["*"]
actions = [
"logs:CreateLogStream",
"logs:PutLogEvents"
]
}
}
data "aws_kms_key" "secretsmanager_key" {
count = var.create_repository_credentials_iam_policy && var.enabled ? 1 : 0
key_id = var.repository_credentials_kms_key
}
data "aws_iam_policy_document" "read_repository_credentials" {
count = var.create_repository_credentials_iam_policy && var.enabled ? 1 : 0
statement {
effect = "Allow"
resources = [
var.repository_credentials,
data.aws_kms_key.secretsmanager_key[0].arn,
]
actions = [
"secretsmanager:GetSecretValue",
"kms:Decrypt",
]
}
}