[
https://issues.apache.org/jira/browse/FLINK-4222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15380570#comment-15380570
]
ASF GitHub Bot commented on FLINK-4222:
---------------------------------------
Github user tzulitai commented on a diff in the pull request:
https://github.com/apache/flink/pull/2260#discussion_r71062232
--- Diff:
flink-streaming-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/util/AWSUtil.java
---
@@ -50,8 +50,14 @@ public static AmazonKinesisClient
createKinesisClient(Properties configProps) {
awsClientConfig.setUserAgent("Apache Flink " +
EnvironmentInformation.getVersion() +
" (" +
EnvironmentInformation.getRevisionInformation().commitId + ") Kinesis
Connector");
- AmazonKinesisClient client =
- new
AmazonKinesisClient(AWSUtil.getCredentialsProvider(configProps).getCredentials(),
awsClientConfig);
+ AWSCredentialsProvider credentialsProvider =
AWSUtil.getCredentialsProvider(configProps);
+
+ if (credentialsProvider != null) {
+ AmazonKinesisClient client =
+ new
AmazonKinesisClient(credentialsProvider.getCredentials(), awsClientConfig);
+ } else {
+ AmazonKinesisClient client = new
AmazonKinesisClient(awsClientConfig);
+ }
--- End diff --
The `client` variable still needs to be declared outside the if/else
clause, because `client` will be used below.
> Allow Kinesis configuration to get credentials from AWS Metadata
> ----------------------------------------------------------------
>
> Key: FLINK-4222
> URL: https://issues.apache.org/jira/browse/FLINK-4222
> Project: Flink
> Issue Type: Improvement
> Components: Streaming Connectors
> Affects Versions: 1.0.3
> Reporter: Nick Chadwick
> Priority: Minor
> Labels: easyfix
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> When deploying Flink TaskManagers in an EC2 environment, it would be nice to
> be able to use the EC2 IAM Role credentials provided by the EC2 Metadata
> service.
> This allows for credentials to be automatically discovered by services
> running on EC2 instances at runtime, and removes the need to explicitly
> create and assign credentials to TaskManagers.
> This should be a fairly small change to the configuration of the
> flink-connector-kinesis, which will greatly improve the ease of deployment to
> Amazon EC2
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)