@aws-cdk_aws-glue-alpha.Code
static from
static from
class Code
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Glue.Alpha.Code |
![]() | github.com/aws/aws-cdk-go/awscdkgluealpha/v2#Code |
![]() | software.amazon.awscdk.services.glue.alpha.Code |
![]() | aws_cdk.aws_glue_alpha.Code |
![]() | @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
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
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.