Class: AWSCDK::StepFunctionsTasks::EventBridgePutEventsEntry

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
step_functions_tasks/event_bridge_put_events_entry.rb

Overview

An entry to be sent to EventBridge.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(detail:, detail_type:, source:, event_bus: nil) ⇒ EventBridgePutEventsEntry

Returns a new instance of EventBridgePutEventsEntry.

Parameters:

  • detail (AWSCDK::StepFunctions::TaskInput)

    The event body.

  • detail_type (String)

    Used along with the source field to help identify the fields and values expected in the detail field.

  • source (String)

    The service or application that caused this event to be generated.

  • event_bus (AWSCDK::Interfaces::AWSEvents::IEventBusRef, nil) (defaults to: nil)

    The event bus the entry will be sent to.



13
14
15
16
17
18
19
20
21
22
# File 'step_functions_tasks/event_bridge_put_events_entry.rb', line 13

def initialize(detail:, detail_type:, source:, event_bus: nil)
  @detail = detail
  Jsii::Type.check_type(@detail, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9ucy5UYXNrSW5wdXQifQ==")), "detail")
  @detail_type = detail_type
  Jsii::Type.check_type(@detail_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "detailType")
  @source = source
  Jsii::Type.check_type(@source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "source")
  @event_bus = event_bus
  Jsii::Type.check_type(@event_bus, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19ldmVudHMuSUV2ZW50QnVzUmVmIn0=")), "eventBus") unless @event_bus.nil?
end

Instance Attribute Details

#detailAWSCDK::StepFunctions::TaskInput (readonly)

The event body.

Can either be provided as an object or as a JSON-serialized string

Examples:

AWSCDK::StepFunctions::TaskInput.from_text("{\"instance-id\": \"i-1234567890abcdef0\", \"state\": \"terminated\"}")
AWSCDK::StepFunctions::TaskInput.from_object({Message: "Hello from Step Functions"})
AWSCDK::StepFunctions::TaskInput.from_json_path_at("$.EventDetail")

Returns:



33
34
35
# File 'step_functions_tasks/event_bridge_put_events_entry.rb', line 33

def detail
  @detail
end

#detail_typeString (readonly)

Used along with the source field to help identify the fields and values expected in the detail field.

For example, events by CloudTrail have detail type "AWS API Call via CloudTrail"



40
41
42
# File 'step_functions_tasks/event_bridge_put_events_entry.rb', line 40

def detail_type
  @detail_type
end

#event_busAWSCDK::Interfaces::AWSEvents::IEventBusRef? (readonly)

Note:

Default: - event is sent to account's default event bus

The event bus the entry will be sent to.



52
53
54
# File 'step_functions_tasks/event_bridge_put_events_entry.rb', line 52

def event_bus
  @event_bus
end

#sourceString (readonly)

The service or application that caused this event to be generated.

Example value: com.example.service



47
48
49
# File 'step_functions_tasks/event_bridge_put_events_entry.rb', line 47

def source
  @source
end

Class Method Details

.jsii_propertiesObject



54
55
56
57
58
59
60
61
# File 'step_functions_tasks/event_bridge_put_events_entry.rb', line 54

def self.jsii_properties
  {
    :detail => "detail",
    :detail_type => "detailType",
    :source => "source",
    :event_bus => "eventBus",
  }
end

Instance Method Details

#to_jsiiObject



63
64
65
66
67
68
69
70
71
72
# File 'step_functions_tasks/event_bridge_put_events_entry.rb', line 63

def to_jsii
  result = {}
  result.merge!({
    "detail" => @detail,
    "detailType" => @detail_type,
    "source" => @source,
    "eventBus" => @event_bus,
  })
  result.compact
end