Class: CfnCli::Event
Constant Summary collapse
- RESOURCE_CREATE_INITIATED =
'Resource creation Initiated'.freeze
- AWS_STACK_RESOURCE =
'AWS::CloudFormation::Stack'.freeze
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Instance Method Summary collapse
-
#child_stack_create_event? ⇒ Boolean
Check if the current event has the signature of a child stack creation.
- #color ⇒ Object
-
#initialize(event) ⇒ Event
constructor
A new instance of Event.
- #status ⇒ Object
- #to_s ⇒ Object
Methods included from CfnStates
#failed?, #failed_states, #finished?, #finished_states, #in_progress?, #states, #succeeded?, #success_states, #transitive_states
Constructor Details
#initialize(event) ⇒ Event
Returns a new instance of Event.
12 13 14 |
# File 'lib/cfncli/event.rb', line 12 def initialize(event) @event = event end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
7 8 9 |
# File 'lib/cfncli/event.rb', line 7 def event @event end |
Instance Method Details
#child_stack_create_event? ⇒ Boolean
Check if the current event has the signature of a child stack creation
27 28 29 30 31 32 |
# File 'lib/cfncli/event.rb', line 27 def child_stack_create_event? return false unless in_progress? return false unless event.resource_type == AWS_STACK_RESOURCE return false unless event.resource_status_reason == RESOURCE_CREATE_INITIATED true end |
#color ⇒ Object
20 21 22 23 24 |
# File 'lib/cfncli/event.rb', line 20 def color return :green if succeeded? return :yellow if in_progress? return :red if failed? end |
#status ⇒ Object
16 17 18 |
# File 'lib/cfncli/event.rb', line 16 def status event.resource_status end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/cfncli/event.rb', line 34 def to_s "#{event.timestamp} #{event.resource_status} #{event.resource_type} #{event.logical_resource_id} #{event.resource_status_reason}" end |