-
Notifications
You must be signed in to change notification settings - Fork 0
/
iam_policy_replicate_originals.tf
46 lines (45 loc) · 1.23 KB
/
iam_policy_replicate_originals.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
# aws_iam_policy.replicate_originals:
resource "aws_iam_policy" "replicate_originals" {
count = terraform.workspace == "production" ? 1 : 0
description = "Cross-region replication for originals"
name = "replicate_originals"
path = "/"
policy = jsonencode(
{
Statement = [
{
Action = [
"s3:Get*",
"s3:ListBucket",
]
Effect = "Allow"
Resource = [
"${aws_s3_bucket.originals.arn}",
"${aws_s3_bucket.originals.arn}/*",
"${aws_s3_bucket.dzi.arn}",
"${aws_s3_bucket.dzi.arn}/*",
"${aws_s3_bucket.derivatives.arn}",
"${aws_s3_bucket.derivatives.arn}/*",
]
},
{
Action = [
"s3:ReplicateObject",
"s3:ReplicateDelete",
"s3:ReplicateTags",
"s3:GetObjectVersionTagging",
]
Effect = "Allow"
Resource = [
"${aws_s3_bucket.originals_backup[0].arn}/*",
"${aws_s3_bucket.dzi_backup[0].arn}/*",
"${aws_s3_bucket.derivatives_backup[0].arn}/*",
]
},
]
Version = "2012-10-17"
}
)
tags = {}
tags_all = {}
}