- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateTriggerCommand
Creates a new trigger.
Job arguments may be logged. Do not pass plaintext secrets as arguments. Retrieve secrets from a Glue Connection, Amazon Web Services Secrets Manager or other secret management mechanism if you intend to keep them within the Job.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { GlueClient, CreateTriggerCommand } from "@aws-sdk/client-glue"; // ES Modules import
// const { GlueClient, CreateTriggerCommand } = require("@aws-sdk/client-glue"); // CommonJS import
const client = new GlueClient(config);
const input = { // CreateTriggerRequest
Name: "STRING_VALUE", // required
WorkflowName: "STRING_VALUE",
Type: "SCHEDULED" || "CONDITIONAL" || "ON_DEMAND" || "EVENT", // required
Schedule: "STRING_VALUE",
Predicate: { // Predicate
Logical: "AND" || "ANY",
Conditions: [ // ConditionList
{ // Condition
LogicalOperator: "EQUALS",
JobName: "STRING_VALUE",
State: "STARTING" || "RUNNING" || "STOPPING" || "STOPPED" || "SUCCEEDED" || "FAILED" || "TIMEOUT" || "ERROR" || "WAITING" || "EXPIRED",
CrawlerName: "STRING_VALUE",
CrawlState: "RUNNING" || "CANCELLING" || "CANCELLED" || "SUCCEEDED" || "FAILED" || "ERROR",
},
],
},
Actions: [ // ActionList // required
{ // Action
JobName: "STRING_VALUE",
Arguments: { // GenericMap
"<keys>": "STRING_VALUE",
},
Timeout: Number("int"),
SecurityConfiguration: "STRING_VALUE",
NotificationProperty: { // NotificationProperty
NotifyDelayAfter: Number("int"),
},
CrawlerName: "STRING_VALUE",
},
],
Description: "STRING_VALUE",
StartOnCreation: true || false,
Tags: { // TagsMap
"<keys>": "STRING_VALUE",
},
EventBatchingCondition: { // EventBatchingCondition
BatchSize: Number("int"), // required
BatchWindow: Number("int"),
},
};
const command = new CreateTriggerCommand(input);
const response = await client.send(command);
// { // CreateTriggerResponse
// Name: "STRING_VALUE",
// };
CreateTriggerCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Actions Required | Action[] | undefined | The actions initiated by this trigger when it fires. |
Name Required | string | undefined | The name of the trigger. |
Type Required | TriggerType | undefined | The type of the new trigger. |
Description | string | undefined | A description of the new trigger. |
EventBatchingCondition | EventBatchingCondition | undefined | Batch condition that must be met (specified number of events received or batch time window expired) before EventBridge event trigger fires. |
Predicate | Predicate | undefined | A predicate to specify when the new trigger should fire. This field is required when the trigger type is |
Schedule | string | undefined | A This field is required when the trigger type is SCHEDULED. |
StartOnCreation | boolean | undefined | Set to |
Tags | Record<string, string> | undefined | The tags to use with this trigger. You may use tags to limit access to the trigger. For more information about tags in Glue, see Amazon Web Services Tags in Glue in the developer guide. |
WorkflowName | string | undefined | The name of the workflow associated with the trigger. |
CreateTriggerCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Name | string | undefined | The name of the trigger. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AlreadyExistsException | client | A resource to be created or added already exists. |
ConcurrentModificationException | client | Two processes are trying to modify a resource simultaneously. |
EntityNotFoundException | client | A specified entity does not exist |
IdempotentParameterMismatchException | client | The same unique identifier was associated with two different records. |
InternalServiceException | server | An internal service error occurred. |
InvalidInputException | client | The input provided was not valid. |
OperationTimeoutException | client | The operation timed out. |
ResourceNumberLimitExceededException | client | A resource numerical limit was exceeded. |
GlueServiceException | Base exception class for all service exceptions from Glue service. |