0

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)

aids
  • 19
  • 3
  • 4
    Did you actually [generate an access key & secret key](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) for this user? Note that these are different things to the credentials you use to sign in via SSO. – jarmod Aug 22 '23 at 18:50

0 Answers0