-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EKS Pod Identity does not work with aws-sdk v2 #4566
Comments
Hi @k4kratik - thanks for reaching out. I'm not able to reproduce this on my end. Upon further investigating, it's mentioned in the docs that:
Can you confirm if that's the case or not? The error you're seeing generally indicates that credentials aren't being able to locate from either Config or Credential file. I would also confirm if the default profile is being used in your ~/.aws/credentials. Lastly, I would make sure temporary credentials aren't expired const AWS = require('aws-sdk');
AWS.config.update({region: 'REGION'});
const sqs = new AWS.SQS({
apiVersion: '2012-11-05',
credentials: creds
});
console.log(sqs.config.credentials) // log check the credentials
sqs.listQueues({}, function(err, data) {
if (err) {
console.log("Error", err);
} else {
console.log("Success", data.QueueUrls);
}
}); If the issue persists, I would try different SDK that supports assuming an IAM role from the EKS Pod Identity Agent from this list to narrow down the root cause. Hope that helps, |
Hi @aBurmeseDev!
I am glad that you tried on your end to reproduce. Can you specify how was your setup ? In my case it was -
@aBurmeseDev can you please try to reproduce under above mentioned circumstances? Thanks! |
@aBurmeseDev The issue persists, and I our team will need some time for migration plan from v2 to v3 and Currently we want v2 to support Pod Identity Associations as we have a lot of microservices running with aws-sdk v2. I have also raised a PR here : #4565 would you like to have a look and give me some feedback if it makes sense? and If aws-sdk v2 supports this new feature, why there is no mention of variable if you this check changelog, they have added support to manage/create pod identity associations but I could not see anywhere where they have mentioned on how to use IAM access from this feature Thanks! |
@aBurmeseDev - theres a similar issue in the v3 SDK with a fix going in, can we add the same here? |
I don't think this credential provider was implemented in AWS SDK for JavaScript (v2) (this repo). But, credential providers are modular and can be mixed, as a workaround: Docs: https://www.npmjs.com/package/@aws-sdk/credential-providers import { fromHttp } from '@aws-sdk/credential-providers';
import * as AWS from 'aws-sdk';
const credentialProvider = fromHttp({ ... }); // use code or environment variables.
const credentials = await credentialProvider();
const client = new AWS.S3({ credentials }); |
@kuhe per the release notes on v2.1503.0, it reads that Pod Identity was added but its currently not working as expected c1ef7c7#diff-31729d20ef2ae5d600178d896e07b595d5635238aac19ec9d1f74c6bbbd48bc5R73-R76 |
#4565 closes this. |
Describe the bug
AWS Recently rollout out a new feature for EKS to authorize pods IAM access more seamlessly, it can be considered as the successor of IRSA (IAM Role for Service Account).
So even after following the steps mentioned in the docs, My pod is not able to get any IAM access. I am sure I am using the latest SDK version as mentioned here and also I setup my role and service account as mentioned here.
When I dug, found that code in the aws-sdk to utilize this new feature is missing. (ref)
Expected Behavior
This should work seamlessly and all IAM access should be authorized as expected.
Current Behavior
My pod is not able to get any IAM Access. I get error :
Reproduction Steps
Setup Consists : EKS Cluster enabled pod identity add-on enabled + Setup Role and Service Account + Configure Pod to use this Service Account. [In case if it matters, we have set http_put_response_hop_limit to 1 , default is 2]
Now create a simple script and run :
aws.js
Output:
Possible Solution
I also raised a PR here: https://github.com/aws/aws-sdk-js/pull/4565/files
Additional Information/Context
No response
SDK version used
v2.1518.0
Environment details (OS name and version, etc.)
Amazon Linux 2
The text was updated successfully, but these errors were encountered: