Class TriggerFunction

All Implemented Interfaces:
IConstruct, IDependable, IResource, IClientVpnConnectionHandler, IConnectable, IGrantable, IFunction, ITrigger, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:41.471Z") @Stability(Stable) public class TriggerFunction extends Function implements ITrigger
Invokes an AWS Lambda function during deployment.

Example:

 import software.amazon.awscdk.services.lambda.*;
 import software.amazon.awscdk.triggers.*;
 import software.amazon.awscdk.core.Stack;
 Stack stack;
 TriggerFunction.Builder.create(stack, "MyTrigger")
         .runtime(Runtime.NODEJS_14_X)
         .handler("index.handler")
         .code(Code.fromAsset(__dirname + "/my-trigger"))
         .build();
 
  • Constructor Details

    • TriggerFunction

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

      protected TriggerFunction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • TriggerFunction

      @Stability(Stable) public TriggerFunction(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull TriggerFunctionProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • executeAfter

      @Stability(Stable) public void executeAfter(@NotNull @NotNull software.constructs.Construct... scopes)
      Adds trigger dependencies.

      Execute this trigger only after these construct scopes have been provisioned.

      Specified by:
      executeAfter in interface ITrigger
      Parameters:
      scopes - This parameter is required.
    • executeBefore

      @Stability(Stable) public void executeBefore(@NotNull @NotNull software.constructs.Construct... scopes)
      Adds this trigger as a dependency on other constructs.

      This means that this trigger will get executed before the given construct(s).

      Specified by:
      executeBefore in interface ITrigger
      Parameters:
      scopes - This parameter is required.
    • getTrigger

      @Stability(Stable) @NotNull public Trigger getTrigger()
      The underlying trigger resource.