-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata_aws_iam_policy_document.access.tf
58 lines (49 loc) · 1.09 KB
/
data_aws_iam_policy_document.access.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
58
data "aws_iam_policy_document" "access" {
statement {
actions = [
"s3:GetBucketAcl",
"s3:GetBucketLocation",
"s3:PutObject",
"s3:PutObjectAcl",
]
resources = [
aws_s3_bucket.crl.arn,
"${aws_s3_bucket.crl.arn}/*"
]
condition {
test = "StringLike"
variable = "aws:SourceArn"
values = ["arn:${data.aws_partition.current.partition}:acm-pca:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:certificate-authority*"]
}
principals {
type = "Service"
identifiers = ["acm-pca.amazonaws.com"]
}
}
statement {
actions = [
"s3:GetObject"
]
resources = [
aws_s3_bucket.crl.arn,
"${aws_s3_bucket.crl.arn}/*"
]
principals {
type = "*"
identifiers = ["*"]
}
}
statement {
actions = [
"s3:*"
]
resources = [
aws_s3_bucket.crl.arn,
"${aws_s3_bucket.crl.arn}/*"
]
principals {
type = "AWS"
identifiers = ["${data.aws_caller_identity.current.arn}"]
}
}
}