You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/10/21 13:26:58 UTC

[GitHub] [flink] dannycranmer commented on a diff in pull request #21129: [FLINK-29496] [Connector/Kinesis] Add configuration option for setting STS endpoint for AWS connectors

dannycranmer commented on code in PR #21129:
URL: https://github.com/apache/flink/pull/21129#discussion_r1001784454


##########
flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/util/AWSUtil.java:
##########
@@ -209,6 +200,28 @@ public void refresh() {
         }
     }
 
+    private static AWSSecurityTokenService createStsClient(
+            final Properties configProps, final String configPrefix) {
+        final String region = configProps.getProperty(AWSConfigConstants.AWS_REGION);
+        final AWSSecurityTokenServiceClientBuilder stsClientBuilder =
+                AWSSecurityTokenServiceClientBuilder.standard()
+                        .withCredentials(
+                                getCredentialsProvider(
+                                        configProps,
+                                        AWSConfigConstants.roleCredentialsProvider(configPrefix)));
+
+        if (configProps.containsKey(AWSConfigConstants.AWS_ROLE_STS_ENDPOINT)) {
+            AwsClientBuilder.EndpointConfiguration endpointConfiguration =
+                    new AwsClientBuilder.EndpointConfiguration(
+                            configProps.getProperty(AWSConfigConstants.AWS_ROLE_STS_ENDPOINT), region);
+            stsClientBuilder.withEndpointConfiguration(endpointConfiguration);

Review Comment:
   Can you add a unit test for this code path? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org