Class: Stackit::Template
- Inherits:
-
Object
- Object
- Stackit::Template
- Defined in:
- lib/stackit/template.rb
Instance Attribute Summary collapse
-
#cloudformation ⇒ Object
Returns the value of attribute cloudformation.
-
#options ⇒ Object
Returns the value of attribute options.
-
#parsed_parameters ⇒ Object
Returns the value of attribute parsed_parameters.
-
#template_path ⇒ Object
Returns the value of attribute template_path.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Template
constructor
A new instance of Template.
- #needs_iam_capability? ⇒ Boolean
- #parse! ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Template
Returns a new instance of Template.
9 10 11 12 13 |
# File 'lib/stackit/template.rb', line 9 def initialize( = {}) @cloudformation = [:cloudformation] || Stackit.cloudformation @template_path = [:template_path] @options = {} end |
Instance Attribute Details
#cloudformation ⇒ Object
Returns the value of attribute cloudformation.
4 5 6 |
# File 'lib/stackit/template.rb', line 4 def cloudformation @cloudformation end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/stackit/template.rb', line 6 def @options end |
#parsed_parameters ⇒ Object
Returns the value of attribute parsed_parameters.
7 8 9 |
# File 'lib/stackit/template.rb', line 7 def parsed_parameters @parsed_parameters end |
#template_path ⇒ Object
Returns the value of attribute template_path.
5 6 7 |
# File 'lib/stackit/template.rb', line 5 def template_path @template_path end |
Instance Method Details
#needs_iam_capability? ⇒ Boolean
32 33 34 |
# File 'lib/stackit/template.rb', line 32 def needs_iam_capability? body =~ /AWS::IAM::AccessKey|AWS::IAM::Group|AWS::IAM::InstanceProfile|AWS::IAM::Policy|AWS::IAM::Role|AWS::IAM::User|AWS::IAM::UserToGroupAddition/ ? true : false end |
#parse! ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/stackit/template.rb', line 15 def parse! Stackit.logger.info "Parsing cloudformation template: #{template_path}" if @template_path =~ /^http/ @options[:template_url] = @template_path else @options[:template_body] = body end @options[:parameters] = validate self end |