From 54794651d3d7ccb3b917e371ee3e118857f93680 Mon Sep 17 00:00:00 2001 From: Joseph Lawson Date: Tue, 21 Oct 2014 16:29:51 -0400 Subject: [PATCH] implement Fn::Join --- moto/cloudformation/parsing.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/moto/cloudformation/parsing.py b/moto/cloudformation/parsing.py index b0f29fc21..bbee79d33 100644 --- a/moto/cloudformation/parsing.py +++ b/moto/cloudformation/parsing.py @@ -73,7 +73,6 @@ def clean_json(resource_json, resources_map): return resource if 'Fn::GetAtt' in resource_json: - resource = resources_map[resource_json['Fn::GetAtt'][0]] if resource is None: return resource_json @@ -90,6 +89,13 @@ def clean_json(resource_json, resources_map): except Exception as e: pass + if 'Fn::Join' in resource_json: + join_list = [] + for val in resource_json['Fn::Join'][1]: + cleaned_val = clean_json(val, resources_map) + join_list.append(cleaned_val if cleaned_val else '{0}'.format(val)) + return resource_json['Fn::Join'][0].join(join_list) + cleaned_json = {} for key, value in resource_json.items(): cleaned_json[key] = clean_json(value, resources_map)