Skip to content

AWS.KinesisAnalyticsV2 reference

Source: src/AWS/KinesisAnalyticsV2/Application.ts

A Managed Service for Apache Flink (Kinesis Data Analytics v2) application.

Application owns the application definition — runtime environment, code location in S3, runtime properties, Flink settings, optional VPC connectivity and tags — and converges each aspect in place via UpdateApplication. Unless you supply serviceExecutionRole, an IAM role is auto-created granting the service read access to the code bucket and CloudWatch Logs delivery.

The application is created in READY and does not run (or bill KPUs) until started. Set start: true to have the reconciler start the job and wait for RUNNING — this requires the code object to be a real Flink application jar.

Flink application from S3 code

import * as AWS from "alchemy/AWS";
const bucket = yield* AWS.S3.Bucket("FlinkCode");
const app = yield* AWS.KinesisAnalyticsV2.Application("Enrichment", {
runtimeEnvironment: "FLINK-1_20",
code: {
bucketArn: bucket.bucketArn,
fileKey: "jobs/enrichment-1.0.jar",
},
});

Runtime properties and parallelism

const app = yield* AWS.KinesisAnalyticsV2.Application("Enrichment", {
runtimeEnvironment: "FLINK-1_20",
code: { bucketArn: bucket.bucketArn, fileKey: "jobs/enrichment-1.0.jar" },
environmentProperties: [
{
propertyGroupId: "EnrichmentProperties",
propertyMap: { "input.stream": "clickstream", "region": "us-west-2" },
},
],
flinkConfiguration: {
parallelismConfiguration: {
configurationType: "CUSTOM",
parallelism: 2,
parallelismPerKPU: 1,
autoScalingEnabled: false,
},
},
snapshotsEnabled: true,
});
const app = yield* AWS.KinesisAnalyticsV2.Application("Enrichment", {
runtimeEnvironment: "FLINK-1_20",
code: { bucketArn: bucket.bucketArn, fileKey: "jobs/enrichment-1.0.jar" },
vpc: {
subnetIds: [subnetA.subnetId, subnetB.subnetId],
securityGroupIds: [sg.securityGroupId],
},
});
const app = yield* AWS.KinesisAnalyticsV2.Application("Enrichment", {
runtimeEnvironment: "FLINK-1_20",
code: { bucketArn: bucket.bucketArn, fileKey: "jobs/enrichment-1.0.jar" },
maintenanceWindowStartTime: "02:00",
});
const app = yield* AWS.KinesisAnalyticsV2.Application("Enrichment", {
runtimeEnvironment: "FLINK-1_20",
code: { bucketArn: bucket.bucketArn, fileKey: "jobs/enrichment-1.0.jar" },
start: true,
});

Source: src/AWS/KinesisAnalyticsV2/ApplicationCloudWatchLoggingOption.ts

Attaches an Amazon CloudWatch Logs log stream to a Managed Service for Apache Flink application so application messages (errors, job lifecycle events) are delivered to CloudWatch.

The option is identified by the log stream it delivers to — changing either the application or the log stream replaces the option. The application’s service execution role must be allowed to call logs:PutLogEvents / logs:DescribeLogStreams (the role auto-created by Application already is).

ApplicationCloudWatchLoggingOption: Attaching Logging

Section titled “ApplicationCloudWatchLoggingOption: Attaching Logging”
import * as AWS from "alchemy/AWS";
const logGroup = yield* AWS.Logs.LogGroup("FlinkLogs");
const logStream = yield* AWS.Logs.LogStream("FlinkLogStream", {
logGroupName: logGroup.logGroupName,
});
const logging = yield* AWS.KinesisAnalyticsV2.ApplicationCloudWatchLoggingOption(
"AppLogging",
{
applicationName: app.applicationName,
logStreamArn: logStream.logStreamArn.as<string>(),
},
);

Source: src/AWS/KinesisAnalyticsV2/ApplicationSnapshot.ts

A snapshot (Flink savepoint) of a running Managed Service for Apache Flink application’s state.

Snapshots are immutable — every prop change replaces the snapshot. The source application must be RUNNING with snapshotsEnabled: true when the snapshot is created.

import * as AWS from "alchemy/AWS";
const app = yield* AWS.KinesisAnalyticsV2.Application("Enrichment", {
runtimeEnvironment: "FLINK-1_20",
code: { bucketArn: bucket.bucketArn, fileKey: "jobs/enrichment-1.0.jar" },
snapshotsEnabled: true,
start: true,
});
const snapshot = yield* AWS.KinesisAnalyticsV2.ApplicationSnapshot(
"Checkpoint",
{ applicationName: app.applicationName },
);

Source: src/AWS/KinesisAnalyticsV2/CreateApplicationPresignedUrl.ts

