Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix issues with missing context when enabled=false #13

Merged
merged 1 commit into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}