Skip to content

Commit 07643c4

Browse files
authored
Turn logic around for proxied commands check (#52)
1 parent be1f665 commit 07643c4

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ please refer to the man pages of `terraform --help`.
4949

5050
## Change Log
5151

52+
* v0.18.1: Fix issue with not proxied commands
5253
* v0.18.0: Add `DRY_RUN` and patch S3 backend entrypoints
5354
* v0.17.1: Add `packaging` module to install requirements
5455
* v0.17.0: Add option to use new endpoints S3 backend options

bin/tflocal

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ LOCALHOST_HOSTNAME = "localhost.localstack.cloud"
3636
S3_HOSTNAME = os.environ.get("S3_HOSTNAME") or f"s3.{LOCALHOST_HOSTNAME}"
3737
USE_EXEC = str(os.environ.get("USE_EXEC")).strip().lower() in ["1", "true"]
3838
TF_CMD = os.environ.get("TF_CMD") or "terraform"
39-
TF_PROXIED_CMDS = ("init", "plan", "apply", "destroy")
39+
TF_UNPROXIED_CMDS = os.environ.get("TF_UNPROXIED_CMDS").split(sep=",") if os.environ.get("TF_UNPROXIED_CMDS") else ("fmt", "validate", "version")
4040
LS_PROVIDERS_FILE = os.environ.get("LS_PROVIDERS_FILE") or "localstack_providers_override.tf"
4141
LOCALSTACK_HOSTNAME = urlparse(AWS_ENDPOINT_URL).hostname or os.environ.get("LOCALSTACK_HOSTNAME") or "localhost"
4242
EDGE_PORT = int(urlparse(AWS_ENDPOINT_URL).port or os.environ.get("EDGE_PORT") or 4566)
@@ -402,9 +402,9 @@ def get_or_create_ddb_table(table_name: str, region: str = None):
402402
# TF UTILS
403403
# ---
404404
def is_override_needed(args) -> bool:
405-
if any(map(lambda x: x in args, TF_PROXIED_CMDS)):
406-
return True
407-
return False
405+
if any(map(lambda x: x in args, TF_UNPROXIED_CMDS)):
406+
return False
407+
return True
408408

409409

410410
def parse_tf_files() -> dict:

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = terraform-local
3-
version = 0.18.0
3+
version = 0.18.1
44
url = https://github.com/localstack/terraform-local
55
author = LocalStack Team
66
author_email = [email protected]

0 commit comments

Comments
 (0)