class Code
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Glue.Alpha.Code |
Go | github.com/aws/aws-cdk-go/awscdkgluealpha/v2#Code |
Java | software.amazon.awscdk.services.glue.alpha.Code |
Python | aws_cdk.aws_glue_alpha.Code |
TypeScript (source) | @aws-cdk/aws-glue-alpha ยป Code |
Implemented by
Asset
, S3
Represents a Glue Job's Code assets (an asset can be a scripts, a jar, a python file or any other file).
Example
new glue.Job(this, 'EnableSparkUI', {
jobName: 'EtlJobWithSparkUIPrefix',
sparkUI: {
enabled: true,
},
executable: glue.JobExecutable.pythonEtl({
glueVersion: glue.GlueVersion.V3_0,
pythonVersion: glue.PythonVersion.THREE,
script: glue.Code.fromAsset(path.join(__dirname, 'job-script', 'hello_world.py')),
}),
});
Initializer
new Code()
Methods
Name | Description |
---|---|
bind(scope, grantable) | Called when the Job is initialized to allow this object to bind. |
static from | Job code from a local disk path. |
static from | Job code as an S3 object. |
bind(scope, grantable)
public bind(scope: Construct, grantable: IGrantable): CodeConfig
Parameters
- scope
Construct
- grantable
IGrantable
Returns
Called when the Job is initialized to allow this object to bind.
Asset(path, options?)
static frompublic static fromAsset(path: string, options?: AssetOptions): AssetCode
Parameters
- path
string
โ code file (not a directory). - options
Asset
Options
Returns
Job code from a local disk path.
Bucket(bucket, key)
static frompublic static fromBucket(bucket: IBucket, key: string): S3Code
Parameters
- bucket
IBucket
โ The S3 bucket. - key
string
โ The object key.
Returns
Job code as an S3 object.