tags(cloudformation_json:, logical_resource_id:)click to toggle source
# File lib/cloudformation_tag_parser.rb, line 5deftags(cloudformation_json:,
logical_resource_id:)
cloudformation = JSON.load(cloudformation_json)
ifcloudformation['Resources'].nil?raise'malformed json, must have Resources key at least'endresource = cloudformation['Resources'][logical_resource_id]
ifresource.nil?raise"logical resource id #{logical_resource_id} is not found"end# Properties isn't there is a blow error, but jsut ignore that... need a better all-round parser for cfn in the first placetags = resource['Properties']['Tags']
tags.nil?? [] :tagsend