Action Class
An action initiated by a trigger.
An action runs exactly one target: use {@link Action.job} to run a job or {@link Action.crawler} to run a crawler. Because these are separate factory methods, an action can never target both or neither.
Example
ts
import * as cdk from 'aws-cdk-lib';
import * as iam from 'aws-cdk-lib/aws-iam';
declare const stack: cdk.Stack;
declare const role: iam.IRole;
declare const script: glue.Code;
// Create a job to run from the workflow
const job = new glue.PySparkEtlJob(stack, 'Job', { role, script });
// Create a workflow and add a trigger that runs the job
const workflow = new glue.Workflow(stack, 'Workflow');
workflow.addOnDemandTrigger('OnDemandTrigger', {
actions: [glue.Action.job(job)],
});
Initializer
ts
new Action()
python
Action()
java
new Action()
csharp
new Action()
go
NewAction()
Methods
crawler(crawler: ICrawlerRef, options?: CrawlerActionOptions): Action // chainable@staticmethod def crawler(crawler: ICrawlerRef, options: typing.Optional[CrawlerActionOptions] = None) -> Actionpublic static Action crawler(ICrawlerRef crawler, CrawlerActionOptions options)public static Action Crawler(ICrawlerRef crawler, CrawlerActionOptions? options = null)func Crawler(Crawler ICrawlerRef, Options CrawlerActionOptions) Actionstatic#Create an action that runs a crawler.
2 parameters
Parameters
crawlercrawlercrawlercrawlerCrawler— the crawler to run when the trigger fires.optionsoptionsoptionsoptionsOptions— additional options for the action.
job(job: IJobRef, options?: JobActionOptions): Action // chainable@staticmethod def job(job: IJobRef, options: typing.Optional[JobActionOptions] = None) -> Actionpublic static Action job(IJobRef job, JobActionOptions options)public static Action Job(IJobRef job, JobActionOptions? options = null)func Job(Job IJobRef, Options JobActionOptions) Actionstatic#Create an action that runs a job.
2 parameters
Parameters
jobjobjobjobJob— the job to run when the trigger fires.optionsoptionsoptionsoptionsOptions— additional options for the action.