# S3Code

Glue job Code from an S3 bucket.

Extends: Code › S3Code

- Source: [`aws-glue/lib/code.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-glue/lib/code.ts#L40)
- Type last changed: v2.270.0 · 17 Sep 2026

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_glue as glue } from 'aws-cdk-lib';
import { aws_s3 as s3 } from 'aws-cdk-lib';

declare const bucket: s3.Bucket;
const s3Code = new glue.S3Code(bucket, 'key');
```

## Initializer

```ts
new S3Code(bucket: IBucket, key: string)
```

## Methods

- `bind(_scope: Construct, grantable: IGrantable): CodeConfig` — Called when the Job is initialized to allow this object to bind.

- `fromAsset(path: string, options?: AssetOptions): AssetCode` (static) — Job code from a local disk path.

  **Parameters**

  - `path` — code file (not a directory).

- `fromBucket(bucket: IBucket, key: string): S3Code // chainable` (static) — Job code as an S3 object.

  **Parameters**

  - `bucket` — The S3 bucket.
  - `key` — The object key.
