Skip to content

Commit

Permalink
Merge pull request #26 from mineiros-io/mariux/fix-condition-null
Browse files Browse the repository at this point in the history
fix: indexing of iam.condition == null
  • Loading branch information
mariux committed Dec 31, 2022
2 parents 3d6246f + 756bd2a commit f50e6b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit f50e6b1

Please sign in to comment.