class SparkJob
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Glue.Alpha.SparkJob |
Go | github.com/aws/aws-cdk-go/awscdkgluealpha/v2#SparkJob |
Java | software.amazon.awscdk.services.glue.alpha.SparkJob |
Python | aws_cdk.aws_glue_alpha.SparkJob |
TypeScript (source) | @aws-cdk/aws-glue-alpha » SparkJob |
⚠️ Deprecated: undefined
Implements
IConstruct, IDependable, IResource, IEnvironment, IJob, IGrantable, IJob
Extends
Job
Implemented by
Py, Py, Py, Scala, Scala, Scala
Base class for different types of Spark Jobs.
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 sparkJob = glue_alpha.SparkJob.fromJobAttributes(this, 'MySparkJob', {
jobName: 'jobName',
// the properties below are optional
role: role,
});
Initializer
new SparkJob(scope: Construct, id: string, props: SparkJobProps)
⚠️ Deprecated: undefined
Parameters
- scope
Construct - id
string - props
SparkJob 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. |
| job | Job | A reference to this Job resource, for use with the generated L1 ref interface. |
| 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. |
| spark | Spark | The Spark UI logs location if Spark UI monitoring and debugging is enabled. |
env
⚠️ Deprecated: undefined
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
⚠️ Deprecated: undefined
Type:
IPrincipal
The principal to grant permissions to.
jobArn
⚠️ Deprecated: undefined
Type:
string
The ARN of the job.
jobName
⚠️ Deprecated: undefined
Type:
string
The name of the job.
jobRef
⚠️ Deprecated: undefined
Type:
Job
A reference to this Job resource, for use with the generated L1 ref interface.
node
⚠️ Deprecated: undefined
Type:
Node
The tree node.
role
⚠️ Deprecated: undefined
Type:
IRole
The IAM role Glue assumes to run this job.
stack
⚠️ Deprecated: undefined
Type:
Stack
The stack in which this resource is defined.
sparkUILoggingLocation?
⚠️ Deprecated: undefined
Type:
Spark
(optional)
The Spark UI logs location if Spark UI monitoring and debugging is enabled.
Methods
| Name | Description |
|---|---|
| apply | Override the cross-stack reference strength for this resource. |
| 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. |
| with(...mixins) | Applies one or more mixins to this construct. |
| protected non | Register the arguments this construct manages for a Spark job. |
| protected setup | Register the arguments for extra {@link Code}-related properties. |
applyCrossStackReferenceStrength(strength)
public applyCrossStackReferenceStrength(strength: ReferenceStrength): void
⚠️ Deprecated: undefined
Parameters
- strength
Reference— - The reference strength to use for this resource.Strength
Override the cross-stack reference strength for this resource.
When set, any cross-stack reference to this resource will use the specified
mechanism instead of the global default determined by the
@aws-cdk/core:defaultCrossStackReferences context key. This is useful for
selectively weakening specific references to avoid the "deadly embrace" problem
without changing the app-wide default.
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
⚠️ Deprecated: undefined
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
⚠️ Deprecated: undefined
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
⚠️ Deprecated: undefined
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
⚠️ Deprecated: undefined
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
⚠️ Deprecated: undefined
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
⚠️ Deprecated: undefined
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
⚠️ Deprecated: undefined
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
⚠️ Deprecated: undefined
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
⚠️ Deprecated: undefined
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
⚠️ Deprecated: undefined
Returns
string
Returns a string representation of this construct.
with(...mixins)
public with(...mixins: IMixin[]): IConstruct
⚠️ Deprecated: undefined
Parameters
- mixins
IMixin
Returns
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
protected nonExecutableCommonArguments(props)
protected nonExecutableCommonArguments(props: SparkJobProps): void
⚠️ Deprecated: undefined
Parameters
- props
SparkJob Props
Register the arguments this construct manages for a Spark job.
These are owned by the construct
(derived from typed props). Each key is declared via {@link setManagedArgument} whether or not
the current configuration emits a value, so a disabled feature (e.g. enableMetrics: false)
cannot be silently re-enabled through defaultArguments.
protected setupExtraCodeArguments(props)
protected setupExtraCodeArguments(props: SparkExtraCodeProps): void
⚠️ Deprecated: undefined
Parameters
- props
SparkExtra Code Props
Register the arguments for extra {@link Code}-related properties.

.NET
Go
Java
Python
TypeScript (