awslabs / awslabs/amazon-kinesis-client-python
Support STSAssumeRoleWithWebIdentitySessionCredentialsProvider?
- Dominant language
- Python
- Stars
- 377
- Forks
- 228
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
Python 3.7.8, amazon-kclpy verion 2.0.6
Use case is a Kinesis consumer running in EKS, with a service account IAM role providing a web identity token to the pod. The consumer pod needs to assume a role in a different AWS account.
I attempted to use `STSAssumeRoleWithWebIdentitySessionCredentialsProvider` in my properties file as such:
```
AWSCredentialsProvider = STSAssumeRoleWithWebIdentitySessionCredentialsProvider|arn:aws-us-gov:iam::123456789:role/my_role|my_session|/var/run/secrets/eks.amazonaws.com/serviceaccount/token
```
I could not find any docs indicating if this work or if it is supported. Guessed the arguments by looking at the Java SDK source code.
It fails with this exceptions and stack trace:
```
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at software.amazon.kinesis.multilang.config.KinesisClientLibConfigurator.lambda$getConfiguration$0(KinesisClientLibConfigurator.java:67)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at java.base/java.util.Collections$SynchronizedCollection.forEach(Collections.java:2067)
at software.amazon.kinesis.multilang.config.KinesisClientLibConfigurator.getConfiguration(KinesisClientLibConfigurator.java:63)
at software.amazon.kinesis.multilang.MultiLangDaemonConfig.(MultiLangDaemonConfig.java:108)
at software.amazon.kinesis.multilang.MultiLangDaemonConfig.(MultiLangDaemonConfig.java:81)
at software.amazon.kinesis.multilang.MultiLangDaemonConfig.(MultiLangDaemonConfig.java:65)
at software.amazon.kinesis.multilang.MultiLangDaemon.buildMultiLangDaemonConfig(MultiLangDaemon.java:171)
at software.amazon.kinesis.multilang.MultiLangDaemon.main(MultiLangDaemon.java:220)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:2128)
at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:2109)
at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1915)
at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:2022)
at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1018)
at software.amazon.kinesis.multilang.config.KinesisClientLibConfigurator.lambda$getConfiguration$0(KinesisClientLibConfigurator.java:65)
... 8 more
Caused by: java.lang.IllegalArgumentException: No credential providers specified
at com.amazonaws.auth.AWSCredentialsProviderChain.(AWSCredentialsProviderChain.java:59)
at software.amazon.kinesis.multilang.config.AWSCredentialsProviderPropertyValueDecoder.decodeValue(AWSCredentialsProviderPropertyValueDecoder.java:57)
at software.amazon.kinesis.multilang.config.MultiLangDaemonConfiguration.lambda$new$0(MultiLangDaemonConfiguration.java:249)
at software.amazon.kinesis.multilang.config.BuilderDynaBean.set(BuilderDynaBean.java:258)
at software.amazon.kinesis.multilang.config.MultiLangDaemonConfiguration.setAWSCredentialsProvider(MultiLangDaemonConfiguration.java:176)
... 18 more
java.lang.reflect.InvocationTargetException
```
Is it supported? If so how do I properly configure it?
Contributor guide
Assessment
This issue has not been assessed yet.