From dea1064e86712a3bbf2fe406348a13372bd9428e Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Fri, 30 Dec 2022 20:58:13 +0100 Subject: [PATCH 1/2] fix: indexing of iam.condition == null --- iam.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iam.tf b/iam.tf index 38e2412..d485dbc 100644 --- a/iam.tf +++ b/iam.tf @@ -10,7 +10,7 @@ locals { iam = concat(local.iam_role, local.iam_roles) iam_map = { for idx, iam in local.iam : - try(iam._key, "${iam.role}/${iam.condition._key}", "${iam.role}/${md5(jsonencode(iam.condition))}", iam.role) => idx + try(iam._key, "${iam.role}/${iam.condition._key}", iam.condition != null ? "${iam.role}/${md5(jsonencode(iam.condition))}" : iam.role, iam.role) => idx } } From 756bd2a5b952999f702d11f17796afe1dc76377f Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Fri, 30 Dec 2022 20:58:48 +0100 Subject: [PATCH 2/2] chore: update CHANGELOG --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bb161e..37859a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.2.0] + +### Changed + +- BREAKING CHANGE: Allow `iam.condition` to create the same terraform id index as an unset `iam.condition`. + This is breaking indexing and will recreate the resource unless `iam._key` is set to the previous value. + ## [0.1.0] ### Added @@ -65,7 +72,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial Implementation -[unreleased]: https://github.com/mineiros-io/terraform-google-storage-bucket/compare/v0.1.0...HEAD +[unreleased]: https://github.com/mineiros-io/terraform-google-storage-bucket/compare/v0.2.0...HEAD +[0.2.0]: https://github.com/mineiros-io/terraform-google-storage-bucket/compare/v0.1.0...v0.2.0 [0.1.0]: https://github.com/mineiros-io/terraform-google-storage-bucket/compare/v0.0.6...v0.1.0 [0.0.6]: https://github.com/mineiros-io/terraform-google-storage-bucket/compare/v0.0.5...v0.0.6 [0.0.5]: https://github.com/mineiros-io/terraform-google-storage-bucket/compare/v0.0.4...v0.0.5