class JobBase
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Glue.Alpha.JobBase |
Go | github.com/aws/aws-cdk-go/awscdkgluealpha/v2#JobBase |
Java | software.amazon.awscdk.services.glue.alpha.JobBase |
Python | aws_cdk.aws_glue_alpha.JobBase |
TypeScript (source) | @aws-cdk/aws-glue-alpha ยป JobBase |
Implements
IConstruct, IDependable, IResource, IEnvironment, IJob, IGrantable
Extends
Resource
Implemented by
Py, Py, Py, Python, Ray, Scala, Scala, Scala
A base class is needed to be able to import existing Jobs into a CDK app to reference as part of a larger stack or construct.
JobBase has the subset of attributes required to identify and reference an existing Glue Job, as well as some CloudWatch metric convenience functions to configure an event-driven flow using the job.
Initializer
new JobBase(scope: Construct, id: string, props?: ResourceProps)
Parameters
- scope
Construct - id
string - props
ResourceProps
Properties
| Name | Type | Description |
|---|---|---|
| env | Resource | The environment this resource belongs to. |
| grant | IPrincipal | The principal to grant permissions to. |
| job | string | The ARN of the job. |
| job | string | The name of the job. |
| node | Node | The tree node. |
| stack | Stack | The stack in which this resource is defined. |
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
grantPrincipal
Type:
IPrincipal
The principal to grant permissions to.
jobArn
Type:
string
The ARN of the job.
jobName
Type:
string
The name of the job.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
Methods
| Name | Description |
|---|---|
| apply | Apply the given removal policy to this resource. |
| metric(metricName, type, props?) | Create a CloudWatch metric. |
| metric | Return a CloudWatch Metric indicating job failure. |
| metric | Return a CloudWatch Metric indicating job success. |
| metric | Return a CloudWatch Metric indicating job timeout. |
| on | Create a CloudWatch Event Rule for this Glue Job when it's in a given state. |
| on | Return a CloudWatch Event Rule matching FAILED state. |
| on | Create a CloudWatch Event Rule matching JobState.SUCCEEDED. |
| on | Return a CloudWatch Event Rule matching TIMEOUT state. |
| to | Returns a string representation of this construct. |
| protected build | Returns the job arn. |
| protected on | Create a CloudWatch Event Rule for the transition into the input jobState. |
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
RemovalPolicy
Apply the given removal policy to this resource.
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).
metric(metricName, type, props?)
public metric(metricName: string, type: MetricType, props?: MetricOptions): Metric
Parameters
- metricName
stringโ name of the metric typically prefixed withglue.driver.,glue.<executorId>.orglue.ALL.. - type
Metricโ the metric type.Type - props
Metricโ metric options.Options
Returns
Create a CloudWatch metric.
metricFailure(props?)
public metricFailure(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Return a CloudWatch Metric indicating job failure.
This metric is based on the Rule returned by no-args onFailure() call.
metricSuccess(props?)
public metricSuccess(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Return a CloudWatch Metric indicating job success.
This metric is based on the Rule returned by no-args onSuccess() call.
metricTimeout(props?)
public metricTimeout(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Return a CloudWatch Metric indicating job timeout.
This metric is based on the Rule returned by no-args onTimeout() call.
onEvent(id, options?)
public onEvent(id: string, options?: OnEventOptions): Rule
Parameters
- id
stringโ construct id. - options
Onโ event options.Event Options
Returns
Create a CloudWatch Event Rule for this Glue Job when it's in a given state.
onFailure(id, options?)
public onFailure(id: string, options?: OnEventOptions): Rule
Parameters
- id
stringโ construct id. - options
Onโ optional event options.Event Options
Returns
Return a CloudWatch Event Rule matching FAILED state.
onSuccess(id, options?)
public onSuccess(id: string, options?: OnEventOptions): Rule
Parameters
- id
stringโ construct id. - options
Onโ optional event options.Event Options
Returns
Create a CloudWatch Event Rule matching JobState.SUCCEEDED.
onTimeout(id, options?)
public onTimeout(id: string, options?: OnEventOptions): Rule
Parameters
- id
stringโ construct id. - options
Onโ optional event options.Event Options
Returns
Return a CloudWatch Event Rule matching TIMEOUT state.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected buildJobArn(scope, jobName)
protected buildJobArn(scope: Construct, jobName: string): string
Parameters
- scope
Construct - jobName
string
Returns
string
Returns the job arn.
protected onStateChange(id, jobState, options?)
protected onStateChange(id: string, jobState: JobState, options?: OnEventOptions): Rule
Parameters
- id
stringโ construct id. - jobState
Jobโ the job state.State - options
Onโ optional event options.Event Options
Returns
Create a CloudWatch Event Rule for the transition into the input jobState.

.NET
Go
Java
Python
TypeScript (