-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathiam.tf
35 lines (29 loc) · 911 Bytes
/
iam.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
module "secure_transport_policy_logs" {
source = "./modules/iam/secure-transport-policy"
bucket_name = var.s3_logs_bucket
}
module "secure_transport_policy" {
source = "./modules/iam/secure-transport-policy"
bucket_name = var.s3_web_bucket
}
data "aws_iam_policy_document" "web" {
source_json = module.secure_transport_policy.json
statement {
sid = "OriginAccessIdentityGet"
actions = ["s3:GetObject"]
resources = ["${aws_s3_bucket.web.arn}/*"]
principals {
type = "AWS"
identifiers = [aws_cloudfront_origin_access_identity.web.iam_arn]
}
}
statement {
sid = "OriginAccessIdentityList"
actions = ["s3:ListBucket"]
resources = [aws_s3_bucket.web.arn]
principals {
type = "AWS"
identifiers = [aws_cloudfront_origin_access_identity.web.iam_arn]
}
}
}