Skip to main content
Access keys in Nebius AI Cloud are used to authenticate service accounts in AWS-compatible services, such as Object Storage. To work with such services using their CLIs (for example, AWS CLI), create an access key and add it to the CLI configuration. The key ID is included in your requests and can be viewed. The secret key is used to sign the request parameters and is not included in the request. Access keys can be issued without an expiration date. Do not confuse access tokens with access keys. Access tokens are used for authentication in Nebius AI Cloud interfaces.

Prerequisites

  1. Install and configure the Nebius AI Cloud CLI.
  2. Check that your project ID is saved in the Nebius AI Cloud CLI profile configuration:
  3. Install jq to extract IDs and tokens from JSON data returned by the Nebius AI Cloud CLI:
  4. Make sure that you or the service account that you use is in a group that has the admin role within your tenant or project; for example, the default admins group. You can check this in the Administration → IAM section of the web console.
  5. Create a service account, if you don’t have one already.
  6. Get the ID of the service account for which you want to issue the key and save it to an environment variable:

Creating a key pair

Create an access key pair and save its ID to an environment variable:
Where --expires-at allows you to create a temporary access key. To set the key expiration date, use the ISO 8601 format. Here’s how to store an environment variable with a one-year expiration date:
Then pass the variable as --expires-at $EXPIRES_AT.

Configuring your AWS CLI profile

In this example, you will configure the AWS CLI to work with Object Storage on behalf of the service account.
  1. Get the access key pair AWS ID and save it to an environment variable:
  2. Get the secret key and save it to an environment variable:
  3. Add the key to the AWS CLI configuration:
  4. Depending on your project region, add the Nebius AI Cloud region ID and the Object Storage endpoint URL to the AWS CLI configuration:
    For example, run the following commands for a project in eu-north1:

Listing expiring keys

After an access key expires, you can’t use it to authenticate as the service account. To find the keys that you need to replace soon, list the keys that expire within the next seven days, across all service accounts in your project.
List the expiring keys, sorted by expiration date:
For each key, the output contains the following fields:
  • id: ID of the key.
  • service_account_id: ID of the service account that the key belongs to.
  • expires_at: Date and time when the key expires.
To adjust the command:
  • To change the period, replace 7 in 7 * 86400 with another number of days.
  • To list keys in a project other than the one saved in your CLI profile, add --parent-id <project_ID> to the command.
The list doesn’t include keys that have already expired or keys without an expiration date. If the list is empty, no keys expire within the next seven days. To replace an expiring key, create a new key pair and add it to your AWS CLI profile.