Skip to content

Commit 445c7d3

Browse files
committed
fix: using tags other than unrestricted
fix error: `var.can_close_accounts_with_tags is map of list of string with 1 element`
1 parent 157b445 commit 445c7d3

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [v0.5.1]
11+
12+
### Changed
13+
14+
- Fixed and simplified logic for checking if unrestricted account closure is enabled using reserved key `__meshstack_allow_close_all__`.
15+
1016
## [v0.5.0]
1117

1218
### Added

modules/meshcloud-replicator/replicator-management-account-access/data.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ locals {
22
account_id = data.aws_caller_identity.current.account_id # current account number.
33

44
# Check if unrestricted account closure is enabled using reserved key
5-
allow_close_all_accounts = (
6-
length(var.can_close_accounts_with_tags) == 1 &&
7-
contains(keys(var.can_close_accounts_with_tags), "__meshstack_allow_close_all__") &&
8-
var.can_close_accounts_with_tags["__meshstack_allow_close_all__"][0] == "true"
9-
)
5+
allow_close_all_accounts = jsonencode(var.can_close_accounts_with_tags) == jsonencode({ "__meshstack_allow_close_all__" = ["true"] })
106

117
# Get tag restrictions (empty if unrestricted access)
128
tag_restrictions = local.allow_close_all_accounts ? {} : var.can_close_accounts_with_tags

0 commit comments

Comments
 (0)