Runtime binding for kinesisanalytics:CreateApplicationPresignedUrl — mints a short-lived URL to the bound application’s extension (the Flink dashboard, or the Zeppelin UI of a Studio notebook), e.g. to hand an operator a dashboard link from an internal tool. The URL must be used within 3 minutes; the session it opens lives for SessionExpirationDurationInSeconds (default 12 hours).

CreateApplicationPresignedUrl: Operating the Application

Section titled “CreateApplicationPresignedUrl: Operating the Application”
const createPresignedUrl = yield* AWS.KinesisAnalyticsV2.CreateApplicationPresignedUrl(app);
const { AuthorizedUrl } = yield* createPresignedUrl({
UrlType: "FLINK_DASHBOARD_URL",
SessionExpirationDurationInSeconds: 1800,
});

Source: src/AWS/KinesisAnalyticsV2/CreateApplicationSnapshot.ts

Runtime binding for kinesisanalytics:CreateApplicationSnapshot — takes a snapshot (Flink savepoint) of the bound application’s state on demand, e.g. a scheduled backup ahead of a deploy. The application must be RUNNING with snapshots enabled; poll the result with DescribeApplicationSnapshot.

CreateApplicationSnapshot: Managing Snapshots

Section titled “CreateApplicationSnapshot: Managing Snapshots”
const createSnapshot = yield* AWS.KinesisAnalyticsV2.CreateApplicationSnapshot(app);
yield* createSnapshot({ SnapshotName: "pre-deploy" });

Source: src/AWS/KinesisAnalyticsV2/DeleteApplicationSnapshot.ts

Runtime binding for kinesisanalytics:DeleteApplicationSnapshot — deletes a snapshot of the bound application, e.g. pruning old savepoints on a retention schedule. The SnapshotCreationTimestamp acts as a compare-and-set token; read it fresh with DescribeApplicationSnapshot or ListApplicationSnapshots.

DeleteApplicationSnapshot: Managing Snapshots

Section titled “DeleteApplicationSnapshot: Managing Snapshots”
const describeSnapshot = yield* AWS.KinesisAnalyticsV2.DescribeApplicationSnapshot(app);
const deleteSnapshot = yield* AWS.KinesisAnalyticsV2.DeleteApplicationSnapshot(app);
const { SnapshotDetails } = yield* describeSnapshot({ SnapshotName: "old" });
yield* deleteSnapshot({
SnapshotName: "old",
SnapshotCreationTimestamp: SnapshotDetails.SnapshotCreationTimestamp!,
});

Source: src/AWS/KinesisAnalyticsV2/DescribeApplication.ts

Runtime binding for kinesisanalytics:DescribeApplication — reads the bound application’s full detail (status, version, runtime environment, configuration), the building block of ops automation that reacts to the Flink job’s lifecycle state.

DescribeApplication: Observing the Application

Section titled “DescribeApplication: Observing the Application”
const describeApplication = yield* AWS.KinesisAnalyticsV2.DescribeApplication(app);
const { ApplicationDetail } = yield* describeApplication();
const running = ApplicationDetail.ApplicationStatus === "RUNNING";

Source: src/AWS/KinesisAnalyticsV2/DescribeApplicationOperation.ts

Runtime binding for kinesisanalytics:DescribeApplicationOperation — reads the status of an async operation on the bound application (the OperationId returned by start/stop/rollback/update), e.g. to poll a start to completion.

DescribeApplicationOperation: Operating the Application

Section titled “DescribeApplicationOperation: Operating the Application”
const describeOperation = yield* AWS.KinesisAnalyticsV2.DescribeApplicationOperation(app);
const { ApplicationOperationInfoDetails } = yield* describeOperation({
OperationId: operationId,
});

Source: src/AWS/KinesisAnalyticsV2/DescribeApplicationSnapshot.ts

Runtime binding for kinesisanalytics:DescribeApplicationSnapshot — reads a snapshot’s status (CREATINGREADY / FAILED), e.g. to poll a savepoint taken with CreateApplicationSnapshot to completion.

DescribeApplicationSnapshot: Managing Snapshots

Section titled “DescribeApplicationSnapshot: Managing Snapshots”
const describeSnapshot = yield* AWS.KinesisAnalyticsV2.DescribeApplicationSnapshot(app);
const { SnapshotDetails } = yield* describeSnapshot({
SnapshotName: "pre-deploy",
});

Source: src/AWS/KinesisAnalyticsV2/DescribeApplicationVersion.ts

Runtime binding for kinesisanalytics:DescribeApplicationVersion — reads the configuration of a specific version of the bound application, e.g. to inspect what a rollback target looked like.

DescribeApplicationVersion: Observing the Application

