class Code
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Glue.Code |
Java | software.amazon.awscdk.services.glue.Code |
Python | aws_cdk.aws_glue.Code |
TypeScript (source) | @aws-cdk/aws-glue » 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
declare const bucket: s3.Bucket;
new glue.Job(this, 'PythonShellJob', {
executable: glue.JobExecutable.pythonShell({
glueVersion: glue.GlueVersion.V1_0,
pythonVersion: glue.PythonVersion.THREE,
script: glue.Code.fromBucket(bucket, 'script.py'),
}),
description: 'an example Python Shell job',
});
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.
static fromAsset(path, options?)
public static fromAsset(path: string, options?: AssetOptions): AssetCode
Parameters
- path
string— code file (not a directory). - options
AssetOptions
Returns
Job code from a local disk path.
static fromBucket(bucket, key)
public 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.

.NET
Java
Python
TypeScript (