-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathpolicy.tf
47 lines (44 loc) · 1.16 KB
/
policy.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
data "aws_iam_policy_document" "manage" {
statement {
actions = [
"s3:AbortMultipartUpload",
"s3:DeleteObject",
"s3:DeleteObjectTagging",
"s3:DeleteObjectVersion",
"s3:DeleteObjectVersionTagging",
"s3:GetObject",
"s3:GetObjectAcl",
"s3:GetObjectTagging",
"s3:GetObjectTorrent",
"s3:GetObjectVersion",
"s3:GetObjectVersionAcl",
"s3:GetObjectVersionTagging",
"s3:GetObjectVersionTorrent",
"s3:ListMultipartUploadParts",
"s3:PutObject",
"s3:PutObjectAcl",
"s3:PutObjectTagging",
"s3:PutObjectVersionAcl",
"s3:PutObjectVersionTagging",
"s3:RestoreObject",
]
resources = [
"arn:aws:s3:::${aws_s3_bucket.origin.id}/",
"arn:aws:s3:::${aws_s3_bucket.origin.id}/*",
]
sid = "ManageBucketObjects"
}
statement {
actions = [
"cloudfront:CreateInvalidation",
]
resources = [
"*",
]
sid = "CreateCloudfrontInvalidation"
}
}
resource "aws_iam_policy" "manage" {
name = "${var.distribution_name}-manage"
policy = data.aws_iam_policy_document.manage.json
}