Class: CfnGuardian::Models::BaseEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/cfnguardian/models/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource) ⇒ BaseEvent

Returns a new instance of BaseEvent.



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/cfnguardian/models/event.rb', line 19

def initialize(resource)
  @type = 'Event'
  @group = nil
  @target = nil
  @hash = Digest::MD5.hexdigest resource['Id']
  @name = @hash
  @cron = "* * * * ? *"
  @enabled = true
  @resource = resource['Id'].to_resource_name
  @environment = ""
  @payload = {}.to_json
  @ssm_parameters = []
end

Instance Attribute Details

#cronObject

Returns the value of attribute cron.



8
9
10
# File 'lib/cfnguardian/models/event.rb', line 8

def cron
  @cron
end

#enabledObject

Returns the value of attribute enabled.



8
9
10
# File 'lib/cfnguardian/models/event.rb', line 8

def enabled
  @enabled
end

#environmentObject

Returns the value of attribute environment.



8
9
10
# File 'lib/cfnguardian/models/event.rb', line 8

def environment
  @environment
end

#groupObject

Returns the value of attribute group.



8
9
10
# File 'lib/cfnguardian/models/event.rb', line 8

def group
  @group
end

#hashObject

Returns the value of attribute hash.



8
9
10
# File 'lib/cfnguardian/models/event.rb', line 8

def hash
  @hash
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/cfnguardian/models/event.rb', line 8

def name
  @name
end

#payloadObject

Returns the value of attribute payload.



8
9
10
# File 'lib/cfnguardian/models/event.rb', line 8

def payload
  @payload
end

#resourceObject

Returns the value of attribute resource.



8
9
10
# File 'lib/cfnguardian/models/event.rb', line 8

def resource
  @resource
end

#ssm_parametersObject

Returns the value of attribute ssm_parameters.



8
9
10
# File 'lib/cfnguardian/models/event.rb', line 8

def ssm_parameters
  @ssm_parameters
end

#targetObject

Returns the value of attribute target.



8
9
10
# File 'lib/cfnguardian/models/event.rb', line 8

def target
  @target
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/cfnguardian/models/event.rb', line 7

def type
  @type
end