-
Notifications
You must be signed in to change notification settings - Fork 55
Pass token through to credentials in order to pass instance metadata for IAM roles directly #86
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
base: master
Are you sure you want to change the base?
Conversation
Instance metadata for an IAM Role which includes a token requires you to pass that token with your credentials. This update is along with updates to aws.cfc and con/api.cfc will allow you to pass in the token
|
Hi, thanks for the pull request. I see that you want to be able to pass in a session token directly as part of the AWS credentials. That seems reasonable. Can you explain the addition to the |
|
I placed the additional check at the top because it will allow it to trigger only if you manually the token and you will not get down to the other IAMroles check if you pass a aws key and aws secret key it will return the credential on what was the first if statement. Then it will refresh the credentials and then the above mentioned if statement will return the credentials now that you have the proper keys and token. |
|
If you want to use the IAM role credentials via the instance metadata, why pass in credentials at all? I am not sure I understand that part. |
|
It’s mainly because I am calling many different roles and bucket so I use cfhttp to get the metadata then pass that the keys and token through. |
|
The way this is structured now, if a token is passed in to If an IAM role is available in the instance metadata (assuming this is running on an EC2 instance), then the passed in credentials will be overwritten by the If you are getting the credentials from elsewhere (e.g. via cfhttp), then I think you just want to use the credentials you obtained, and not do any of the credential resolution logic. I would think that what you actually need is to change the following: to so that the token you pass in is added to the credentials struct, and then that struct is immediately returned from the |
|
I honestly did not even think to try passing the token into the defaultCredentials from within the resolveCredentials function. I will need to give that a try, it may eliminate the need for that if(len(token)) conditional. |
|
Reckon we can close this. |
No description provided.