Explore Courses Blog Tutorials Interview Questions
0 votes
in AWS by (19.1k points)

I am trying to access AWS services from the Powershell, but I am stuck in the login process itself. If I run any AWS command, I get this error given below:

No credentials specified or obtained from persisted/shell defaults.

1 Answer

0 votes
by (44.4k points)

First, are you a IAM user or the root user?

1. If IAM user and do not have the security credentials, then create one for you by going through the below documentation:

IAM Credentials Access Keys - Using CreateAccessKey

2. After that, you will have to create a profile for the user which will be stored in the encrypted SDK store file.

Set-AWSCredential -AccessKey <accesskey> -SecretKey <secretaccesskey> -StoreAs YourProfileNameHere

3. Now, the Powershell will check the SDK file store for the credentials associated with the profile name and then takes it back to the shared credentials file in the default location.

Set-AWSCredential -ProfileName myProfileName

If you are a root user, create a profile directly with your access and secret access keys. Do the exact same process as provided for an IAM user.

Also, I think you can take a look at the AWS Lambda part of this AWS Tutorial and for more insights you can check the AWS training page :)

Related questions

0 votes
1 answer

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

Browse Categories