Created
January 17, 2023 15:26
-
-
Save gungoren/d1fe50a9a25b77851fbe9e5f2cdb0d6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_s3_bucket_policy" "cdn-cf-policy" { | |
bucket = module.origin_bucket.s3_bucket_id | |
policy = data.aws_iam_policy_document.my-cdn-cf-policy.json | |
} | |
data "aws_iam_policy_document" "my-cdn-cf-policy" { | |
statement { | |
sid = "1" | |
principals { | |
type = "AWS" | |
identifiers = module.cdn.cloudfront_origin_access_identity_iam_arns | |
} | |
actions = [ | |
"s3:GetObject" | |
] | |
resources = [ | |
"${module.origin_bucket.s3_bucket_arn}/*" | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment