AWS CLI
The AWS CLI
Getting started
- Create a service account.
- Assign the roles required for your project to the service account. For more information about roles, see the Identity and Access Management documentation.
- Create static access keys. Save the ID and secret key to a secure location. You will not be able to view the secret key parameters again after you close the window.
Installation
To install the AWS CLI, follow the guide
Setup
To configure the AWS CLI, run the aws configure
command in your terminal. The command will request values for the following parameters:
-
AWS Access Key ID
: ID of the static key created when getting started. -
AWS Secret Access Key
: Contents of the static access key. -
Default region name
:ru-central1
.To work with Yandex Cloud Postbox, always specify
ru-central1
as the region. A different region value may lead to an authorization error. -
Leave the other parameter values unchanged.
Configuration files
The aws configure
command saves the static key and the region.
-
Static key format in
.aws/credentials
:[default] aws_access_key_id = <static_key_ID> aws_secret_access_key = <static_key_contents>
-
Default region format in
.aws/config
:[default] region = ru-central1
-
You can create multiple profiles for different service accounts by specifying their details in the
.aws/credentials
file:[default] aws_access_key_id = <ID_of_static_key_1> aws_secret_access_key = <contents_of_static_key_1> [<name_of_profile_2>] aws_access_key_id = <ID_of_static_key_2> aws_secret_access_key = <contents_of_static_key_2> ... [<name_of_profile_n>] aws_access_key_id = <ID_of_static_key_n> aws_secret_access_key = <contents_of_static_key_n>
Where
default
is the default profile.