-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.tf
More file actions
43 lines (43 loc) · 957 Bytes
/
Copy pathdata.tf
File metadata and controls
43 lines (43 loc) · 957 Bytes
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
data "aws_iam_policy_document" "s3_replication_assume_role_policy" {
count = local.is_replicated ? 1 : 0
statement {
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = ["s3.amazonaws.com"]
}
}
}
data "aws_iam_policy_document" "s3_replication_policy" {
count = local.is_replicated ? 1 : 0
statement {
actions = [
"s3:GetReplicationConfiguration",
"s3:ListBucket"
]
resources = [
aws_s3_bucket.bucket.arn
]
effect = "Allow"
}
statement {
actions = [
"s3:GetObjectVersionForReplication",
"s3:GetObjectVersionAcl",
"s3:GetObjectVersionTagging"
]
resources = [
"${aws_s3_bucket.bucket.arn}/*"
]
effect = "Allow"
}
statement {
actions = [
"s3:ReplicateObject",
"s3:ReplicateDelete",
"s3:ReplicateTags"
]
resources = [for r in var.replications: "${r}/*"]
effect = "Allow"
}
}