Skip to content

Commit

Permalink
fix: use for_each instead of count in aws_s3_bucket_logging (#212)
Browse files Browse the repository at this point in the history
* use for each instead of count in aws_s3_bucket_logging

* user moved operator
  • Loading branch information
wadhah101 authored Mar 3, 2024
1 parent 18b146a commit b497874
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ resource "aws_s3_bucket_versioning" "default" {
}
}

moved {
from = aws_s3_bucket_logging.default[0]
to = aws_s3_bucket_logging.default["enabled"]
}

resource "aws_s3_bucket_logging" "default" {
count = local.enabled && try(length(var.logging), 0) > 0 ? 1 : 0
for_each = toset(local.enabled && length(var.logging) > 0 ? ["enabled"] : [])

bucket = local.bucket_id

Expand Down

0 comments on commit b497874

Please sign in to comment.