class ApplicationCode
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Kinesisanalytics.Flink.Alpha.ApplicationCode |
Go | github.com/aws/aws-cdk-go/awscdkkinesisanalyticsflinkalpha/v2#ApplicationCode |
Java | software.amazon.awscdk.services.kinesisanalytics.flink.alpha.ApplicationCode |
Python | aws_cdk.aws_kinesisanalytics_flink_alpha.ApplicationCode |
TypeScript (source) | @aws-cdk/aws-kinesisanalytics-flink-alpha ยป ApplicationCode |
Code configuration providing the location to a Flink application JAR file.
Example
import * as path from 'path';
import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';
import * as core from 'aws-cdk-lib';
import * as flink from '../lib';
const app = new core.App();
const stack = new core.Stack(app, 'FlinkAppTest');
const flinkApp = new flink.Application(stack, 'App', {
code: flink.ApplicationCode.fromAsset(path.join(__dirname, 'code-asset')),
runtime: flink.Runtime.FLINK_1_18,
});
new cloudwatch.Alarm(stack, 'Alarm', {
metric: flinkApp.metricFullRestarts(),
evaluationPeriods: 1,
threshold: 3,
});
///! hide
app.synth();
Initializer
new ApplicationCode()
Methods
Name | Description |
---|---|
bind(scope) | A method to lazily bind asset resources to the parent FlinkApplication. |
static from | Reference code from a local directory containing a Flink JAR file. |
static from | Reference code from an S3 bucket. |
bind(scope)
public bind(scope: Construct): ApplicationCodeConfig
Parameters
- scope
Construct
Returns
A method to lazily bind asset resources to the parent FlinkApplication.
Asset(path, options?)
static frompublic static fromAsset(path: string, options?: AssetOptions): ApplicationCode
Parameters
- path
string
โ - a local directory path. - options
Asset
Options
Returns
Reference code from a local directory containing a Flink JAR file.
Bucket(bucket, fileKey, objectVersion?)
static frompublic static fromBucket(bucket: IBucket, fileKey: string, objectVersion?: string): ApplicationCode
Parameters
- bucket
IBucket
โ - an s3 bucket. - fileKey
string
โ - a key pointing to a Flink JAR file. - objectVersion
string
โ - an optional version string for the provided fileKey.
Returns
Reference code from an S3 bucket.