From d27843403d3a8eb7d5151e692efce392dd370abf Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Fri, 20 Dec 2024 17:27:51 +0000 Subject: [PATCH] Allow configuration to be serialized --- .../sdk/io/aws2/kinesis/KinesisTransformRegistrar.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/KinesisTransformRegistrar.java b/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/KinesisTransformRegistrar.java index 42d06e81f66..944aa7d7a20 100644 --- a/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/KinesisTransformRegistrar.java +++ b/sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/KinesisTransformRegistrar.java @@ -61,7 +61,7 @@ private abstract static class CrossLanguageConfiguration { String streamName; String awsAccessKey; String awsSecretKey; - Region region; + String region; @Nullable String serviceEndpoint; public void setStreamName(String streamName) { @@ -77,7 +77,7 @@ public void setAwsSecretKey(String awsSecretKey) { } public void setRegion(String region) { - this.region = Region.of(region); + this.region = region; } public void setServiceEndpoint(@Nullable String serviceEndpoint) { @@ -120,7 +120,7 @@ public PTransform, KinesisIO.Write.Result> buildExternal( .withClientConfiguration( ClientConfiguration.builder() .credentialsProvider(provider) - .region(configuration.region) + .region(Regions.fromName(configuration.region)) .endpoint(endpoint) .build()) .withPartitioner(p -> configuration.partitionKey) @@ -230,7 +230,7 @@ public PTransform> buildExternal( .withClientConfiguration( ClientConfiguration.builder() .credentialsProvider(provider) - .region(configuration.region) + .region(Regions.fromName(configuration.region)) .endpoint(endpoint) .build());