# S3Code

Glue job Code from an S3 bucket.

Extends: Code › S3Code

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

## Example

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

declare const bucket: s3.Bucket;
const s3Code = new glue_alpha.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.
