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/27 14:36:09 UTC

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

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


##########
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:
   Added tests for ASSUME_ROLE case.



-- 
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