简体   繁体   中英

How to Configure using STSAssumeRoleSessionCredentialsProvider in spring-cloud-stream-binder-kinesis

I am using spring-cloud-stream-binder-kinesis, version: 2.0.2.RELEASE.

I was able to successfully use binder and access it locally using the default ContextCredentialsAutoConfiguration mentioned in the KinesisBinderConfiguration.

Now I know this set-up wont work for me because, The Kinesis data stream is in AWS account 1 The Service is running in AWS account 2 (I have already done the setup of assumed Role so that Account 2 can access streams in account 1 using the assumed role)

However I am not sure how can I override the credentials in binder to use STSAssumeRoleSessionCredentialsProvider

Can someone help please?

The KinesisBinderConfiguration is fully based on the auto-configuration from the Spring Cloud AWS, which provides for us a ContextCredentialsAutoConfiguration and expose an AWSCredentialsProvider bean under the credentialsProvider name if not present yet.

So, probably you just need to have your STSAssumeRoleSessionCredentialsProvider as a bean in your configuration class and give it that credentialsProvider bean name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM