Class: AWSCDK::EventsTargets::LogGroupTargetInputOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
events_targets/log_group_target_input_options.rb

Overview

Options used when creating a target input template.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message: nil, timestamp: nil) ⇒ LogGroupTargetInputOptions

Returns a new instance of LogGroupTargetInputOptions.

Parameters:

  • message (Object, nil) (defaults to: nil)

    The value provided here will be used in the Log "message" field.

  • timestamp (Object, nil) (defaults to: nil)

    The timestamp that will appear in the CloudWatch Logs record.



9
10
11
12
13
14
# File 'events_targets/log_group_target_input_options.rb', line 9

def initialize(message: nil, timestamp: nil)
  @message = message
  Jsii::Type.check_type(@message, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "message") unless @message.nil?
  @timestamp = timestamp
  Jsii::Type.check_type(@timestamp, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "timestamp") unless @timestamp.nil?
end

Instance Attribute Details

#messageObject? (readonly)

Note:

Default: EventField.detailType

The value provided here will be used in the Log "message" field.

This field must be a string. If an object is passed (e.g. JSON data) it will not throw an error, but the message that makes it to CloudWatch logs will be incorrect. This is a likely scenario if doing something like: EventField.fromPath('$.detail') since in most cases the detail field contains JSON data.

Returns:

  • (Object, nil)


26
27
28
# File 'events_targets/log_group_target_input_options.rb', line 26

def message
  @message
end

#timestampObject? (readonly)

Note:

Default: EventField.time

The timestamp that will appear in the CloudWatch Logs record.

Returns:

  • (Object, nil)


31
32
33
# File 'events_targets/log_group_target_input_options.rb', line 31

def timestamp
  @timestamp
end

Class Method Details

.jsii_propertiesObject



33
34
35
36
37
38
# File 'events_targets/log_group_target_input_options.rb', line 33

def self.jsii_properties
  {
    :message => "message",
    :timestamp => "timestamp",
  }
end

Instance Method Details

#to_jsiiObject



40
41
42
43
44
45
46
47
# File 'events_targets/log_group_target_input_options.rb', line 40

def to_jsii
  result = {}
  result.merge!({
    "message" => @message,
    "timestamp" => @timestamp,
  })
  result.compact
end