UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

194 lines 6.49 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Trigger = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a Glue Trigger resource. * * ## Example Usage * * ### Conditional Trigger * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.Trigger("example", { * name: "example", * type: "CONDITIONAL", * actions: [{ * jobName: example1.name, * }], * predicate: { * conditions: [{ * jobName: example2.name, * state: "SUCCEEDED", * }], * }, * }); * ``` * * ### On-Demand Trigger * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.Trigger("example", { * name: "example", * type: "ON_DEMAND", * actions: [{ * jobName: exampleAwsGlueJob.name, * }], * }); * ``` * * ### Scheduled Trigger * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.Trigger("example", { * name: "example", * schedule: "cron(15 12 * * ? *)", * type: "SCHEDULED", * actions: [{ * jobName: exampleAwsGlueJob.name, * }], * }); * ``` * * ### Conditional Trigger with Crawler Action * * **Note:** Triggers can have both a crawler action and a crawler condition, just no example provided. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.Trigger("example", { * name: "example", * type: "CONDITIONAL", * actions: [{ * crawlerName: example1.name, * }], * predicate: { * conditions: [{ * jobName: example2.name, * state: "SUCCEEDED", * }], * }, * }); * ``` * * ### Conditional Trigger with Crawler Condition * * **Note:** Triggers can have both a crawler action and a crawler condition, just no example provided. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.glue.Trigger("example", { * name: "example", * type: "CONDITIONAL", * actions: [{ * jobName: example1.name, * }], * predicate: { * conditions: [{ * crawlerName: example2.name, * crawlState: "SUCCEEDED", * }], * }, * }); * ``` * * ## Import * * Using `pulumi import`, import Glue Triggers using `name`. For example: * * ```sh * $ pulumi import aws:glue/trigger:Trigger MyTrigger MyTrigger * ``` */ class Trigger extends pulumi.CustomResource { /** * Get an existing Trigger resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new Trigger(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Trigger. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Trigger.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["actions"] = state?.actions; resourceInputs["arn"] = state?.arn; resourceInputs["description"] = state?.description; resourceInputs["enabled"] = state?.enabled; resourceInputs["eventBatchingConditions"] = state?.eventBatchingConditions; resourceInputs["name"] = state?.name; resourceInputs["predicate"] = state?.predicate; resourceInputs["region"] = state?.region; resourceInputs["schedule"] = state?.schedule; resourceInputs["startOnCreation"] = state?.startOnCreation; resourceInputs["state"] = state?.state; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["type"] = state?.type; resourceInputs["workflowName"] = state?.workflowName; } else { const args = argsOrState; if (args?.actions === undefined && !opts.urn) { throw new Error("Missing required property 'actions'"); } if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["actions"] = args?.actions; resourceInputs["description"] = args?.description; resourceInputs["enabled"] = args?.enabled; resourceInputs["eventBatchingConditions"] = args?.eventBatchingConditions; resourceInputs["name"] = args?.name; resourceInputs["predicate"] = args?.predicate; resourceInputs["region"] = args?.region; resourceInputs["schedule"] = args?.schedule; resourceInputs["startOnCreation"] = args?.startOnCreation; resourceInputs["tags"] = args?.tags; resourceInputs["type"] = args?.type; resourceInputs["workflowName"] = args?.workflowName; resourceInputs["arn"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Trigger.__pulumiType, name, resourceInputs, opts); } } exports.Trigger = Trigger; /** @internal */ Trigger.__pulumiType = 'aws:glue/trigger:Trigger'; //# sourceMappingURL=trigger.js.map