From 9b69a93484f04ccef21686b0d7f7a21d0140e2e6 Mon Sep 17 00:00:00 2001 From: dtimberlake Date: Mon, 19 Dec 2016 01:30:46 -0600 Subject: [PATCH] parsing GetAtt now correctly converts atributes with a '.' --- awscli/customizations/cloudformation/yamlhelper.py | 2 +- tests/unit/customizations/cloudformation/test_yamlhelper.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/awscli/customizations/cloudformation/yamlhelper.py b/awscli/customizations/cloudformation/yamlhelper.py index 7f622aa3cbce..9c09c1b7a11b 100644 --- a/awscli/customizations/cloudformation/yamlhelper.py +++ b/awscli/customizations/cloudformation/yamlhelper.py @@ -35,7 +35,7 @@ def intrinsics_multi_constructor(loader, tag_prefix, node): # ShortHand notation for !GetAtt accepts Resource.Attribute format # while the standard notation is to use an array # [Resource, Attribute]. Convert shorthand to standard format - value = node.value.split(".") + value = node.value.split(".", 1) elif isinstance(node, ScalarNode): # Value of this node is scalar diff --git a/tests/unit/customizations/cloudformation/test_yamlhelper.py b/tests/unit/customizations/cloudformation/test_yamlhelper.py index ad29e1afc5b7..bdd628ed4390 100644 --- a/tests/unit/customizations/cloudformation/test_yamlhelper.py +++ b/tests/unit/customizations/cloudformation/test_yamlhelper.py @@ -27,6 +27,7 @@ class TestYaml(unittest.TestCase): Key2: !GetAtt Another.Arn Key3: !FooBar [!Baz YetAnother, "hello"] Key4: !SomeTag {"a": "1"} + Key5: !GetAtt OneMore.Outputs.Arn """ parsed_yaml_dict = { @@ -47,6 +48,9 @@ class TestYaml(unittest.TestCase): "Fn::SomeTag": { "a": "1" } + }, + "Key5": { + "Fn::GetAtt": ["OneMore", "Outputs.Arn"] } } }