Bases: _abcoll.Mapping
A stack template.
Retrieve a Template with the given ID from the database.
Reduces contiguous strings in Fn::Join to a single joined string eg the following { “Fn::Join” : [ ” ”, [ “str1”, “str2”, {“f”: “b”}, “str3”, “str4”]} is reduced to { “Fn::Join” : [ ” ”, [ “str1 str2”, {“f”: “b”}, “str3 str4”]}
Resolve constructs of the form { “Fn::GetAtt” : [ “WebServer”, “PublicIp” ] }
looking for { “Fn::GetAZs” : “str” }
Resolve constructs of the form { “Fn::Base64” : “string” }
Resolve constructs of the form { “Fn::FindInMap” : [ “mapping”, “key”, “value” ] }
Resolve constructs of the form { “Fn::Join” : [ “delim”, [ “str1”, “str2” ] }
Resolve constructs of the form {‘Fn::MemberListToMap’: [‘Name’, ‘Value’, [‘.member.0.Name=key’,
‘.member.0.Value=door’]]}
the first two arguments are the names of the key and value.
Resolve constructs of the form { “Ref” : “string” }
Resolve constructs of the form. {“Fn::Replace”: [
{‘$var1’: ‘foo’, ‘%var2%’: ‘bar’}, ‘$var1 is %var2%’
]} This is implemented using python str.replace on each key
Resolve constructs of the form {‘Fn::ResourceFacade’: ‘Metadata’}
Resolve constructs of the form { “Ref” : “resource” }
Resolve constructs of the form: (for a list lookup) { “Fn::Select” : [ “2”, [ “apples”, “grapes”, “mangoes” ] ] } returns “mangoes”
(for a dict lookup) { “Fn::Select” : [ “red”, {“red”: “a”, “flu”: “b”} ] } returns “a”
Note: can raise IndexError, KeyError, ValueError and TypeError
Split strings in Fn::Split to a list of sub strings eg the following { “Fn::Split” : [ ”,”, “str1,str2,str3,str4”]} is reduced to {[“str1”, “str2”, “str3”, “str4”]}
Store the Template in the database and return its ID.