Section titled “DescribeApplicationVersion: Observing the Application”
const describeVersion = yield* AWS.KinesisAnalyticsV2.DescribeApplicationVersion(app);
const { ApplicationVersionDetail } = yield* describeVersion({
ApplicationVersionId: 3,
});

Source: src/AWS/KinesisAnalyticsV2/ListApplicationOperations.ts

Runtime binding for kinesisanalytics:ListApplicationOperations — pages through the bound application’s async operation history (starts, stops, updates, rollbacks and their outcomes).

ListApplicationOperations: Operating the Application

Section titled “ListApplicationOperations: Operating the Application”
const listOperations = yield* AWS.KinesisAnalyticsV2.ListApplicationOperations(app);
const { ApplicationOperationInfoList } = yield* listOperations({
OperationStatus: "FAILED",
});

Source: src/AWS/KinesisAnalyticsV2/ListApplications.ts

Runtime binding for kinesisanalytics:ListApplications.

An account-level operation (no application argument) that pages through the account’s Managed Service for Apache Flink applications — name, ARN, and status for each. Useful for fleet dashboards and governance sweeps that audit which applications exist and whether they are RUNNING. Provide the implementation with Effect.provide(AWS.KinesisAnalyticsV2.ListApplicationsHttp).

ListApplications: Inspecting the Application

Section titled “ListApplications: Inspecting the Application”
// init — account-level binding takes no resource
const listApplications = yield* AWS.KinesisAnalyticsV2.ListApplications();
// runtime
const { ApplicationSummaries } = yield* listApplications({ Limit: 50 });
const running = (ApplicationSummaries ?? []).filter(
(app) => app.ApplicationStatus === "RUNNING",
);

Source: src/AWS/KinesisAnalyticsV2/ListApplicationSnapshots.ts

Runtime binding for kinesisanalytics:ListApplicationSnapshots — pages through the bound application’s snapshots, e.g. to find the newest savepoint or prune old ones with DeleteApplicationSnapshot.

ListApplicationSnapshots: Managing Snapshots

Section titled “ListApplicationSnapshots: Managing Snapshots”
const listSnapshots = yield* AWS.KinesisAnalyticsV2.ListApplicationSnapshots(app);
const { SnapshotSummaries } = yield* listSnapshots({ Limit: 50 });

Source: src/AWS/KinesisAnalyticsV2/ListApplicationVersions.ts

Runtime binding for kinesisanalytics:ListApplicationVersions — pages through the bound application’s version history (every configuration update creates a version), e.g. to pick a rollback target.

ListApplicationVersions: Observing the Application

Section titled “ListApplicationVersions: Observing the Application”
const listVersions = yield* AWS.KinesisAnalyticsV2.ListApplicationVersions(app);
const { ApplicationVersionSummaries } = yield* listVersions({ Limit: 10 });

Source: src/AWS/KinesisAnalyticsV2/RollbackApplication.ts

Runtime binding for kinesisanalytics:RollbackApplication — reverts the bound application to its previous running version (with the state from the latest snapshot when available), e.g. an automated bad-deploy remediation. The CurrentApplicationVersionId acts as a compare-and-set token; read it fresh with DescribeApplication.

RollbackApplication: Operating the Application

Section titled “RollbackApplication: Operating the Application”
const describeApplication = yield* AWS.KinesisAnalyticsV2.DescribeApplication(app);
const rollbackApplication = yield* AWS.KinesisAnalyticsV2.RollbackApplication(app);
const { ApplicationDetail } = yield* describeApplication();
yield* rollbackApplication({
CurrentApplicationVersionId: ApplicationDetail.ApplicationVersionId,
});

Source: src/AWS/KinesisAnalyticsV2/StartApplication.ts

Runtime binding for kinesisanalytics:StartApplication — starts the bound Flink application, optionally restoring from a snapshot via RunConfiguration. The returned OperationId can be polled with DescribeApplicationOperation.

StartApplication: Operating the Application

Section titled “StartApplication: Operating the Application”
const startApplication = yield* AWS.KinesisAnalyticsV2.StartApplication(app);
const { OperationId } = yield* startApplication({
RunConfiguration: {
ApplicationRestoreConfiguration: {
ApplicationRestoreType: "RESTORE_FROM_LATEST_SNAPSHOT",
},
},
});

Source: src/AWS/KinesisAnalyticsV2/StopApplication.ts

Runtime binding for kinesisanalytics:StopApplication — stops the bound Flink application. By default the job is stopped gracefully (taking a snapshot when snapshots are enabled); Force: true skips the snapshot.

StopApplication: Operating the Application

Section titled “StopApplication: Operating the Application”
const stopApplication = yield* AWS.KinesisAnalyticsV2.StopApplication(app);
const { OperationId } = yield* stopApplication({ Force: true });