Had some code similar to this:
Install-Module -Name AWS.Tools.Installer
Install-AWSToolsModule AWS.Tools.EC2,AWS.Tools.S3 -CleanUp
Set-AWSCredential `
-AccessKey ---- `
-SecretKey --- `
-StoreAs default
Write-S3Object -BucketName "test" -File "test" -Key "test"
When running this script in powershell I got the error:
Write-S3Object : The AWS Access Key Id you provided does not exist in our records .......
The credentials used were admin ones from the account. I don't have any environment variables set and usually sign into aws through sso. Is there a better way to set these credentials (this is just for a test, not gonna hard code these in prod)