1 Answer
- Newest
- Most votes
- Most comments
0
Hi, yes, I believe that you are on the right track: you must assume the EC2 execution role if you want your call to success.
If you look at https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-iam.html , it says
If you run your Node.js application on an Amazon EC2 instance, you can leverage IAM roles for Amazon EC2 to automatically
provide credentials to the instance. If you configure your instance to use IAM roles, the SDK automatically selects the IAM
credentials for your application, eliminating the need to manually provide credentials.
Then section "Global configuration Examples" of https://pinecone-forest.com/aws-guide-v0.0.65/Configuring-the-SDK-for-JavaScript.html will detail how to set those credentials
Relevant content
- asked 5 months ago
- asked 3 years ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
@Didier the role is already assumed and as I mentioned in my question I successfully retrieve parameters using the CLI on ec2. That means that the ec2 successfully assumes the correct role. The problem is with the node app not being able to assume the ec2 role. AFA global configuration, I don't think it's a good idea as the main purpose of associating a role to ec2 is eliminating the need for explicitly adding credentials in the app when making a call to aws services.