aws-sdk-java icon indicating copy to clipboard operation
aws-sdk-java copied to clipboard

Support credential_source for use with IAM roles

Open TBonnin opened this issue 6 years ago • 6 comments

It appears the java sdk doesn't support using credential_source to specify credentials from an EC2 instance role. Am I missing something? If it is not supported yet, is there any plan to add support to the java sdk soon? Thank you very much

https://docs.aws.amazon.com/cli/latest/topic/config-vars.html#using-aws-iam-roles

TBonnin avatar Mar 26 '18 16:03 TBonnin

I don't believe we support this currently. Marking as a feature request.

dagnir avatar Mar 26 '18 16:03 dagnir

Just ran into this too, would be nice if it was added

carlosrodf avatar Dec 12 '18 01:12 carlosrodf

@dagnir Is there something I can do to make this feature happen?

rce avatar Mar 25 '19 07:03 rce

Thank you for raising this issue, and it looks like a great candidate for a community PR, which we’ll help merge in and support.

varunnvs92 avatar Mar 25 '19 22:03 varunnvs92

Supported in 2.5.30 https://github.com/aws/aws-sdk-java-v2/issues/1169

revbingo avatar Oct 03 '19 18:10 revbingo

Here is a way to make it work. It requires patching the AWS Java SDK but for folks who really need this like I did it wasn't to hard to verify this method with Redshift JDBC Driver and assumeRole.

[default]
credential_source=Ec2InstanceMetadata
region=us-east-1
output=json

[redshift_iam]
role_arn=arn:aws:iam::xxxxxxxxxxxx:role/xxxx-data-dev-idmc-poc
region=us-east-1
source_profile=default
output=json

Attached is the patch.... fixes-assumerole-with-profile-file.patch

gss2002 avatar Oct 18 '23 12:10 gss2002

We don't have plans to support this in v1 before going into Maintenance Mode, so I'll go ahead and close.

credential_source is supported in Java SDK v2, the recommendation is to migrate to v2. If you have any issue or feedback please open a new issue in the v2 repo.

Reference:

  • Announcing end-of-support for AWS SDK for Java v1.x effective December 31, 2025 - blog post

debora-ito avatar Jul 16 '24 23:07 debora-ito

This issue is now closed.

Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.

github-actions[bot] avatar Jul 16 '24 23:07 github-actions[bot]