Class: Jackal::Cfn::Scrubber

Inherits:
Resource
  • Object
show all
Defined in:
lib/jackal-cfn/resource/scrubber.rb

Constant Summary

Constants inherited from Resource

Resource::VALID_RESOURCE_STATUS

Instance Method Summary collapse

Methods inherited from Resource

#build_response, #failure_wrap, inherited, #physical_resource_id, #respond_to_stack, #setup, #unpack

Methods included from Utils::Http

#response_endpoint

Methods included from Utils

#snakecase, #transform_parameters

Instance Method Details

#execute(message) ⇒ Object

Scrub resource

Parameters:

  • message (Carnivore::Message)


15
16
17
18
19
20
21
22
23
24
# File 'lib/jackal-cfn/resource/scrubber.rb', line 15

def execute(message)
  failure_wrap(message) do |payload|
    cfn_resource = rekey_hash(payload.get(:data, :cfn_resource))
    properties = rekey_hash(cfn_resource[:resource_properties])
    parameters = rekey_hash(properties[:parameters])
    cfn_response = build_response(cfn_resource)
    respond_to_stack(cfn_response, cfn_resource[:response_url])
    job_completed(:jackal_cfn, payload, message)
  end
end

#valid?(message) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
# File 'lib/jackal-cfn/resource/scrubber.rb', line 7

def valid?(message)
  payload = unpack(message)
  payload.get(:data, :cfn_resource)
end