File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -290,10 +290,8 @@ module "records" {
290
290
]
291
291
}
292
292
293
- # ##########################
294
- # Origin Access Identities
295
- # ##########################
296
293
data "aws_iam_policy_document" "s3_policy" {
294
+ # Origin Access Identities
297
295
statement {
298
296
actions = [" s3:GetObject" ]
299
297
resources = [" ${ module . s3_one . s3_bucket_arn } /static/*" ]
@@ -303,6 +301,23 @@ data "aws_iam_policy_document" "s3_policy" {
303
301
identifiers = module. cloudfront . cloudfront_origin_access_identity_iam_arns
304
302
}
305
303
}
304
+
305
+ # Origin Access Controls
306
+ statement {
307
+ actions = [" s3:GetObject" ]
308
+ resources = [" ${ module . s3_one . s3_bucket_arn } /static/*" ]
309
+
310
+ principals {
311
+ type = " Service"
312
+ identifiers = [" cloudfront.amazonaws.com" ]
313
+ }
314
+
315
+ condition {
316
+ test = " StringEquals"
317
+ variable = " aws:SourceArn"
318
+ values = [module . cloudfront . cloudfront_distribution_arn ]
319
+ }
320
+ }
306
321
}
307
322
308
323
resource "aws_s3_bucket_policy" "bucket_policy" {
You can’t perform that action at this time.
0 commit comments