Class: StackMaster::Validator
- Inherits:
-
Object
- Object
- StackMaster::Validator
- Includes:
- Command
- Defined in:
- lib/stack_master/validator.rb
Instance Method Summary collapse
-
#initialize(stack_definition) ⇒ Validator
constructor
A new instance of Validator.
- #perform ⇒ Object
Methods included from Command
Constructor Details
#initialize(stack_definition) ⇒ Validator
Returns a new instance of Validator.
5 6 7 |
# File 'lib/stack_master/validator.rb', line 5 def initialize(stack_definition) @stack_definition = stack_definition end |
Instance Method Details
#perform ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/stack_master/validator.rb', line 9 def perform template_body = TemplateCompiler.compile(@stack_definition.template_file_path) cf.validate_template(template_body: template_body) StackMaster.stdout.puts "Valid" rescue Aws::CloudFormation::Errors::ValidationError => e $stderr.puts "Validation Failed" $stderr.puts e. end |