- Newest
- Most votes
- Most comments
In Amazon Managed Service for Apache Flink, you cannot directly set environment variables or JVM system properties through the console or API in the same way you might with other compute services. The runtime properties feature you mentioned is specifically designed for application configuration and is accessed programmatically through the Flink application code itself, not as system-level environment variables or JVM properties.
Runtime properties in Managed Service for Apache Flink are accessed within your Java application using the KinesisAnalyticsRuntime.getApplicationProperties() method, which returns a Map<String, Properties> object. These are application-level configuration properties used to configure Flink sources, sinks, and other application components without recompilation - they don't translate to environment variables or system properties that would be visible to the AWS SDK.
For your specific use case of setting AWS_JAVA_V1_PRINT_LOCATION or aws.java.v1.printLocation, you would need to modify your application code to programmatically set the system property before the AWS SDK is initialized. You could do this in your application's main method or initialization code by adding:
System.setProperty("aws.java.v1.printLocation", "true");
Alternatively, you could set:
System.setProperty("aws.java.v1.disableDeprecationAnnouncement", "true");
This would need to be done early in your application startup, before any AWS SDK v1.x classes are loaded. Since you'll need to modify and redeploy your application code anyway, this is the appropriate approach for Managed Service for Apache Flink.
Sources
Use runtime properties in Managed Service for Apache Flink - Managed Service for Apache Flink
answered 8 months ago
-
Would you consider migrating to SDK 2.x The proper long-term solution is to ensure your application and all its dependencies use AWS SDK for Java 2.x. AWS provides a migration tool that can help automate this process, refer [1]:
mvn org.openrewrite.maven:rewrite-maven-plugin:6.17.0:run \ -Drewrite.recipeArtifactCoordinates=software.amazon.awssdk:v2-migration:2.34.0 \ -Drewrite.activeRecipes=software.amazon.awssdk.v2migration.AwsSdkJavaV1ToV2 -
Configuration Options Available in MSF
For reference, the configuration options you can control in Managed Service for Apache Flink include, refer [2]:
- Additionally, few more points, FYI:
- Runtime properties: Application-specific parameters accessible via your code
- Flink configuration properties: Limited set of Apache Flink settings (requires support case for most changes), refer [3]
- Parallelism configuration: Application scaling parameters, refer [4]
- Monitoring configuration: CloudWatch logging settings, refer [5]
But remember, none of these provide access to JVM system properties or OS environment variables.
[2] https://docs.aws.amazon.com/managed-flink/latest/apiv2/API_ApplicationConfiguration.html
[3] https://docs.aws.amazon.com/managed-flink/latest/java/reference-flink-settings.title.html
We're already using SDK 2.41.16. Using
mvn clean dependency:treeshows only 2.41.16. So I am wondering where it is finding 1.x, and that is why I am trying to turn on logging.
Relevant content
asked 2 years ago
asked 8 months ago

This does not work. I called this as the very first line in my
main()method, but the version check happens before my code is ever called (which I can tell because I also have logging in my main). Looking at the stacktrace I can that my code is never called and the first thing in the stack isorg.apache.flink.runtime.entrypoint.StandaloneSessionClusterEntrypoint.main