8000 fix CloudFormation GetAtt intrinsic function for attr string refs · riddopic/localstack@c238c73 · GitHub
[go: up one dir, main page]

Skip to content

Commit c238c73

Browse files
committed
fix CloudFormation GetAtt intrinsic function for attr string refs
1 parent 4a0e3b3 commit c238c73

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ IMAGE_NAME_LIGHT ?= localstack/localstack-light
44
IMAGE_NAME_FULL ?= localstack/localstack-full
55
IMAGE_TAG ?= $(shell cat localstack/constants.py | grep '^VERSION =' | sed "s/VERSION = ['\"]\(.*\)['\"].*/\1/")
66
DOCKER_SQUASH ?= --squash
7+
NOSE_LOG_LEVEL ?= WARNING
78
VENV_DIR ?= .venv
89
PIP_CMD ?= pip
910
TEST_PATH ?= .
@@ -144,7 +145,7 @@ web:
144145
## Run automated tests
145146
test:
146147
make lint && \
147-
($(VENV_RUN); DEBUG=$(DEBUG 8000 ) PYTHONPATH=`pwd` nosetests $(NOSE_ARGS) --with-timer --with-coverage --logging-level=WARNING --nocapture --no-skip --exe --cover-erase --cover-tests --cover-inclusive --cover-package=localstack --with-xunit --exclude='$(VENV_DIR).*' --ignore-files='lambda_python3.py' $(TEST_PATH))
148+
($(VENV_RUN); DEBUG=$(DEBUG) PYTHONPATH=`pwd` nosetests $(NOSE_ARGS) --with-timer --with-coverage --logging-level=$(NOSE_LOG_LEVEL) --nocapture --no-skip --exe --cover-erase --cover-tests --cover-inclusive --cover-package=localstack --with-xunit --exclude='$(VENV_DIR).*' --ignore-files='lambda_python3.py' $(TEST_PATH))
148149

149150
test-docker:
150151
ENTRYPOINT="--entrypoint=" CMD="make test" make docker-run

localstack/utils/bootstrap.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,15 +413,14 @@ def validate_localstack_config(name):
413413

414414
# docker-compose file validation cases
415415

416-
if (docker_env.get('LAMBDA_REMOTE_DOCKER') in constants.FALSE_STRINGS and
417-
docker_env.get('HOST_TMP_FOLDER') in ['${TMPDIR}', None, '']):
418-
warns.append('Make sure to properly set the "HOST_TMP_FOLDER" environment variable for the '
419-
'LocalStack container when using "LAMBDA_REMOTE_DOCKER=false"')
420-
421416
if docker_env.get('PORT_WEB_UI') not in ['${PORT_WEB_UI- }', None, ''] and image_name == 'localstack/localstack':
422417
warns.append('"PORT_WEB_UI" Web UI is now deprecated, '
423418
'and requires to use the "localstack/localstack-full" image.')
424419

420+
if not docker_env.get('HOST_TMP_FOLDER'):
421+
warns.append('Please configure the "HOST_TMP_FOLDER" environment variable to point to the ' +
422+
'absolute path of a temp folder on your host system (e.g., HOST_TMP_FOLDER=${TMPDIR})')
423+
425424
if (main_container not in container_name) and not docker_env.get('MAIN_CONTAINER_NAME'):
426425
warns.append('Please use "container_name: %s" or add "MAIN_CONTAINER_NAME" in "environment".' %
427426
main_container)

localstack/utils/cloudformation/template_deployer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,9 @@ def resolve_refs_recursively(stack_name, value, resources):
850850
return ref
851851

852852
if stripped_fn_lower == 'getatt':
853-
return resolve_ref(stack_name, value[keys_list[0]][0], resources, attribute=value[keys_list[0]][1])
853+
attr_ref = value[keys_list[0]]
854+
attr_ref = attr_ref.split('.') if isinstance(attr_ref, str) else attr_ref
855+
return resolve_ref(stack_name, attr_ref[0], resources, attribute=attr_ref[1])
854856

855857
if stripped_fn_lower == 'join':
856858
join_values = value[keys_list[0]][1]

0 commit comments

Comments
 (0)
0