Class EventField
Represents a field in the event pattern.
Implements
Namespace: Amazon.CDK.AWS.Events
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class EventField : DeputyBase, IResolvable
Syntax (vb)
Public Class EventField Inherits DeputyBase Implements IResolvable
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Logs;
LogGroup logGroup;
Rule rule;
rule.AddTarget(new CloudWatchLogGroup(logGroup, new LogGroupProps {
LogEvent = LogGroupTargetInput.FromObjectV2(new LogGroupTargetInputOptions {
Timestamp = EventField.FromPath("$.time"),
Message = EventField.FromPath("$.detail-type")
})
}));
Synopsis
Properties
| Account | Extract the account from the event. |
| CreationStack | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
| DetailType | Extract the detail type from the event. |
| DisplayHint | Human readable display hint about the event pattern. |
| EventId | Extract the event ID from the event. |
| Path | the path to a field in the event pattern. |
| Region | Extract the region from the event. |
| Source | Extract the source from the event. |
| Time | Extract the time from the event. |
Methods
| FromPath(string) | Extract a custom JSON path from the event. |
| Resolve(IResolveContext) | Produce the Token's value at resolution time. |
| ToJSON() | Convert the path to the field in the event pattern to JSON. |
| ToString() | Return a string representation of this resolvable object. |
Properties
Account
Extract the account from the event.
public static string Account { get; }
Property Value
Remarks
ExampleMetadata: infused
CreationStack
The creation stack of this resolvable which will be appended to errors thrown during resolution.
public virtual string[] CreationStack { get; }
Property Value
string[]
Remarks
This may return an array with a single informational element indicating how to get this property populated, if it was skipped for performance reasons.
DetailType
Extract the detail type from the event.
public static string DetailType { get; }
Property Value
Remarks
ExampleMetadata: infused
DisplayHint
Human readable display hint about the event pattern.
public virtual string DisplayHint { get; }
Property Value
Remarks
ExampleMetadata: infused
EventId
Extract the event ID from the event.
public static string EventId { get; }
Property Value
Remarks
ExampleMetadata: infused
Path
the path to a field in the event pattern.
public virtual string Path { get; }
Property Value
Remarks
ExampleMetadata: infused
Region
Extract the region from the event.
public static string Region { get; }
Property Value
Remarks
ExampleMetadata: infused
Source
Extract the source from the event.
public static string Source { get; }
Property Value
Remarks
ExampleMetadata: infused
Time
Extract the time from the event.
public static string Time { get; }
Property Value
Remarks
ExampleMetadata: infused
Methods
FromPath(string)
Extract a custom JSON path from the event.
public static string FromPath(string path)
Parameters
- path string
Returns
Remarks
ExampleMetadata: infused
Resolve(IResolveContext)
Produce the Token's value at resolution time.
public virtual object Resolve(IResolveContext ctx)
Parameters
- ctx IResolveContext
Returns
Remarks
ExampleMetadata: infused
ToJSON()
Convert the path to the field in the event pattern to JSON.
public virtual string ToJSON()
Returns
Remarks
ExampleMetadata: infused
ToString()
Return a string representation of this resolvable object.
public override string ToString()
Returns
Remarks
Returns a reversible string representation.