UNPKG

@pulumi/aws

Version:

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

194 lines • 7.04 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, Object.assign(Object.assign({}, 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 ? state.actions : undefined; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["eventBatchingConditions"] = state ? state.eventBatchingConditions : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["predicate"] = state ? state.predicate : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["schedule"] = state ? state.schedule : undefined; resourceInputs["startOnCreation"] = state ? state.startOnCreation : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["workflowName"] = state ? state.workflowName : undefined; } else { const args = argsOrState; if ((!args || args.actions === undefined) && !opts.urn) { throw new Error("Missing required property 'actions'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["actions"] = args ? args.actions : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["eventBatchingConditions"] = args ? args.eventBatchingConditions : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["predicate"] = args ? args.predicate : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["schedule"] = args ? args.schedule : undefined; resourceInputs["startOnCreation"] = args ? args.startOnCreation : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["workflowName"] = args ? args.workflowName : undefined; 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