Class: Jets::Stack::Resource
- Inherits:
-
Object
- Object
- Jets::Stack::Resource
- Includes:
- Definition
- Defined in:
- lib/jets/stack/resource.rb,
lib/jets/stack/resource/dsl.rb
Defined Under Namespace
Modules: Dsl
Instance Method Summary collapse
- #replace_placeholers(template) ⇒ Object
-
#standarize(definition) ⇒ Object
CloudFormation Resources reference: amzn.to/2NKg6ip.
- #template ⇒ Object
Methods included from Definition
#camelize, #initialize, #register
Instance Method Details
#replace_placeholers(template) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/jets/stack/resource.rb', line 21 def replace_placeholers(template) attributes = template.values.first s3_key = attributes.dig('Properties','Code','S3Key') if s3_key == "code_s3_key_placeholder" checksum = Jets::Builders::Md5.checksums["stage/code"] code_zip = "code-#{checksum}.zip" attributes['Properties']['Code']['S3Key'] = "jets/code/#{code_zip}" end template end |
#standarize(definition) ⇒ Object
CloudFormation Resources reference: amzn.to/2NKg6ip
17 18 19 |
# File 'lib/jets/stack/resource.rb', line 17 def standarize(definition) Jets::Resource::Standardizer.new(definition).template end |
#template ⇒ Object
10 11 12 13 14 |
# File 'lib/jets/stack/resource.rb', line 10 def template template = camelize(standarize(@definition)) template = replace_placeholers(template) template end |