Skip to content

Commit

Permalink
Turn logic around for proxied commands check (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
lakkeger committed Mar 14, 2024
1 parent be1f665 commit 07643c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ please refer to the man pages of `terraform --help`.

## Change Log

* v0.18.1: Fix issue with not proxied commands
* v0.18.0: Add `DRY_RUN` and patch S3 backend entrypoints
* v0.17.1: Add `packaging` module to install requirements
* v0.17.0: Add option to use new endpoints S3 backend options
Expand Down
8 changes: 4 additions & 4 deletions bin/tflocal
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ LOCALHOST_HOSTNAME = "localhost.localstack.cloud"
S3_HOSTNAME = os.environ.get("S3_HOSTNAME") or f"s3.{LOCALHOST_HOSTNAME}"
USE_EXEC = str(os.environ.get("USE_EXEC")).strip().lower() in ["1", "true"]
TF_CMD = os.environ.get("TF_CMD") or "terraform"
TF_PROXIED_CMDS = ("init", "plan", "apply", "destroy")
TF_UNPROXIED_CMDS = os.environ.get("TF_UNPROXIED_CMDS").split(sep=",") if os.environ.get("TF_UNPROXIED_CMDS") else ("fmt", "validate", "version")
LS_PROVIDERS_FILE = os.environ.get("LS_PROVIDERS_FILE") or "localstack_providers_override.tf"
LOCALSTACK_HOSTNAME = urlparse(AWS_ENDPOINT_URL).hostname or os.environ.get("LOCALSTACK_HOSTNAME") or "localhost"
EDGE_PORT = int(urlparse(AWS_ENDPOINT_URL).port or os.environ.get("EDGE_PORT") or 4566)
Expand Down Expand Up @@ -402,9 +402,9 @@ def get_or_create_ddb_table(table_name: str, region: str = None):
# TF UTILS
# ---
def is_override_needed(args) -> bool:
if any(map(lambda x: x in args, TF_PROXIED_CMDS)):
return True
return False
if any(map(lambda x: x in args, TF_UNPROXIED_CMDS)):
return False
return True


def parse_tf_files() -> dict:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = terraform-local
version = 0.18.0
version = 0.18.1
url = https://github.com/localstack/terraform-local
author = LocalStack Team
author_email = info@localstack.cloud
Expand Down

0 comments on commit 07643c4

Please sign in to comment.