Class Trigger


  • public class Trigger
    extends com.pulumi.resources.CustomResource
    Manages a Glue Trigger resource. ## Example Usage ### Conditional Trigger
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.glue.Trigger;
     import com.pulumi.aws.glue.TriggerArgs;
     import com.pulumi.aws.glue.inputs.TriggerPredicateArgs;
     import com.pulumi.aws.glue.inputs.TriggerPredicateConditionArgs;
     import com.pulumi.aws.glue.inputs.TriggerActionArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new Trigger("example", TriggerArgs.builder()
                 .predicate(TriggerPredicateArgs.builder()
                     .conditions(TriggerPredicateConditionArgs.builder()
                         .jobName(example2.name())
                         .state("SUCCEEDED")
                         .build())
                     .build())
                 .actions(TriggerActionArgs.builder()
                     .jobName(example1.name())
                     .build())
                 .name("example")
                 .type("CONDITIONAL")
                 .build());
     
         }
     }
     
     
    ### On-Demand Trigger
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.glue.Trigger;
     import com.pulumi.aws.glue.TriggerArgs;
     import com.pulumi.aws.glue.inputs.TriggerActionArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new Trigger("example", TriggerArgs.builder()
                 .actions(TriggerActionArgs.builder()
                     .jobName(exampleAwsGlueJob.name())
                     .build())
                 .name("example")
                 .type("ON_DEMAND")
                 .build());
     
         }
     }
     
     
    ### Scheduled Trigger
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.glue.Trigger;
     import com.pulumi.aws.glue.TriggerArgs;
     import com.pulumi.aws.glue.inputs.TriggerActionArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new Trigger("example", TriggerArgs.builder()
                 .actions(TriggerActionArgs.builder()
                     .jobName(exampleAwsGlueJob.name())
                     .build())
                 .name("example")
                 .schedule("cron(15 12 * * ? *)")
                 .type("SCHEDULED")
                 .build());
     
         }
     }
     
     
    ### Conditional Trigger with Crawler Action **Note:** Triggers can have both a crawler action and a crawler condition, just no example provided.
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.glue.Trigger;
     import com.pulumi.aws.glue.TriggerArgs;
     import com.pulumi.aws.glue.inputs.TriggerPredicateArgs;
     import com.pulumi.aws.glue.inputs.TriggerPredicateConditionArgs;
     import com.pulumi.aws.glue.inputs.TriggerActionArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new Trigger("example", TriggerArgs.builder()
                 .predicate(TriggerPredicateArgs.builder()
                     .conditions(TriggerPredicateConditionArgs.builder()
                         .jobName(example2.name())
                         .state("SUCCEEDED")
                         .build())
                     .build())
                 .actions(TriggerActionArgs.builder()
                     .crawlerName(example1.name())
                     .build())
                 .name("example")
                 .type("CONDITIONAL")
                 .build());
     
         }
     }
     
     
    ### Conditional Trigger with Crawler Condition **Note:** Triggers can have both a crawler action and a crawler condition, just no example provided.
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.glue.Trigger;
     import com.pulumi.aws.glue.TriggerArgs;
     import com.pulumi.aws.glue.inputs.TriggerPredicateArgs;
     import com.pulumi.aws.glue.inputs.TriggerPredicateConditionArgs;
     import com.pulumi.aws.glue.inputs.TriggerActionArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new Trigger("example", TriggerArgs.builder()
                 .predicate(TriggerPredicateArgs.builder()
                     .conditions(TriggerPredicateConditionArgs.builder()
                         .crawlerName(example2.name())
                         .crawlState("SUCCEEDED")
                         .build())
                     .build())
                 .actions(TriggerActionArgs.builder()
                     .jobName(example1.name())
                     .build())
                 .name("example")
                 .type("CONDITIONAL")
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import Glue Triggers using `name`. For example: ```sh $ pulumi import aws:glue/trigger:Trigger MyTrigger MyTrigger ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Trigger​(java.lang.String name)  
      Trigger​(java.lang.String name, TriggerArgs args)  
      Trigger​(java.lang.String name, TriggerArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.util.List<TriggerAction>> actions()  
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enabled()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<TriggerEventBatchingCondition>>> eventBatchingConditions()  
      static Trigger get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, TriggerState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.util.Optional<TriggerPredicate>> predicate()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> schedule()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> startOnCreation()  
      com.pulumi.core.Output<java.lang.String> state()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.lang.String> type()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> workflowName()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Trigger

        public Trigger​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Trigger

        public Trigger​(java.lang.String name,
                       TriggerArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Trigger

        public Trigger​(java.lang.String name,
                       TriggerArgs args,
                       @Nullable
                       com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • actions

        public com.pulumi.core.Output<java.util.List<TriggerAction>> actions()
        Returns:
        List of actions initiated by this trigger when it fires. See `actions` below.
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of Glue Trigger
      • description

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
        Returns:
        Description of the new trigger.
      • enabled

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enabled()
        Returns:
        Start the trigger. Defaults to `true`.
      • eventBatchingConditions

        public com.pulumi.core.Output<java.util.Optional<java.util.List<TriggerEventBatchingCondition>>> eventBatchingConditions()
        Returns:
        Batch condition that must be met (specified number of events received or batch time window expired) before EventBridge event trigger fires. See `eventBatchingCondition`.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Name of the trigger.
      • predicate

        public com.pulumi.core.Output<java.util.Optional<TriggerPredicate>> predicate()
        Returns:
        Predicate to specify when the new trigger should fire. Required when trigger type is `CONDITIONAL`. See `predicate` below.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • schedule

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> schedule()
        Returns:
        Cron expression used to specify the schedule. [Time-Based Schedules for Jobs and Crawlers](https://docs.aws.amazon.com/glue/latest/dg/monitor-data-warehouse-schedule.html)
      • startOnCreation

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> startOnCreation()
        Returns:
        Set to true to start `SCHEDULED` and `CONDITIONAL` triggers when created. True is not supported for `ON_DEMAND` triggers.
      • state

        public com.pulumi.core.Output<java.lang.String> state()
        Returns:
        Current state of the trigger.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • type

        public com.pulumi.core.Output<java.lang.String> type()
        Returns:
        Type of trigger. Valid values are `CONDITIONAL`, `EVENT`, `ON_DEMAND`, and `SCHEDULED`.
      • workflowName

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> workflowName()
        Returns:
        Workflow to which the trigger should be associated to. Every workflow graph (DAG) needs a starting trigger (`ON_DEMAND` or `SCHEDULED` type) and can contain multiple additional `CONDITIONAL` triggers.
      • get

        public static Trigger get​(java.lang.String name,
                                  com.pulumi.core.Output<java.lang.String> id,
                                  @Nullable
                                  TriggerState state,
                                  @Nullable
                                  com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.