-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.tf
50 lines (49 loc) · 953 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
44
45
46
47
48
49
50
data "aws_iam_policy_document" "assume_role" {
statement {
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = [
"apigateway.amazonaws.com",
"logs.${var.api_region}.amazonaws.com"
]
}
}
}
data "aws_iam_policy_document" "bucket" {
statement {
sid = "AccessBucket"
actions = [
"s3:ListBucket",
"s3:GetObject"
]
principals {
type = "AWS"
identifiers = [
aws_iam_role.tile.arn
]
}
resources = [
local.bucket_arn,
"${local.bucket_arn}/*"
]
}
statement {
sid = "AllowSSLRequestsOnly"
actions = ["s3:*"]
condition {
test = "Bool"
variable = "aws:SecureTransport"
values = ["false"]
}
effect = "Deny"
resources = [
local.bucket_arn,
"${local.bucket_arn}/*"
]
principals {
type = "*"
identifiers = ["*"]
}
}
}