I'm trying to use AWS Tools from Powershell, but I don't know how to log in. So when I run a command I naturally get this error:
No credentials specified or obtained from persisted/shell defaults.
How do I login? I read the article at https://docs.aws.amazon.com/powershell/latest/userguide/specifying-your-aws-credentials.html, but it talks about public and private keys. I don't have those, I login to AWS from the web interface with my username and password (and also a token sent to my phone because I have MFA enabled).
Also, my user isn't allowed to create IAM users (it's a company policy and I can't override it).
To use AWS programmatically from PowerShell, you need to generate your access keys. To do this, sign into the AWS console, and from the Services tab, select IAM under Security, Identity, & Compliance. From the left-hand side, select Users, and find the username you want to generate access keys for.
The AWS Tools for PowerShell let developers and administrators manage their AWS services and resources in the PowerShell scripting environment. Now you can manage your AWS resources with the same PowerShell tools you use to manage your Windows, Linux, and MacOS environments.
AWS releases new versions of the AWS Tools for PowerShell periodically to support new AWS services and features. To determine the version of the Tools that you have installed, run the Get-AWSPowerShellVersion cmdlet.
By default, the credentials file is stored here: On Windows: C:\Users\ username \. aws\credentials.
If your IAM user account doesn't already have Access and Secret Keys you'll need to create them here.
http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey
Then create a profile
Writes a new (or updates existing) profile with name "myProfileName" in the encrypted SDK store file
Set-AWSCredential -AccessKey akey -SecretKey skey -StoreAs myProfileName
Checks the encrypted SDK credential store for the profile and then falls back to the shared credentials file in the default location
Set-AWSCredential -ProfileName myProfileName
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With