Experimental
@aws-cdk/aws-kinesisanalytics-flink-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
Application L2 construct
The L2 construct for Flink Kinesis Data Applications.
Example
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'),
});
# 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")
)
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();
// 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")
});
// 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
new Application(scope: Construct, id: string, props: ApplicationProps)
Application(scope: Construct, id: str, props: ApplicationProps)
new Application(Construct scope, String id, ApplicationProps props)
new Application(Construct scope, string id, ApplicationProps props)
NewApplication(Scope Construct, Id *string, Props ApplicationProps)
Construct Props
applicationNamestringapplication_namestrapplicationNameStringApplicationNamestringApplicationName*string= CloudFormation-generated name#autoScalingEnabledbooleanauto_scaling_enabledboolautoScalingEnabledBooleanAutoScalingEnabledboolAutoScalingEnabled*bool= true#checkpointingEnabledbooleancheckpointing_enabledboolcheckpointingEnabledBooleanCheckpointingEnabledboolCheckpointingEnabled*bool= true#checkpointIntervalDurationcheckpoint_intervalDurationcheckpointIntervalDurationCheckpointIntervalDurationCheckpointIntervalDuration= 1 minute#codeApplicationCodecodeApplicationCodecodeApplicationCodeCodeApplicationCodeCodeApplicationCoderequired#logGroupILogGrouplog_groupILogGrouplogGroupILogGroupLogGroupILogGroupLogGroupILogGroup= CDK's default LogGroup#logLevelLogLevellog_levelLogLevellogLevelLogLevelLogLevelLogLevelLogLevelLogLevel= FlinkLogLevel.INFO#metricsLevelMetricsLevelmetrics_levelMetricsLevelmetricsLevelMetricsLevelMetricsLevelMetricsLevelMetricsLevelMetricsLevel= MetricsLevel.APPLICATION#Use caution with Parallelism level metrics. Parallelism granularity logs metrics for each parallel thread and can quickly become expensive when parallelism is high (e.g. > 64).
minPauseBetweenCheckpointsDurationmin_pause_between_checkpointsDurationminPauseBetweenCheckpointsDurationMinPauseBetweenCheckpointsDurationMinPauseBetweenCheckpointsDuration= 5 seconds#Kinesis Data Analytics can stop the app, increase the parallelism, and start the app again if autoScalingEnabled is true (the default value).
parallelismPerKpunumberparallelism_per_kpuint | floatparallelismPerKpuNumberParallelismPerKpudoubleParallelismPerKpu*float64= 1#propertyGroups{ [key: string]: { [key: string]: string } }property_groupstyping.Mapping[str, typing.Mapping[str, str]]propertyGroupsMap<String, Map<String, String>>PropertyGroupsIDictionary<string, IDictionary<string, string>>PropertyGroups*map[string]*map[string]*string= No property group configuration …#You can use these property groups to pass arbitrary runtime configuration values to your Flink app.
default
Default: No property group configuration provided to the Flink app
removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= RemovalPolicy.DESTROY#Prefer omitting this property and using the default role.
securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup= a new security group is created …#default
Default: a new security group is created for this application.
snapshotsEnabledbooleansnapshots_enabledboolsnapshotsEnabledBooleanSnapshotsEnabledboolSnapshotsEnabled*bool= true#vpcSubnetsSubnetSelectionvpc_subnetsSubnetSelectionvpcSubnetsSubnetSelectionVpcSubnetsSubnetSelectionVpcSubnetsSubnetSelection= SubnetType.PRIVATE_WITH_EGRESS s…#default
Default: SubnetType.PRIVATE_WITH_EGRESS subnets
Properties
applicationArnstringapplication_arnstrapplicationArnStringApplicationArnstringApplicationArn*stringrequired#applicationNamestringapplication_namestrapplicationNameStringApplicationNamestringApplicationName*stringrequired#connectionsConnectionsconnectionsConnectionsconnectionsConnectionsConnectionsConnectionsConnectionsConnectionsrequired#envResourceEnvironmentenvResourceEnvironmentenvResourceEnvironmentEnvResourceEnvironmentEnvResourceEnvironmentrequired#notes
For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.
grantPrincipalIPrincipalgrant_principalIPrincipalgrantPrincipalIPrincipalGrantPrincipalIPrincipalGrantPrincipalIPrincipalrequired#PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#Methods
addToRolePolicy(policyStatement: PolicyStatement): booleandef add_to_role_policy(self, policy_statement: PolicyStatement) -> boolpublic Boolean addToRolePolicy(PolicyStatement policyStatement)public bool AddToRolePolicy(PolicyStatement policyStatement)func AddToRolePolicy(PolicyStatement PolicyStatement) *bool#applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#notes · 1 parameter
When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.
Parameters
strengthstrengthstrengthstrengthStrength— - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#notes
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).
fromApplicationArn(scope: Construct, id: string, applicationArn: string): IApplication@staticmethod def from_application_arn(scope: Construct, id: str, application_arn: str) -> IApplicationpublic static IApplication fromApplicationArn(Construct scope, String id, String applicationArn)public static IApplication FromApplicationArn(Construct scope, string id, string applicationArn)func FromApplicationArn(Scope Construct, Id *string, ApplicationArn *string) IApplicationstatic#fromApplicationAttributes(scope: Construct, id: string, attrs: ApplicationAttributes): IApplication@staticmethod def from_application_attributes(scope: Construct, id: str, attrs: ApplicationAttributes) -> IApplicationpublic static IApplication fromApplicationAttributes(Construct scope, String id, ApplicationAttributes attrs)public static IApplication FromApplicationAttributes(Construct scope, string id, ApplicationAttributes attrs)func FromApplicationAttributes(Scope Construct, Id *string, Attrs ApplicationAttributes) IApplicationstatic#fromApplicationName(scope: Construct, id: string, applicationName: string): IApplication@staticmethod def from_application_name(scope: Construct, id: str, application_name: str) -> IApplicationpublic static IApplication fromApplicationName(Construct scope, String id, String applicationName)public static IApplication FromApplicationName(Construct scope, string id, string applicationName)func FromApplicationName(Scope Construct, Id *string, ApplicationName *string) IApplicationstatic#isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#notes · 1 parameter · returns
Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.
Parameters
xxxxX— Any object.
Returns: true if x is an object created from a class which extends Construct.
isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#metric(metricName: string, props?: MetricOptions): Metricdef metric(self, metric_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions props)public Metric Metric(string metricName, MetricOptions? props = null)func Metric(MetricName *string, Props MetricOptions) Metric#2 parameters
Parameters
metricNamemetric_namemetricNamemetricNameMetricName— The name of the metric.propspropspropspropsProps— Customization properties.
metricBackPressuredTimeMsPerSecond(props?: MetricOptions): Metricdef metric_back_pressured_time_ms_per_second(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricBackPressuredTimeMsPerSecond(MetricOptions props)public Metric MetricBackPressuredTimeMsPerSecond(MetricOptions? props = null)func MetricBackPressuredTimeMsPerSecond(Props MetricOptions) Metric#Units: Milliseconds
Reporting Level: Operator, Task, Parallelism
metricBusyTimePerMsPerSecond(props?: MetricOptions): Metricdef metric_busy_time_per_ms_per_second(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricBusyTimePerMsPerSecond(MetricOptions props)public Metric MetricBusyTimePerMsPerSecond(MetricOptions? props = null)func MetricBusyTimePerMsPerSecond(Props MetricOptions) Metric#Can be NaN, if the value could not be calculated.
Units: Milliseconds
Reporting Level: Operator, Task, Parallelism
metricCpuUtilization(props?: MetricOptions): Metricdef metric_cpu_utilization(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricCpuUtilization(MetricOptions props)public Metric MetricCpuUtilization(MetricOptions? props = null)func MetricCpuUtilization(Props MetricOptions) Metric#For example, if there are five task managers, Kinesis Data Analytics publishes five samples of this metric per reporting interval.
Units: Percentage
Reporting Level: Application
metricCurrentInputWatermark(props?: MetricOptions): Metricdef metric_current_input_watermark(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricCurrentInputWatermark(MetricOptions props)public Metric MetricCurrentInputWatermark(MetricOptions? props = null)func MetricCurrentInputWatermark(Props MetricOptions) Metric#Units: Milliseconds
Reporting Level: Application, Operator, Task, Parallelism
metricCurrentOutputWatermark(props?: MetricOptions): Metricdef metric_current_output_watermark(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricCurrentOutputWatermark(MetricOptions props)public Metric MetricCurrentOutputWatermark(MetricOptions? props = null)func MetricCurrentOutputWatermark(Props MetricOptions) Metric#Units: Milliseconds
Reporting Level: Application, Operator, Task, Parallelism
metricDowntime(props?: MetricOptions): Metricdef metric_downtime(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricDowntime(MetricOptions props)public Metric MetricDowntime(MetricOptions? props = null)func MetricDowntime(Props MetricOptions) Metric#Units: Milliseconds
Reporting Level: Application
metricFullRestarts(props?: MetricOptions): Metricdef metric_full_restarts(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricFullRestarts(MetricOptions props)public Metric MetricFullRestarts(MetricOptions? props = null)func MetricFullRestarts(Props MetricOptions) Metric#This metric does not measure fine-grained restarts.
Units: Count
Reporting Level: Application
metricHeapMemoryUtilization(props?: MetricOptions): Metricdef metric_heap_memory_utilization(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricHeapMemoryUtilization(MetricOptions props)public Metric MetricHeapMemoryUtilization(MetricOptions? props = null)func MetricHeapMemoryUtilization(Props MetricOptions) Metric#For example, if there are five task managers, Kinesis Data Analytics publishes five samples of this metric per reporting interval.
Units: Percentage
Reporting Level: Application
metricIdleTimeMsPerSecond(props?: MetricOptions): Metricdef metric_idle_time_ms_per_second(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricIdleTimeMsPerSecond(MetricOptions props)public Metric MetricIdleTimeMsPerSecond(MetricOptions? props = null)func MetricIdleTimeMsPerSecond(Props MetricOptions) Metric#Idle time excludes back pressured time, so if the task is back pressured it is not idle.
Units: Milliseconds
Reporting Level: Operator, Task, Parallelism
metricKpus(props?: MetricOptions): Metricdef metric_kpus(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricKpus(MetricOptions props)public Metric MetricKpus(MetricOptions? props = null)func MetricKpus(Props MetricOptions) Metric#The average number of KPUs used each hour determines the billing for your application.
Units: Count
Reporting Level: Application
metricLastCheckpointDuration(props?: MetricOptions): Metricdef metric_last_checkpoint_duration(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricLastCheckpointDuration(MetricOptions props)public Metric MetricLastCheckpointDuration(MetricOptions? props = null)func MetricLastCheckpointDuration(Props MetricOptions) Metric#Units: Milliseconds
Reporting Level: Application
metricLastCheckpointSize(props?: MetricOptions): Metricdef metric_last_checkpoint_size(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricLastCheckpointSize(MetricOptions props)public Metric MetricLastCheckpointSize(MetricOptions? props = null)func MetricLastCheckpointSize(Props MetricOptions) Metric#Units: Bytes
Reporting Level: Application
metricManagedMemoryTotal(props?: MetricOptions): Metricdef metric_managed_memory_total(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricManagedMemoryTotal(MetricOptions props)public Metric MetricManagedMemoryTotal(MetricOptions? props = null)func MetricManagedMemoryTotal(Props MetricOptions) Metric#Units: Bytes
Reporting Level: Application, Operator, Task, Parallelism
metricManagedMemoryUsed(props?: MetricOptions): Metricdef metric_managed_memory_used(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricManagedMemoryUsed(MetricOptions props)public Metric MetricManagedMemoryUsed(MetricOptions? props = null)func MetricManagedMemoryUsed(Props MetricOptions) Metric#Units: Bytes
Reporting Level: Application, Operator, Task, Parallelism
metricManagedMemoryUtilization(props?: MetricOptions): Metricdef metric_managed_memory_utilization(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricManagedMemoryUtilization(MetricOptions props)public Metric MetricManagedMemoryUtilization(MetricOptions? props = null)func MetricManagedMemoryUtilization(Props MetricOptions) Metric#Units: Percentage
Reporting Level: Application, Operator, Task, Parallelism
metricNumberOfFailedCheckpoints(props?: MetricOptions): Metricdef metric_number_of_failed_checkpoints(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricNumberOfFailedCheckpoints(MetricOptions props)public Metric MetricNumberOfFailedCheckpoints(MetricOptions? props = null)func MetricNumberOfFailedCheckpoints(Props MetricOptions) Metric#Units: Count
Reporting Level: Application
metricNumLateRecordsDropped(props?: MetricOptions): Metricdef metric_num_late_records_dropped(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricNumLateRecordsDropped(MetricOptions props)public Metric MetricNumLateRecordsDropped(MetricOptions? props = null)func MetricNumLateRecordsDropped(Props MetricOptions) Metric#Units: Count
Reporting Level: Application, Operator, Task, Parallelism
metricNumRecordsIn(props?: MetricOptions): Metricdef metric_num_records_in(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricNumRecordsIn(MetricOptions props)public Metric MetricNumRecordsIn(MetricOptions? props = null)func MetricNumRecordsIn(Props MetricOptions) Metric#Units: Count
Reporting Level: Application, Operator, Task, Parallelism
metricNumRecordsInPerSecond(props?: MetricOptions): Metricdef metric_num_records_in_per_second(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricNumRecordsInPerSecond(MetricOptions props)public Metric MetricNumRecordsInPerSecond(MetricOptions? props = null)func MetricNumRecordsInPerSecond(Props MetricOptions) Metric#Units: Count/Second
Reporting Level: Application, Operator, Task, Parallelism
metricNumRecordsOut(props?: MetricOptions): Metricdef metric_num_records_out(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricNumRecordsOut(MetricOptions props)public Metric MetricNumRecordsOut(MetricOptions? props = null)func MetricNumRecordsOut(Props MetricOptions) Metric#Units: Count
Reporting Level: Application, Operator, Task, Parallelism
metricNumRecordsOutPerSecond(props?: MetricOptions): Metricdef metric_num_records_out_per_second(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricNumRecordsOutPerSecond(MetricOptions props)public Metric MetricNumRecordsOutPerSecond(MetricOptions? props = null)func MetricNumRecordsOutPerSecond(Props MetricOptions) Metric#Units: Count/Second
Reporting Level: Application, Operator, Task, Parallelism
metricOldGenerationGCCount(props?: MetricOptions): Metricdef metric_old_generation_gc_count(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricOldGenerationGCCount(MetricOptions props)public Metric MetricOldGenerationGCCount(MetricOptions? props = null)func MetricOldGenerationGCCount(Props MetricOptions) Metric#Units: Count
Reporting Level: Application
metricOldGenerationGCTime(props?: MetricOptions): Metricdef metric_old_generation_gc_time(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricOldGenerationGCTime(MetricOptions props)public Metric MetricOldGenerationGCTime(MetricOptions? props = null)func MetricOldGenerationGCTime(Props MetricOptions) Metric#Units: Milliseconds
Reporting Level: Application
metricThreadsCount(props?: MetricOptions): Metricdef metric_threads_count(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricThreadsCount(MetricOptions props)public Metric MetricThreadsCount(MetricOptions? props = null)func MetricThreadsCount(Props MetricOptions) Metric#Units: Count
Reporting Level: Application
metricUptime(props?: MetricOptions): Metricdef metric_uptime(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricUptime(MetricOptions props)public Metric MetricUptime(MetricOptions? props = null)func MetricUptime(Props MetricOptions) Metric#Units: Milliseconds
Reporting Level: Application
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.