Action

class aws_cdk.aws_glue.Action

Bases: object

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.

ExampleMetadata:

infused

Example:

import aws_cdk as cdk
import aws_cdk.aws_iam as iam
# stack: cdk.Stack
# role: iam.IRole
# script: glue.Code


# Create a job to run from the workflow
job = glue.PySparkEtlJob(stack, "Job", role=role, script=script)

# Create a workflow and add a trigger that runs the job
workflow = glue.Workflow(stack, "Workflow")
workflow.add_on_demand_trigger("OnDemandTrigger",
    actions=[glue.Action.job(job)]
)

Static Methods

classmethod crawler(crawler, *, arguments=None, security_configuration=None, timeout=None)

Create an action that runs a crawler.

Parameters:
  • crawler (ICrawlerRef) – the crawler to run when the trigger fires.

  • arguments (Optional[Mapping[str, str]]) – The arguments used when this trigger fires. Default: - no arguments are passed to the job

  • security_configuration (Optional[ISecurityConfiguration]) – The SecurityConfiguration to be used with this action. Default: - no security configuration is used

  • timeout (Optional[Duration]) – The run timeout. This is the maximum time that a run can consume resources before it is terminated and enters TIMEOUT status. Default: - the default timeout value set in the job definition

Return type:

Action

classmethod job(job, *, arguments=None, security_configuration=None, timeout=None)

Create an action that runs a job.

Parameters:
  • job (IJobRef) – the job to run when the trigger fires.

  • arguments (Optional[Mapping[str, str]]) – The arguments used when this trigger fires. Default: - no arguments are passed to the job

  • security_configuration (Optional[ISecurityConfiguration]) – The SecurityConfiguration to be used with this action. Default: - no security configuration is used

  • timeout (Optional[Duration]) – The run timeout. This is the maximum time that a run can consume resources before it is terminated and enters TIMEOUT status. Default: - the default timeout value set in the job definition

Return type:

Action