def intrinsics_multi_constructor(loader, tag_prefix, node):
 tag = node.tag[1:]
 prefix = 'Fn::'
 if (tag == 'Ref'):
  prefix = ''
 cfntag = (prefix + tag)
 if (tag == 'GetAtt'):
  value = node.value.split('.', 1)
 elif isinstance(node, ScalarNode):
  value = loader.construct_scalar(node)
 elif isinstance(node, SequenceNode):
  value = loader.construct_sequence(node)
 else:
  value = loader.construct_mapping(node)
 return {cfntag: value}

def intrinsics_multi_constructor ( loader , tag_prefix , node ) : tag = node . tag [ 1 : ] prefix = 'Fn::' if ( tag == 'Ref' ) : prefix = '' cfntag = ( prefix + tag ) if ( tag == 'GetAtt' ) : value = node . value . split ( '.' , 1 ) elif isinstance ( node , ScalarNode ) : value = loader . construct_scalar ( node ) elif isinstance ( node , SequenceNode ) : value = loader . construct_sequence ( node ) else : value = loader . construct_mapping ( node ) return { cfntag : value }
yaml constructor to parse cloudformation intrinsics .