EventField

class aws_cdk.aws_events.EventField(*args: Any, **kwargs)

Bases: object

Represents a field in the event pattern.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_logs as logs
# log_group: logs.LogGroup
# rule: events.Rule


rule.add_target(targets.CloudWatchLogGroup(log_group,
    log_event=targets.LogGroupTargetInput.from_object(
        timestamp=events.EventField.from_path("$.time"),
        message=events.EventField.from_path("$.detail-type")
    )
))

Methods

resolve(_ctx)

Produce the Token’s value at resolution time.

Parameters:

_ctx (IResolveContext) –

Return type:

Any

to_json()

Convert the path to the field in the event pattern to JSON.

Return type:

str

to_string()

Return a string representation of this resolvable object.

Returns a reversible string representation.

Return type:

str

Attributes

account = '${Token[account.1038]}'
creation_stack

The creation stack of this resolvable which will be appended to errors thrown during resolution.

This may return an array with a single informational element indicating how to get this property populated, if it was skipped for performance reasons.

detail_type = '${Token[detail-type.1039]}'
display_hint

Human readable display hint about the event pattern.

event_id = '${Token[id.1040]}'
path

the path to a field in the event pattern.

region = '${Token[region.1041]}'
source = '${Token[source.1042]}'
time = '${Token[time.1043]}'

Static Methods

classmethod from_path(path)

Extract a custom JSON path from the event.

Parameters:

path (str) –

Return type:

str