@aws-cdk_aws-glue-alpha.Code

class Code ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Glue.Alpha.Code
Gogithub.com/aws/aws-cdk-go/awscdkgluealpha/v2#Code
Javasoftware.amazon.awscdk.services.glue.alpha.Code
Pythonaws_cdk.aws_glue_alpha.Code
TypeScript (source)@aws-cdk/aws-glue-alpha ยป Code

Implemented by AssetCode, S3Code

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, 'ScalaSparkEtlJob', {
  executable: glue.JobExecutable.scalaEtl({
    glueVersion: glue.GlueVersion.V4_0,
    script: glue.Code.fromBucket(bucket, 'src/com/example/HelloWorld.scala'),
    className: 'com.example.HelloWorld',
    extraJars: [glue.Code.fromBucket(bucket, 'jars/HelloWorld.jar')],
  }),
  workerType: glue.WorkerType.G_8X,
  description: 'an example Scala ETL job',
});

Initializer

new Code()

Methods

NameDescription
bind(scope, grantable)๐Ÿ”นCalled when the Job is initialized to allow this object to bind.
static fromAsset(path, options?)๐Ÿ”นJob code from a local disk path.
static fromBucket(bucket, key)๐Ÿ”นJob code as an S3 object.

bind(scope, grantable)๐Ÿ”น

public bind(scope: Construct, grantable: IGrantable): CodeConfig

Parameters

  • scope Construct
  • grantable IGrantable

Returns

  • CodeConfig

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

  • AssetCode

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

  • S3Code

Job code as an S3 object.