Skip to content

Commit

Permalink
Merge pull request #202 from nlamirault/feat/refactoring-iam
Browse files Browse the repository at this point in the history
IAM: Refactoring buckets usage for Loki, Tempo and Mimir
  • Loading branch information
nlamirault committed Mar 11, 2024
2 parents bb39a80 + 72f7405 commit fab69a1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
26 changes: 13 additions & 13 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@

# Labels for action/labeler

area/kubernetes:
- kubernetes/*
- kubernetes/**/*

area/gcp:
- iac/gcp/*
- iac/gcp/**/*
area/terraform:
- adot/*.tf
- amg/*.tf
- amp/*.tf
- cloudwatch/*.tf
- grafana/*.tf
- loki/*.tf
- mimir/*.tf
- mimir/*.tf
- prometheus/*.tf
- tempo/*.tf

area/aws:
- iac/aws/*
- iac/aws/**/*

area/azure:
- iac/azure/*
- iac/azure/**/*

kind/documentation:
- docs/*
- docs/**/*
- README.md
- "**/*.md"
8 changes: 4 additions & 4 deletions modules/loki/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ data "aws_iam_policy_document" "bucket" {
]

#tfsec:ignore:aws-iam-no-policy-wildcards
resources = [
module.buckets_data[*].s3_bucket_arn,
"${module.buckets_data[*].s3_bucket_arn}/*"
]
resources = concat(
[for b in toset(local.buckets_names) : module.buckets_data[b].s3_bucket_arn],
[for b in toset(local.buckets_names) : format("%s/*", module.buckets_data[b].s3_bucket_arn)]
)
}

dynamic "statement" {
Expand Down
8 changes: 4 additions & 4 deletions modules/mimir/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ data "aws_iam_policy_document" "bucket" {
]

#tfsec:ignore:aws-iam-no-policy-wildcards
resources = [
module.buckets_data[*].s3_bucket_arn,
"${module.buckets_data[*].s3_bucket_arn}/*"
]
resources = concat(
[for b in toset(local.buckets_names) : module.buckets_data[b].s3_bucket_arn],
[for b in toset(local.buckets_names) : format("%s/*", module.buckets_data[b].s3_bucket_arn)]
)
}

dynamic "statement" {
Expand Down
8 changes: 4 additions & 4 deletions modules/tempo/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ data "aws_iam_policy_document" "bucket" {
]

#tfsec:ignore:aws-iam-no-policy-wildcards
resources = [
module.buckets_data[*].s3_bucket_arn,
"${module.buckets_data[*].s3_bucket_arn}/*"
]
resources = concat(
[for b in toset(local.buckets_names) : module.buckets_data[b].s3_bucket_arn],
[for b in toset(local.buckets_names) : format("%s/*", module.buckets_data[b].s3_bucket_arn)]
)
}

dynamic "statement" {
Expand Down

0 comments on commit fab69a1

Please sign in to comment.