Class: AWSCDK::EventsTargets::LogGroupProps

Inherits:
TargetBaseProps
  • Object
show all
Defined in:
events_targets/log_group_props.rb

Overview

Customize the CloudWatch LogGroup Event Target.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, event: nil, install_latest_aws_sdk: nil, log_event: nil) ⇒ LogGroupProps

Returns a new instance of LogGroupProps.

Parameters:

  • dead_letter_queue (AWSCDK::SQS::IQueue, nil) (defaults to: nil)

    The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.

  • max_event_age (AWSCDK::Duration, nil) (defaults to: nil)

    The maximum age of a request that Lambda sends to a function for processing.

  • retry_attempts (Numeric, nil) (defaults to: nil)

    The maximum number of times to retry when the function returns an error.

  • event (AWSCDK::Events::RuleTargetInput, nil) (defaults to: nil)

    The event to send to the CloudWatch LogGroup.

  • install_latest_aws_sdk (Boolean, nil) (defaults to: nil)

    Whether the custom resource created wll default to install latest AWS SDK.

  • log_event (AWSCDK::EventsTargets::LogGroupTargetInput, nil) (defaults to: nil)

    The event to send to the CloudWatch LogGroup.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'events_targets/log_group_props.rb', line 13

def initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, event: nil, install_latest_aws_sdk: nil, log_event: nil)
  @dead_letter_queue = dead_letter_queue
  Jsii::Type.check_type(@dead_letter_queue, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3FzLklRdWV1ZSJ9")), "deadLetterQueue") unless @dead_letter_queue.nil?
  @max_event_age = max_event_age
  Jsii::Type.check_type(@max_event_age, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "maxEventAge") unless @max_event_age.nil?
  @retry_attempts = retry_attempts
  Jsii::Type.check_type(@retry_attempts, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retryAttempts") unless @retry_attempts.nil?
  @event = event
  Jsii::Type.check_type(@event, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLlJ1bGVUYXJnZXRJbnB1dCJ9")), "event") unless @event.nil?
  @install_latest_aws_sdk = install_latest_aws_sdk
  Jsii::Type.check_type(@install_latest_aws_sdk, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "installLatestAwsSdk") unless @install_latest_aws_sdk.nil?
  @log_event = log_event
  Jsii::Type.check_type(@log_event, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzX3RhcmdldHMuTG9nR3JvdXBUYXJnZXRJbnB1dCJ9")), "logEvent") unless @log_event.nil?
end

Instance Attribute Details

#dead_letter_queueAWSCDK::SQS::IQueue? (readonly)

Note:

Default: - no dead-letter queue

The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.

The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.

Returns:



36
37
38
# File 'events_targets/log_group_props.rb', line 36

def dead_letter_queue
  @dead_letter_queue
end

#eventAWSCDK::Events::RuleTargetInput? (readonly)

Deprecated.

use logEvent instead

Note:

Default: - the entire EventBridge event

The event to send to the CloudWatch LogGroup.

This will be the event logged into the CloudWatch LogGroup



60
61
62
# File 'events_targets/log_group_props.rb', line 60

def event
  @event
end

#install_latest_aws_sdkBoolean? (readonly)

Note:

Default: - install latest AWS SDK

Whether the custom resource created wll default to install latest AWS SDK.

Returns:

  • (Boolean, nil)


65
66
67
# File 'events_targets/log_group_props.rb', line 65

def install_latest_aws_sdk
  @install_latest_aws_sdk
end

#log_eventAWSCDK::EventsTargets::LogGroupTargetInput? (readonly)

Note:

Default: - the entire EventBridge event

The event to send to the CloudWatch LogGroup.

This will be the event logged into the CloudWatch LogGroup



72
73
74
# File 'events_targets/log_group_props.rb', line 72

def log_event
  @log_event
end

#max_event_ageAWSCDK::Duration? (readonly)

Note:

Default: Duration.hours(24)

The maximum age of a request that Lambda sends to a function for processing.

Minimum value of 60. Maximum value of 86400.

Returns:



44
45
46
# File 'events_targets/log_group_props.rb', line 44

def max_event_age
  @max_event_age
end

#retry_attemptsNumeric? (readonly)

Note:

Default: 185

The maximum number of times to retry when the function returns an error.

Minimum value of 0. Maximum value of 185.

Returns:

  • (Numeric, nil)


52
53
54
# File 'events_targets/log_group_props.rb', line 52

def retry_attempts
  @retry_attempts
end

Class Method Details

.jsii_propertiesObject



74
75
76
77
78
79
80
81
82
83
# File 'events_targets/log_group_props.rb', line 74

def self.jsii_properties
  {
    :dead_letter_queue => "deadLetterQueue",
    :max_event_age => "maxEventAge",
    :retry_attempts => "retryAttempts",
    :event => "event",
    :install_latest_aws_sdk => "installLatestAwsSdk",
    :log_event => "logEvent",
  }
end

Instance Method Details

#to_jsiiObject



85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'events_targets/log_group_props.rb', line 85

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "deadLetterQueue" => @dead_letter_queue,
    "maxEventAge" => @max_event_age,
    "retryAttempts" => @retry_attempts,
    "event" => @event,
    "installLatestAwsSdk" => @install_latest_aws_sdk,
    "logEvent" => @log_event,
  })
  result.compact
end