Skip to content

Commit

Permalink
Turn logic around for proxied commands check
Browse files Browse the repository at this point in the history
  • Loading branch information
lakkeger committed Mar 13, 2024
1 parent be1f665 commit 4aaf3ea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 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
4 changes: 2 additions & 2 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=",") or ("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,7 +402,7 @@ 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)):
if all(map(lambda x: x not in args, TF_UNPROXIED_CMDS)):
return True
return False

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 = [email protected]
Expand Down

0 comments on commit 4aaf3ea

Please sign in to comment.