Class: CfnGuardian::Models::PortEvent
- Defined in:
- lib/cfnguardian/models/event.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from BaseEvent
#cron, #enabled, #environment, #group, #hash, #name, #resource, #ssm_parameters, #target, #type
Instance Method Summary collapse
-
#initialize(resource) ⇒ PortEvent
constructor
A new instance of PortEvent.
- #payload ⇒ Object
Constructor Details
#initialize(resource) ⇒ PortEvent
Returns a new instance of PortEvent.
133 134 135 136 137 138 139 140 141 |
# File 'lib/cfnguardian/models/event.rb', line 133 def initialize(resource) super(resource) @group = 'Port' @name = 'PortEvent' @target = 'PortCheckFunction' @hostname = resource['Id'] @port = resource['Port'] @timeout = resource.fetch('Timeout',120) end |
Instance Method Details
#payload ⇒ Object
143 144 145 146 147 148 149 150 |
# File 'lib/cfnguardian/models/event.rb', line 143 def payload return { 'HOSTNAME' => @hostname, 'PORT' => @port, 'TIMEOUT' => @timeout, 'STATUS_CODE_MATCH' => @status_code }.to_json end |