Class EventField

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.events.EventField
All Implemented Interfaces:
IResolvable, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-05T03:43:43.685Z") @Stability(Stable) public class EventField extends software.amazon.jsii.JsiiObject implements IResolvable
Represents a field in the event pattern.

Example:

 import software.amazon.awscdk.services.logs.*;
 LogGroup logGroup;
 Rule rule;
 rule.addTarget(CloudWatchLogGroup.Builder.create(logGroup)
         .logEvent(LogGroupTargetInput.fromObject(LogGroupTargetInputOptions.builder()
                 .timestamp(EventField.fromPath("$.time"))
                 .message(EventField.fromPath("$.detail-type"))
                 .build()))
         .build());
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode

    Nested classes/interfaces inherited from interface software.amazon.awscdk.IResolvable

    IResolvable.Jsii$Default, IResolvable.Jsii$Proxy
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    EventField(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    EventField(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Extract a custom JSON path from the event.
    static String
    Extract the account from the event.
    The creation stack of this resolvable which will be appended to errors thrown during resolution.
    static String
    Extract the detail type from the event.
    Human readable display hint about the event pattern.
    static String
    Extract the event ID from the event.
    the path to a field in the event pattern.
    static String
    Extract the region from the event.
    static String
    Extract the source from the event.
    static String
    Extract the time from the event.
    Produce the Token's value at resolution time.
    Convert the path to the field in the event pattern to JSON.
    Return a string representation of this resolvable object.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface software.amazon.awscdk.IResolvable

    getTypeHint

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • EventField

      protected EventField(software.amazon.jsii.JsiiObjectRef objRef)
    • EventField

      protected EventField(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • fromPath

      @Stability(Stable) @NotNull public static String fromPath(@NotNull String path)
      Extract a custom JSON path from the event.

      Parameters:
      path - This parameter is required.
    • resolve

      @Stability(Stable) @NotNull public Object resolve(@NotNull IResolveContext _ctx)
      Produce the Token's value at resolution time.

      Specified by:
      resolve in interface IResolvable
      Parameters:
      _ctx - This parameter is required.
    • toJSON

      @Stability(Stable) @NotNull public String toJSON()
      Convert the path to the field in the event pattern to JSON.
    • toString

      @Stability(Stable) @NotNull public String toString()
      Return a string representation of this resolvable object.

      Returns a reversible string representation.

      Specified by:
      toString in interface IResolvable
      Overrides:
      toString in class Object
    • getAccount

      @Stability(Stable) @NotNull public static String getAccount()
      Extract the account from the event.
    • getDetailType

      @Stability(Stable) @NotNull public static String getDetailType()
      Extract the detail type from the event.
    • getEventId

      @Stability(Stable) @NotNull public static String getEventId()
      Extract the event ID from the event.
    • getRegion

      @Stability(Stable) @NotNull public static String getRegion()
      Extract the region from the event.
    • getSource

      @Stability(Stable) @NotNull public static String getSource()
      Extract the source from the event.
    • getTime

      @Stability(Stable) @NotNull public static String getTime()
      Extract the time from the event.
    • getCreationStack

      @Stability(Stable) @NotNull public List<String> getCreationStack()
      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.

      Specified by:
      getCreationStack in interface IResolvable
    • getDisplayHint

      @Stability(Stable) @NotNull public String getDisplayHint()
      Human readable display hint about the event pattern.
    • getPath

      @Stability(Stable) @NotNull public String getPath()
      the path to a field in the event pattern.