class Job
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Glue.Alpha.Job |
![]() | github.com/aws/aws-cdk-go/awscdkgluealpha/v2#Job |
![]() | software.amazon.awscdk.services.glue.alpha.Job |
![]() | aws_cdk.aws_glue_alpha.Job |
![]() | @aws-cdk/aws-glue-alpha ยป Job |
Implements
IConstruct
, IDependable
, IResource
, IJob
, IGrantable
Extends
Job
Implemented by
Py
, Py
, Py
, Python
, Ray
, Scala
, Scala
, Scala
A Glue Job.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as glue_alpha from '@aws-cdk/aws-glue-alpha';
import { aws_iam as iam } from 'aws-cdk-lib';
declare const role: iam.Role;
const job = glue_alpha.Job.fromJobAttributes(this, 'MyJob', {
jobName: 'jobName',
// the properties below are optional
role: role,
});
Initializer
new Job(scope: Construct, id: string, props?: ResourceProps)
Parameters
- scope
Construct
- id
string
- props
Resource
Props
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. |
role | IRole | The IAM role Glue assumes to run this job. |
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 by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that 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.
role
Type:
IRole
The IAM role Glue assumes to run this job.
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. |
setup | Setup Continuous Loggiung Properties. |
to | Returns a string representation of this construct. |
protected check | Check no usage of reserved arguments. |
protected code | |
static from | Identifies an existing Glue Job from a subset of attributes that can be referenced from within another Stack or Construct. |
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
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
Metric
Options
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
Metric
Options
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
Metric
Options
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.
setupContinuousLogging(role, props?)
public setupContinuousLogging(role: IRole, props?: ContinuousLoggingProps): any
Parameters
- role
IRole
โ The IAM role to use for continuous logging. - props
Continuous
โ The properties for continuous logging configuration.Logging Props
Returns
any
Setup Continuous Loggiung Properties.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected checkNoReservedArgs(defaultArguments?)
protected checkNoReservedArgs(defaultArguments?: { [string]: string }): { [string]: string }
Parameters
- defaultArguments
{ [string]: string }
Returns
{ [string]: string }
Check no usage of reserved arguments.
protected codeS3ObjectUrl(code)
protected codeS3ObjectUrl(code: Code): string
Parameters
- code
Code
Returns
string
static fromJobAttributes(scope, id, attrs)
public static fromJobAttributes(scope: Construct, id: string, attrs: JobImportAttributes): IJob
Parameters
- scope
Construct
โ The scope creating construct (usuallythis
). - id
string
โ The construct's id. - attrs
Job
โ Attributes for the Glue Job we want to import.Import Attributes
Returns
Identifies an existing Glue Job from a subset of attributes that can be referenced from within another Stack or Construct.