def __init__(self, cf_template, **kwargs):
        """
        Instantiates a new Troposphere Template based on an existing
        Cloudformation Template.
        """
        super(TemplateGenerator, self).__init__()
        if 'CustomMembers' in kwargs:
            self._custom_members = set(kwargs["CustomMembers"])

        self._reference_map = {}
        if 'AWSTemplateFormatVersion' in cf_template:
            self.add_version(cf_template['AWSTemplateFormatVersion'])
        if 'Transform' in cf_template:
            self.add_transform(cf_template['Transform'])
        if 'Description' in cf_template:
            self.add_description(cf_template['Description'])
        if 'Metadata' in cf_template:
            self.add_metadata(cf_template['Metadata'])
        for k, v in cf_template.get('Parameters', {}).iteritems():
            self.add_parameter(self._create_instance(Parameter, v, k))
        for k, v in cf_template.get('Mappings', {}).iteritems():
            self.add_mapping(k, self._convert_definition(v))
        for k, v in cf_template.get('Conditions', {}).iteritems():
            self.add_condition(k, self._convert_definition(v, k))
        for k, v in cf_template.get('Resources', {}).iteritems():
            self.add_resource(self._convert_definition(
                                    v, k,
                                    self._get_resource_type_cls(k, v)
            ))
        for k, v in cf_template.get('Outputs', {}).iteritems():
            self.add_output(self._create_instance(Output, v, k))
def __init__ ( self , cf_template , ** kwargs ) : super ( TemplateGenerator , self ) . __init__ ( ) if 'CustomMembers' in kwargs : self . _custom_members = set ( kwargs [ "CustomMembers" ] ) self . _reference_map = { } if 'AWSTemplateFormatVersion' in cf_template : self . add_version ( cf_template [ 'AWSTemplateFormatVersion' ] ) if 'Transform' in cf_template : self . add_transform ( cf_template [ 'Transform' ] ) if 'Description' in cf_template : self . add_description ( cf_template [ 'Description' ] ) if 'Metadata' in cf_template : self . add_metadata ( cf_template [ 'Metadata' ] ) for k , v in cf_template . get ( 'Parameters' , { } ) . iteritems ( ) : self . add_parameter ( self . _create_instance ( Parameter , v , k ) ) for k , v in cf_template . get ( 'Mappings' , { } ) . iteritems ( ) : self . add_mapping ( k , self . _convert_definition ( v ) ) for k , v in cf_template . get ( 'Conditions' , { } ) . iteritems ( ) : self . add_condition ( k , self . _convert_definition ( v , k ) ) for k , v in cf_template . get ( 'Resources' , { } ) . iteritems ( ) : self . add_resource ( self . _convert_definition ( v , k , self . _get_resource_type_cls ( k , v ) ) ) for k , v in cf_template . get ( 'Outputs' , { } ) . iteritems ( ) : self . add_output ( self . _create_instance ( Output , v , k ) )
Instantiates a new Troposphere Template based on an existing
        Cloudformation Template.