Skip to content

Commit

Permalink
fix: Fix issues with missing context when enabled=false (#13)
Browse files Browse the repository at this point in the history
Co-authored-by: mariusz.wojakowski <[email protected]>
  • Loading branch information
mariusz89016 and mariusz.wojakowski authored Jan 25, 2023
1 parent 55cca69 commit 61b48f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
_Brief Description of MODULE:_

* _What it does_
* _What techonlogies it uses_
* _What technologies it uses_

> **Warning**:
> _When using "Invicton-Labs/deepmerge/null" module - pin `tflint` version to `v0.41.0` in [pre-commit.yaml](.github/workflows/pre-commit.yml) to avoid failing `tflint` checks_
Expand Down
4 changes: 2 additions & 2 deletions locals.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
locals {
# Get a name from the descriptor. If not available, use default naming convention.
# Trim and replace function are used to avoid bare delimiters on both ends of the name and situation of adjacent delimiters.
name_from_descriptor = trim(replace(
name_from_descriptor = local.enabled ? trim(replace(
lookup(module.this.descriptors, "module-resource-name", module.this.id), "/${module.this.delimiter}${module.this.delimiter}+/", module.this.delimiter
), module.this.delimiter)
), module.this.delimiter) : null

enabled = module.this.enabled
}

0 comments on commit 61b48f6

Please sign in to comment.