> **Experimental**
>
> `@aws-cdk/aws-kinesisanalytics-flink-alpha` is an [**experimental**](https://docs.aws.amazon.com/cdk/api/stability.html) (alpha) package: its API may change in any release, without a major version bump.
# ApplicationCode

Code configuration providing the location to a Flink application JAR file.

Obtainable from: ApplicationCode.fromAsset, ApplicationCode.fromBucket

- Stability: [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)
- Source: [`lib/application-code.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-kinesisanalytics-flink-alpha/lib/application-code.ts#L26)

## Example

TypeScript:

```ts
declare const bucket: s3.Bucket;
const flinkApp = new flink.Application(this, 'Application', {
  propertyGroups: {
    FlinkApplicationProperties: {
      inputStreamName: 'my-input-kinesis-stream',
      outputStreamName: 'my-output-kinesis-stream',
    },
  },
  // ...
  runtime: flink.Runtime.FLINK_2_2,
  code: flink.ApplicationCode.fromBucket(bucket, 'my-app.jar'),
});
```

Python:

```python
# bucket: s3.Bucket

flink_app = flink.Application(self, "Application",
    property_groups={
        "FlinkApplicationProperties": {
            "input_stream_name": "my-input-kinesis-stream",
            "output_stream_name": "my-output-kinesis-stream"
        }
    },
    # ...
    runtime=flink.Runtime.FLINK_2_2,
    code=flink.ApplicationCode.from_bucket(bucket, "my-app.jar")
)
```

Java:

```java
Bucket bucket;

Application flinkApp = Application.Builder.create(this, "Application")
        .propertyGroups(Map.of(
                "FlinkApplicationProperties", Map.of(
                        "inputStreamName", "my-input-kinesis-stream",
                        "outputStreamName", "my-output-kinesis-stream")))
        // ...
        .runtime(Runtime.FLINK_2_2)
        .code(ApplicationCode.fromBucket(bucket, "my-app.jar"))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.KinesisAnalyticsFlink.Alpha
Bucket bucket;

var flinkApp = new Application(this, "Application", new ApplicationProps {
    PropertyGroups = new Dictionary<string, IDictionary<string, string>> {
        { "FlinkApplicationProperties", new Dictionary<string, string> {
            { "inputStreamName", "my-input-kinesis-stream" },
            { "outputStreamName", "my-output-kinesis-stream" }
        } }
    },
    // ...
    Runtime = Runtime.FLINK_2_2,
    Code = ApplicationCode.FromBucket(bucket, "my-app.jar")
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdkkinesisanalyticsflinkalpha/v2
var bucket Bucket

flinkApp := flink.NewApplication(this, jsii.String("Application"), &ApplicationProps{
	PropertyGroups: map[string]map[string]*string{
		"FlinkApplicationProperties": map[string]*string{
			"inputStreamName": jsii.String("my-input-kinesis-stream"),
			"outputStreamName": jsii.String("my-output-kinesis-stream"),
		},
	},
	// ...
	Runtime: flink.Runtime_FLINK_2_2(),
	Code: flink.ApplicationCode_FromBucket(bucket, jsii.String("my-app.jar")),
})
```

## Initializer

TypeScript:

```ts
new ApplicationCode()
```

Python:

```python
ApplicationCode()
```

Java:

```java
new ApplicationCode()
```

C# / .NET:

```csharp
new ApplicationCode()
```

Golang:

```go
NewApplicationCode()
```

## Methods

- `bind(scope: Construct): ApplicationCodeConfig` — A method to lazily bind asset resources to the parent FlinkApplication.

- `fromAsset(path: string, options?: AssetOptions): ApplicationCode // chainable` (static) — Reference code from a local directory containing a Flink JAR file.

  **Parameters**

  - `path` — - a local directory path.

- `fromBucket(bucket: IBucket, fileKey: string, objectVersion?: string): ApplicationCode // chainable` (static) — Reference code from an S3 bucket.

  **Parameters**

  - `bucket` — - an s3 bucket.
  - `fileKey` — - a key pointing to a Flink JAR file.
  - `objectVersion` — - an optional version string for the provided fileKey.
