Module: Sfn::Utils::StackParameterScrubber

Defined in:
lib/sfn/utils/stack_parameter_scrubber.rb

Overview

Helper for scrubbing stack parameters

Constant Summary collapse

ALLOWED_PARAMETER_ATTRIBUTES =

Validate attributes within Parameter blocks

%w(
  Type Default NoEcho AllowedValues AllowedPattern
  MaxLength MinLength MaxValue MinValue Description
  ConstraintDescription
)

Instance Method Summary collapse

Instance Method Details

#parameter_scrub!(template) ⇒ Hash

Clean the parameters of the template

Parameters:

  • template (Hash)

Returns:

  • (Hash)

    template



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/sfn/utils/stack_parameter_scrubber.rb', line 19

def parameter_scrub!(template)
  parameters = template['Parameters']
  if(parameters)
    parameters.each do |name, options|
      options.delete_if do |attribute, value|
        !ALLOWED_PARAMETER_ATTRIBUTES.include?(attribute)
      end
    end
    template['Parameters'] = parameters
  end
  template
end