Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit cbf7706

Browse files
committed
fix CF unit test
1 parent 4b14cb2 commit cbf7706

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

localstack/utils/cloudformation/template_deployer.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,13 @@ def resolve_ref(stack_name, ref, resources, attribute):
618618
return aws_stack.get_region()
619619
if ref == 'AWS::Partition':
620620
return 'aws'
621+
622+
# first, check stack parameters
623+
stack_param = get_stack_parameter(stack_name, ref)
624+
if stack_param is not None:
625+
return stack_param
626+
627+
# second, resolve resource references
621628
resource_status = {}
622629
if stack_name:
623630
resource_status = describe_stack_resource(stack_name, ref)
@@ -645,14 +652,8 @@ def resolve_refs_recursively(stack_name, value, resources):
645652
keys_list = list(value.keys())
646653
# process special operators
647654
if keys_list == ['Ref']:
648-
# first, check stack parameters
649-
stack_param = get_stack_parameter(stack_name, value['Ref'])
650-
if stack_param is not None:
651-
return stack_param
652-
# second, resolve resource references
653-
result = resolve_ref(stack_name, value['Ref'],
655+
return resolve_ref(stack_name, value['Ref'],
654656
resources, attribute='PhysicalResourceId')
655-
return result
656657
if keys_list and keys_list[0].lower() == 'fn::getatt':
657658
return resolve_ref(stack_name, value[keys_list[0]][0],
658659
resources, attribute=value[keys_list[0]][1])

0 commit comments

Comments
 (0)