File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,9 @@ resource "aws_s3_bucket_acl" "logs_bucket_acl" {
2121 depends_on = [aws_s3_bucket_ownership_controls . logs_bucket_ownership [0 ]]
2222}
2323
24- resource "aws_s3_bucket_policy" "allow_access_from_eks" {
25- bucket = aws_s3_bucket. logs_bucket [0 ]. id
26- policy = data. aws_iam_policy_document . allow_access_from_eks . json
27- }
28-
2924data "aws_iam_policy_document" "allow_access_from_eks" {
25+ count = var. create_logs_bucket == true ? 1 : 0
26+
3027 statement {
3128 effect = " Allow"
3229
@@ -43,3 +40,10 @@ data "aws_iam_policy_document" "allow_access_from_eks" {
4340 ]
4441 }
4542}
43+
44+ resource "aws_s3_bucket_policy" "allow_access_from_eks" {
45+ count = var. create_logs_bucket == true ? 1 : 0
46+
47+ bucket = aws_s3_bucket. logs_bucket [0 ]. id
48+ policy = data. aws_iam_policy_document . allow_access_from_eks [0 ]. json
49+ }
You can’t perform that action at this time.
0 commit comments