-
Notifications
You must be signed in to change notification settings - Fork 84
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
AWS Powershell commands fail with AssumeRole error #169
Comments
Hi @rpatrick00, Good afternoon. At first glance this appears to be an IAM policy issue. Could you please try using -ProfileName argument to see if it works. For example, Get-EC2Instance -ProfileName ode-gov-engineer Also try checking the information provided at Troubleshooting IAM Assume Role Errors and see if setting up the Trust policy helps. Thanks, |
Will do. If it wasn’t clear, please note that the same credentials/profile works fine with the AWS CLI on the same machine/user so I am somewhat skeptical this has anything to do with the policy. |
Hi @ashishdhingra, So I read the troubleshooting article and am convinced that the policy is correct. When I log into the AWS Console and Switch Roles into the role, it works. As I showed before, the python-based AWS CLI is also working. Just for reference, the policy associated with my IAM user in the master account is:
My ~\.aws\config file looks like this:
and my ~\.aws\credentials file looks like this:
I created an EC2 instance with the console just to show that the AWS CLI is working and the AWS Powershell API is not. Adding the -ProfileName to Get-EC2Instance did not change the error.
Other Powershell commands are failing with the same AssumeRole error while all AWS CLI commands are working in the same Powershell session. |
In experimenting with the Use-STSRole cmdlet using the profile, I cannot point at the ody-gov-cloud profile and get it to work. I get the same AssumeRole error.
However, as soon as I point at the profile with only my credentials and pass the RoleArn and Region using command-line arguments, it seems to be happy.
Unfortunately, when I try to use the credentials, requests to AWS are still failing:
Hopefully this helps to narrow down where the problem might be. |
Hi @rpatrick00, Thanks for the detailed information. I have marked this as a bug (label). I will coordinate with developer to have a look at it and advise if something is missing, and keep you posted on the updates. Thanks, |
We have noticed this issue has not recieved attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue. |
@ashishdhingra Facing the same issue:
I tried to supply cmdlet with |
(reopening, we have a new internal case related to this) |
When using a profile configured with assume role credentials in AWS Tools for PowerShell, I suspect that the STS call to assume the role is being sent to either the global or us-east-1 STS endpoint, which is not valid for GovCloud regions. I'm able to work around this via the third line below, which directs the AssumeRole call directly, but we need to investigate why the PowerShell-specific methods of configuring the region are not being applied to the STS call.
|
Please use below command let . we has same issue and after using this command let , we are able to run the script with out any issue. |
Please use below command let . we has same issue and after using this command let , we are able to run the script with out any issue. |
Since my company uses subaccounts, I have set up the required profiles and credentials in my %USERPROFILE%\.aws directory. These are working fine with the aws cli commands:
Unfortunately, the PowerShell commands are failing with an error:
The text was updated successfully, but these errors were encountered: