0
PS C:\Users\Test123> (Get-EC2Region).RegionName
Get-EC2Region : AWS was not able to validate the provided access credentials
At line:1 char:2
+ (Get-EC2Region).RegionName
+  ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Amazon.PowerShe...EC2RegionCmdlet:GetEC2RegionCmdlet) [Get-EC2Region], InvalidOperationException
    + FullyQualifiedErrorId : Amazon.EC2.AmazonEC2Exception,Amazon.PowerShell.Cmdlets.EC2.GetEC2RegionCmdlet

PS C:\Users\Test123> aws --version
aws-cli/2.10.1 Python/3.9.11 Windows/10 exe/AMD64 prompt/off
PS C:\Users\Test123>

I tried to remove my cli credentials and profile and reconfigured but still not working:

Remove-AWSCredentialProfile -ProfileName myaccount -Confirm:$false
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • Error : PS C:\Users\Test123> (Get-EC2Region).RegionName Get-EC2Region : AWS was not able to validate the provided access credentials At line:1 char:2 + (Get-EC2Region).RegionName + ~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (Amazon.PowerShe...EC2RegionCmdlet:GetEC2RegionCmdlet) [Get-EC2Region], InvalidOperationException + FullyQualifiedErrorId : Amazon.EC2.AmazonEC2Exception,Amazon.PowerShell.Cmdlets.EC2.GetEC2RegionCmdlet PS C:\Users\Test123> aws --version aws-cli/2.10.1 Python/3.9.11 Windows/10 exe/AMD64 prompt/off PS C:\Users\Test123> – rupesh kolatwar Feb 21 '23 at 20:19
  • You can re-enter the credentials by using `aws configure` (or `aws configure --myaccount` if you are using that as a named profile). – John Rotenstein Feb 21 '23 at 23:48
  • I tried reconfiguring my cred still not working – rupesh kolatwar Feb 22 '23 at 19:04
  • Please provide more information about it "still not working". What is the error message if you run `aws s3 ls`? Does your Access Key start with `AKIA`? Where did you obtain the Access Key and Secret Key? If you have admin permissions, you can generate new credentials by going to the IAM console, selecting your IAM User, going to the Security Credentials tab and generating new credentials. – John Rotenstein Feb 22 '23 at 20:52

0 Answers0