CfnTrigger
- class aws_cdk.aws_glue.CfnTrigger(scope, id, *, actions, type, description=None, event_batching_condition=None, name=None, predicate=None, schedule=None, start_on_creation=None, tags=None, workflow_name=None)
Bases:
CfnResource
A CloudFormation
AWS::Glue::Trigger
.The
AWS::Glue::Trigger
resource specifies triggers that run AWS Glue jobs. For more information, see Triggering Jobs in AWS Glue and Trigger Structure in the AWS Glue Developer Guide .- CloudformationResource:
AWS::Glue::Trigger
- Link:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-trigger.html
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_glue as glue # arguments_: Any # tags: Any cfn_trigger = glue.CfnTrigger(self, "MyCfnTrigger", actions=[glue.CfnTrigger.ActionProperty( arguments=arguments_, crawler_name="crawlerName", job_name="jobName", notification_property=glue.CfnTrigger.NotificationPropertyProperty( notify_delay_after=123 ), security_configuration="securityConfiguration", timeout=123 )], type="type", # the properties below are optional description="description", event_batching_condition=glue.CfnTrigger.EventBatchingConditionProperty( batch_size=123, # the properties below are optional batch_window=123 ), name="name", predicate=glue.CfnTrigger.PredicateProperty( conditions=[glue.CfnTrigger.ConditionProperty( crawler_name="crawlerName", crawl_state="crawlState", job_name="jobName", logical_operator="logicalOperator", state="state" )], logical="logical" ), schedule="schedule", start_on_creation=False, tags=tags, workflow_name="workflowName" )
Create a new
AWS::Glue::Trigger
.- Parameters:
scope (
Construct
) –scope in which this resource is defined.
id (
str
) –scoped id of the resource.
actions (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ActionProperty
,Dict
[str
,Any
]]]]) – The actions initiated by this trigger.type (
str
) – The type of trigger that this is.description (
Optional
[str
]) – A description of this trigger.event_batching_condition (
Union
[IResolvable
,EventBatchingConditionProperty
,Dict
[str
,Any
],None
]) – Batch condition that must be met (specified number of events received or batch time window expired) before EventBridge event trigger fires.name (
Optional
[str
]) – The name of the trigger.predicate (
Union
[IResolvable
,PredicateProperty
,Dict
[str
,Any
],None
]) – The predicate of this trigger, which defines when it will fire.schedule (
Optional
[str
]) – Acron
expression used to specify the schedule. For more information, see Time-Based Schedules for Jobs and Crawlers in the AWS Glue Developer Guide . For example, to run something every day at 12:15 UTC, specifycron(15 12 * * ? *)
.start_on_creation (
Union
[bool
,IResolvable
,None
]) – Set to true to startSCHEDULED
andCONDITIONAL
triggers when created. True is not supported forON_DEMAND
triggers.tags (
Optional
[Any
]) – The tags to use with this trigger.workflow_name (
Optional
[str
]) – The name of the workflow associated with the trigger.
Methods
- add_deletion_override(path)
Syntactic sugar for
addOverride(path, undefined)
.- Parameters:
path (
str
) – The path of the value to delete.- Return type:
None
- add_depends_on(target)
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Parameters:
target (
CfnResource
)- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
)value (
Any
)
- See:
- Return type:
None
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
with “Properties.” (i.e.Properties.TopicName
).If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.
in the property name, prefix with a\
. In most programming languages you will need to write this as"\\."
because the\
itself will need to be escaped.For example:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
value
argument toaddOverride
will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters:
path (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str
) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters:
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
).- Parameters:
policy (
Optional
[RemovalPolicy
])apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.
- Return type:
None
- get_att(attribute_name)
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g.
resource.arn
), but this can be used for future compatibility in case there is no generated attribute.- Parameters:
attribute_name (
str
) – The name of the attribute.- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
)- See:
- Return type:
Any
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) –tree inspector to collect and process attributes.
- Return type:
None
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::Glue::Trigger'
- actions
The actions initiated by this trigger.
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- description
A description of this trigger.
- event_batching_condition
Batch condition that must be met (specified number of events received or batch time window expired) before EventBridge event trigger fires.
- logical_id
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use
overrideLogicalId(newLogicalId)
.- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- name
The name of the trigger.
- node
The construct tree node associated with this construct.
- predicate
The predicate of this trigger, which defines when it will fire.
- ref
Return a string that will be resolved to a CloudFormation
{ Ref }
for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref })
.
- schedule
A
cron
expression used to specify the schedule.For more information, see Time-Based Schedules for Jobs and Crawlers in the AWS Glue Developer Guide . For example, to run something every day at 12:15 UTC, specify
cron(15 12 * * ? *)
.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- start_on_creation
Set to true to start
SCHEDULED
andCONDITIONAL
triggers when created.True is not supported for
ON_DEMAND
triggers.
- tags
The tags to use with this trigger.
- type
The type of trigger that this is.
- workflow_name
The name of the workflow associated with the trigger.
Static Methods
- classmethod is_cfn_element(x)
Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.- Parameters:
x (
Any
)- Return type:
bool
- Returns:
The construct as a stack element or undefined if it is not a stack element.
- classmethod is_cfn_resource(construct)
Check whether the given construct is a CfnResource.
- Parameters:
construct (
IConstruct
)- Return type:
bool
- classmethod is_construct(x)
Return whether the given object is a Construct.
- Parameters:
x (
Any
)- Return type:
bool
ActionProperty
- class CfnTrigger.ActionProperty(*, arguments=None, crawler_name=None, job_name=None, notification_property=None, security_configuration=None, timeout=None)
Bases:
object
Defines an action to be initiated by a trigger.
- Parameters:
arguments (
Optional
[Any
]) – The job arguments used when this trigger fires. For this job run, they replace the default arguments set in the job definition itself. You can specify arguments here that your own job-execution script consumes, in addition to arguments that AWS Glue itself consumes. For information about how to specify and consume your own job arguments, see Calling AWS Glue APIs in Python in the AWS Glue Developer Guide . For information about the key-value pairs that AWS Glue consumes to set up your job, see the Special Parameters Used by AWS Glue topic in the developer guide.crawler_name (
Optional
[str
]) – The name of the crawler to be used with this action.job_name (
Optional
[str
]) – The name of a job to be executed.notification_property (
Union
[IResolvable
,NotificationPropertyProperty
,Dict
[str
,Any
],None
]) – Specifies configuration properties of a job run notification.security_configuration (
Optional
[str
]) – The name of theSecurityConfiguration
structure to be used with this action.timeout (
Union
[int
,float
,None
]) – TheJobRun
timeout in minutes. This is the maximum time that a job run can consume resources before it is terminated and enters TIMEOUT status. The default is 2,880 minutes (48 hours). This overrides the timeout value set in the parent job.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_glue as glue # arguments_: Any action_property = glue.CfnTrigger.ActionProperty( arguments=arguments_, crawler_name="crawlerName", job_name="jobName", notification_property=glue.CfnTrigger.NotificationPropertyProperty( notify_delay_after=123 ), security_configuration="securityConfiguration", timeout=123 )
Attributes
- arguments
The job arguments used when this trigger fires.
For this job run, they replace the default arguments set in the job definition itself.
You can specify arguments here that your own job-execution script consumes, in addition to arguments that AWS Glue itself consumes.
For information about how to specify and consume your own job arguments, see Calling AWS Glue APIs in Python in the AWS Glue Developer Guide .
For information about the key-value pairs that AWS Glue consumes to set up your job, see the Special Parameters Used by AWS Glue topic in the developer guide.
- crawler_name
The name of the crawler to be used with this action.
- job_name
The name of a job to be executed.
- notification_property
Specifies configuration properties of a job run notification.
- security_configuration
The name of the
SecurityConfiguration
structure to be used with this action.
- timeout
The
JobRun
timeout in minutes.This is the maximum time that a job run can consume resources before it is terminated and enters TIMEOUT status. The default is 2,880 minutes (48 hours). This overrides the timeout value set in the parent job.
ConditionProperty
- class CfnTrigger.ConditionProperty(*, crawler_name=None, crawl_state=None, job_name=None, logical_operator=None, state=None)
Bases:
object
Defines a condition under which a trigger fires.
- Parameters:
crawler_name (
Optional
[str
]) – The name of the crawler to which this condition applies.crawl_state (
Optional
[str
]) – The state of the crawler to which this condition applies.job_name (
Optional
[str
]) – The name of the job whoseJobRuns
this condition applies to, and on which this trigger waits.logical_operator (
Optional
[str
]) – A logical operator.state (
Optional
[str
]) – The condition state. Currently, the values supported areSUCCEEDED
,STOPPED
,TIMEOUT
, andFAILED
.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_glue as glue condition_property = glue.CfnTrigger.ConditionProperty( crawler_name="crawlerName", crawl_state="crawlState", job_name="jobName", logical_operator="logicalOperator", state="state" )
Attributes
- crawl_state
The state of the crawler to which this condition applies.
- crawler_name
The name of the crawler to which this condition applies.
- job_name
The name of the job whose
JobRuns
this condition applies to, and on which this trigger waits.
- logical_operator
A logical operator.
- state
The condition state.
Currently, the values supported are
SUCCEEDED
,STOPPED
,TIMEOUT
, andFAILED
.
EventBatchingConditionProperty
- class CfnTrigger.EventBatchingConditionProperty(*, batch_size, batch_window=None)
Bases:
object
Batch condition that must be met (specified number of events received or batch time window expired) before EventBridge event trigger fires.
- Parameters:
batch_size (
Union
[int
,float
]) – Number of events that must be received from Amazon EventBridge before EventBridge event trigger fires.batch_window (
Union
[int
,float
,None
]) – Window of time in seconds after which EventBridge event trigger fires. Window starts when first event is received.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_glue as glue event_batching_condition_property = glue.CfnTrigger.EventBatchingConditionProperty( batch_size=123, # the properties below are optional batch_window=123 )
Attributes
- batch_size
Number of events that must be received from Amazon EventBridge before EventBridge event trigger fires.
- batch_window
Window of time in seconds after which EventBridge event trigger fires.
Window starts when first event is received.
NotificationPropertyProperty
- class CfnTrigger.NotificationPropertyProperty(*, notify_delay_after=None)
Bases:
object
Specifies configuration properties of a job run notification.
- Parameters:
notify_delay_after (
Union
[int
,float
,None
]) – After a job run starts, the number of minutes to wait before sending a job run delay notification.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_glue as glue notification_property_property = glue.CfnTrigger.NotificationPropertyProperty( notify_delay_after=123 )
Attributes
- notify_delay_after
After a job run starts, the number of minutes to wait before sending a job run delay notification.
PredicateProperty
- class CfnTrigger.PredicateProperty(*, conditions=None, logical=None)
Bases:
object
Defines the predicate of the trigger, which determines when it fires.
- Parameters:
conditions (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ConditionProperty
,Dict
[str
,Any
]]],None
]) – A list of the conditions that determine when the trigger will fire.logical (
Optional
[str
]) – An optional field if only one condition is listed. If multiple conditions are listed, then this field is required.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_glue as glue predicate_property = glue.CfnTrigger.PredicateProperty( conditions=[glue.CfnTrigger.ConditionProperty( crawler_name="crawlerName", crawl_state="crawlState", job_name="jobName", logical_operator="logicalOperator", state="state" )], logical="logical" )
Attributes
- conditions
A list of the conditions that determine when the trigger will fire.
- logical
An optional field if only one condition is listed.
If multiple conditions are listed, then this field is required.