-
Notifications
You must be signed in to change notification settings - Fork 6
/
data.tf
43 lines (37 loc) · 916 Bytes
/
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
data "aws_iam_policy_document" "s3_website_policy" {
statement {
actions = ["s3:GetObject"]
resources = ["${aws_s3_bucket.website.arn}/*"]
principals {
type = "AWS"
identifiers = ["*"]
}
}
statement {
actions = ["s3:ListBucket"]
resources = [aws_s3_bucket.website.arn]
principals {
type = "AWS"
identifiers = ["*"]
}
}
}
data "aws_iam_policy_document" "s3_website_redirect_apex_policy" {
count = var.apex_redirect ? 1 : 0
statement {
actions = ["s3:GetObject"]
resources = ["${aws_s3_bucket.website_redirect_apex[count.index].arn}/*"]
principals {
type = "AWS"
identifiers = ["*"]
}
}
statement {
actions = ["s3:ListBucket"]
resources = [aws_s3_bucket.website_redirect_apex[count.index].arn]
principals {
type = "AWS"
identifiers = ["*"]
}
}
}