If I have an EC2 instance running with an IAM role attached to the instance profile that gives the instance permission to hit a certain API, I would want the temporary credentials generated by the instance be used to sign my API request. How can I do that with the sign() method? If I don't provide credentials to the function, I see "it can get credentials from process.env.AWS_ACCESS_KEY_ID, etc." However, is there any way to get the temporary credentials from the instance?
If I have an EC2 instance running with an IAM role attached to the instance profile that gives the instance permission to hit a certain API, I would want the temporary credentials generated by the instance be used to sign my API request. How can I do that with the
sign()
method? If I don't providecredentials
to the function, I see "it can get credentials from process.env.AWS_ACCESS_KEY_ID, etc." However, is there any way to get the temporary credentials from the instance?