Follow these steps to configure your AWS credentials:
1. Run the Command
Open your terminal and execute the following command:
aws configure
2. Provide the Required Information
During the configuration process, you’ll be prompted to enter the following details:
– AWS Access Key ID: Enter your Access Key ID.
– AWS Secret Access Key: Enter your Secret Access Key.
– Default region name: Enter your default region, e.g., us-east-1.
– Default output format: Enter your default output format, e.g., json.
3. You can find the AWS Access Key ID and AWS Secret Access Key in the AWS Management Console:
– Navigate to IAM (Identity and Access Management).
– In the Users section, select the user for which you want to retrieve the access keys.
– Under the Security credentials tab, you’ll find the option to create a new access key. If the keys don’t already exist, you can create them here and download them for future use.
– In Access key best practeces & alternatives choose “Command line interface (CLI)” use case.
– After you retrieved AWS Access Key ID and AWS Secret Access Key get back to the step 2 and run them in CLI.
Note: Make sure to store the Secret Access Key securely, as you won’t be able to view it again after creation.
4. Verify the Configuration
To check that your settings were saved correctly, run the following command:
aws configure list
This will display the current configuration settings for AWS.