Sha256: 37a60c0ac6db650bd37e36c5855c49c6094b8ef91a7e0021cd9a42f3b88a3dbf
Contents?: true
Size: 1.66 KB
Versions: 2
Compression:
Stored size: 1.66 KB
Contents
class Jets::Resource extend Memoist autoload :ApiGateway, 'jets/resource/api_gateway' autoload :Associated, 'jets/resource/associated' autoload :Base, 'jets/resource/base' autoload :ChildStack, 'jets/resource/child_stack' autoload :Config, 'jets/resource/config' autoload :Events, 'jets/resource/events' autoload :Function, 'jets/resource/function' autoload :Iam, 'jets/resource/iam' autoload :Permission, 'jets/resource/permission' autoload :Replacer, 'jets/resource/replacer' autoload :Route53, 'jets/resource/route53' autoload :S3, 'jets/resource/s3' autoload :Sns, 'jets/resource/sns' autoload :Standardizer, 'jets/resource/standardizer' attr_reader :definition, :replacements def initialize(definition, replacements={}) @definition = definition @replacements = replacements end def template standarize(definition) end memoize :template # CloudFormation Resources reference: https://amzn.to/2NKg6ip def standarize(*definition) Standardizer.new(definition).template end def logical_id id = template.keys.first # replace possible {namespace} in the logical id id = replacer.replace_value(id) Jets::Camelizer.camelize(id) end def type attributes['Type'] end def properties attributes['Properties'] end def attributes attributes = template.values.first attributes = replacer.replace_placeholders(attributes) Jets::Camelizer.transform(attributes) end def parameters {} end def outputs {} end def replacer Replacer.new(replacements) end memoize :replacer def permission Permission.new(replacements, self) end memoize :permission end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
jets-1.2.1 | lib/jets/resource.rb |
jets-1.2.0 | lib/jets/resource.rb |