Skip to content

Commit b497874

Browse files
authored
fix: use for_each instead of count in aws_s3_bucket_logging (#212)
* use for each instead of count in aws_s3_bucket_logging * user moved operator
1 parent 18b146a commit b497874

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,13 @@ resource "aws_s3_bucket_versioning" "default" {
5858
}
5959
}
6060

61+
moved {
62+
from = aws_s3_bucket_logging.default[0]
63+
to = aws_s3_bucket_logging.default["enabled"]
64+
}
65+
6166
resource "aws_s3_bucket_logging" "default" {
62-
count = local.enabled && try(length(var.logging), 0) > 0 ? 1 : 0
67+
for_each = toset(local.enabled && length(var.logging) > 0 ? ["enabled"] : [])
6368

6469
bucket = local.bucket_id
6570

0 commit comments

Comments
 (0)