Created
October 21, 2025 11:16
-
-
Save artem-hatchenko/7ca7722a8d44b28bbdad05f6bd3c19c1 to your computer and use it in GitHub Desktop.
eks_fluent_bit_iam.tf
This file contains hidden or 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
| # Get list of buckets without duplicates for IAM policy | |
| locals { | |
| log_s3_buckets = toset([for o in var.log_s3_outputs : o.bucket]) | |
| } | |
| data "aws_iam_policy_document" "s3-logging" { | |
| dynamic "statement" { | |
| for_each = local.log_s3_buckets | |
| content { | |
| effect = "Allow" | |
| actions = [ | |
| "s3:PutObject", | |
| "s3:PutObjectAcl", | |
| "s3:AbortMultipartUpload", | |
| "s3:ListBucket", | |
| "s3:GetBucketLocation" | |
| ] | |
| resources = [ | |
| "arn:aws:s3:::${statement.value}", | |
| "arn:aws:s3:::${statement.value}/*" | |
| ] | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment