Prerequisites
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
- Install and configure the Nebius AI Cloud CLI.
-
Check that your project ID is saved in the Nebius AI Cloud CLI profile configuration:
-
Install jq to extract IDs and tokens from JSON data returned by the Nebius AI Cloud CLI:
-
Make sure that you or the service account that you use is in a group that has the
adminrole within your tenant or project; for example, the defaultadminsgroup. You can check this in the Administration → IAM section of the web console. - Create a service account, if you don’t have one already.
-
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
- CLI
- Go SDK
- Python SDK
- JavaScript SDK
Create an access key pair and save its ID to an environment variable:Where Then pass the variable as
--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:--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.- CLI
- Go SDK
- Python SDK
- JavaScript SDK
-
Get the access key pair AWS ID and save it to an environment variable:
-
Get the secret key and save it to an environment variable:
-
Add the key to the AWS CLI configuration:
-
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.- CLI
- Go SDK
- Python SDK
- JavaScript SDK
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 change the period, replace
7in7 * 86400with 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.