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" {
290290 ]
291291}
292292
293- # ##########################
294- # Origin Access Identities
295- # ##########################
296293data "aws_iam_policy_document" "s3_policy" {
294+ # Origin Access Identities
297295 statement {
298296 actions = [" s3:GetObject" ]
299297 resources = [" ${ module . s3_one . s3_bucket_arn } /static/*" ]
@@ -303,6 +301,23 @@ data "aws_iam_policy_document" "s3_policy" {
303301 identifiers = module. cloudfront . cloudfront_origin_access_identity_iam_arns
304302 }
305303 }
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+ }
306321}
307322
308323resource "aws_s3_bucket_policy" "bucket_policy" {
You can’t perform that action at this time.
0 commit comments