Experimental
@aws-cdk/aws-kinesisanalytics-flink-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
ApplicationCode Class
Code configuration providing the location to a Flink application JAR file.
| Stability | Experimental |
|---|---|
| Source | lib/application-code.ts |
Example
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
# 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
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();
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")
});
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
ts
new ApplicationCode()
python
ApplicationCode()
java
new ApplicationCode()
csharp
new ApplicationCode()
go
NewApplicationCode()
Methods
bind(scope: Construct): ApplicationCodeConfigdef bind(self, scope: Construct) -> ApplicationCodeConfigpublic ApplicationCodeConfig bind(Construct scope)public ApplicationCodeConfig Bind(Construct scope)func Bind(Scope Construct) ApplicationCodeConfig #A method to lazily bind asset resources to the parent FlinkApplication.
fromAsset(path: string, options?: AssetOptions): ApplicationCode // chainable@staticmethod def from_asset(path: str, options: typing.Optional[AssetOptions] = None) -> ApplicationCodepublic static ApplicationCode fromAsset(String path, AssetOptions options)public static ApplicationCode FromAsset(string path, AssetOptions? options = null)func FromAsset(Path *string, Options AssetOptions) ApplicationCode static #Reference code from a local directory containing a Flink JAR file.
1 parameter
Parameters
pathpathpathpathPath— - a local directory path.
fromBucket(bucket: IBucket, fileKey: string, objectVersion?: string): ApplicationCode // chainable@staticmethod def from_bucket(bucket: IBucket, file_key: str, object_version: typing.Optional[str] = None) -> ApplicationCodepublic static ApplicationCode fromBucket(IBucket bucket, String fileKey, String objectVersion)public static ApplicationCode FromBucket(IBucket bucket, string fileKey, string? objectVersion = null)func FromBucket(Bucket IBucket, FileKey *string, ObjectVersion *string) ApplicationCode static #Reference code from an S3 bucket.
3 parameters
Parameters
bucketbucketbucketbucketBucket— - an s3 bucket.fileKeyfile_keyfileKeyfileKeyFileKey— - a key pointing to a Flink JAR file.objectVersionobject_versionobjectVersionobjectVersionObjectVersion— - an optional version string for the provided fileKey.