Connect to Timestream from IKS(EC2) with AssumeRole #2786
Replies: 2 comments 3 replies
-
return TimestreamWriteClient.builder() private static AwsCredentialsProvider getAwsCredentialsProvider(Map<String, String> idpsSecrets) {
} public static String[] assumeGivenRole(StsClient stsClient, String roleArn, String roleSessionName, Map<String, String> idpsSecrets) {
|
Beta Was this translation helpful? Give feedback.
-
It looks like you're trying to start an EC2 instance then make it call If you're starting an EC2 instance, you can shortcut that and have EC2 start the instance with that role already. Information on this is available in the EC2 documentation: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html For information on using EKS with IAM roles and permissions, see the documentation: https://docs.aws.amazon.com/eks/latest/userguide/security-iam.html |
Beta Was this translation helpful? Give feedback.
-
We are currently trying to use the AWS SDK to get a TimestreamWriteClient to write some entries into timestream from our java app.
We were connecting using IAM secret access key and access key, but we want to move away from this and use IAM Role
I have tried using this example to do so: https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/javav2/example_code/sts/src/main/java/com/example/sts/AssumeRole.java
However I receive this error when I deploy: Profile file contained no credentials for profile 'default': ProfileFile(profiles=[])
In our services home directory I have added the .aws/credentials file, but we still receive this error.
Not sure if there is another solution to connect to TimestreamWriteClient with IAMRole, or if I am missing something in our current approach. Any help is appreciated, thank you.
Beta Was this translation helpful? Give feedback.
All reactions