英文:
How to Configure using STSAssumeRoleSessionCredentialsProvider in spring-cloud-stream-binder-kinesis
问题
以下是翻译好的部分:
我正在使用 spring-cloud-stream-binder-kinesis,版本:2.0.2.RELEASE。
我已经成功地使用了 binder,并且可以在本地访问它,使用了 KinesisBinderConfiguration 中提到的默认 ContextCredentialsAutoConfiguration。
现在我知道这个设置对我来说行不通,因为:
Kinesis 数据流位于 AWS 帐户1中
服务正在 AWS 帐户2中运行
(我已经完成了假定角色的设置,以便帐户2可以使用假定角色访问帐户1中的流)
但是我不确定如何覆盖 binder 中的凭证,以使用 STSAssumeRoleSessionCredentialsProvider。
有人可以帮忙吗?
英文:
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?
答案1
得分: 0
KinesisBinderConfiguration
完全基于Spring Cloud AWS中的自动配置,为我们提供了ContextCredentialsAutoConfiguration
,并在尚未存在的情况下公开了名为credentialsProvider
的AWSCredentialsProvider
bean。
因此,您可能只需要在配置类中将您的STSAssumeRoleSessionCredentialsProvider
配置为一个bean,并将其指定为credentialsProvider
bean的名称。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论