Class: StackMaster::Validator
- Inherits:
-
Object
- Object
- StackMaster::Validator
- Defined in:
- lib/stack_master/validator.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(stack_definition, config, options) ⇒ Validator
constructor
A new instance of Validator.
- #perform ⇒ Object
Constructor Details
#initialize(stack_definition, config, options) ⇒ Validator
Returns a new instance of Validator.
7 8 9 10 11 |
# File 'lib/stack_master/validator.rb', line 7 def initialize(stack_definition, config, ) @stack_definition = stack_definition @config = config @options = end |
Class Method Details
.valid?(stack_definition, config, options) ⇒ Boolean
3 4 5 |
# File 'lib/stack_master/validator.rb', line 3 def self.valid?(stack_definition, config, ) new(stack_definition, config, ).perform end |
Instance Method Details
#perform ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/stack_master/validator.rb', line 13 def perform StackMaster.stdout.print "#{@stack_definition.stack_name}: " if validate_template_parameters? && parameter_validator.missing_parameters? StackMaster.stdout.puts "invalid\n#{parameter_validator.}" return false end cf.validate_template(template_body: TemplateUtils.maybe_compressed_template_body(stack.template_body)) StackMaster.stdout.puts "valid" true rescue Aws::CloudFormation::Errors::ValidationError => e StackMaster.stdout.puts "invalid. #{e.}" false end |