code: def setup_resource(self):
          
          template = self.template
          variables = self.get_variables()
  
          tclass = variables['Class']
          tprops = variables['Properties']
          output = variables['Output']
  
          klass = load_object_from_string('troposphere.' + tclass)
  
          instance = klass.from_dict('ResourceRefName', tprops)
  
          template.add_resource(instance)
          template.add_output(Output(
              output,
              Description="A reference to the object created in this blueprint",
              Value=Ref(instance)
          ))
docs: Setting Up Resource