Skip to main content
Nebius AI Cloud provides several interfaces to manage cloud resources. In addition to the web console and CLI commands, you can use the Terraform provider by Nebius AI Cloud. Terraform is most useful when you need to create and maintain multiple resources simultaneously. However, you can still create single resources by using Terraform.

Steps

Install the required tools

  1. Install Terraform:
  2. Install jq:
  3. Install and configure the Nebius AI Cloud CLI.

Configure access and credentials

In the example below, Terraform applies configurations on behalf of a Nebius AI Cloud service account. Alternatively, you can authenticate with your user account. Make sure you are 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. To configure access for the service account:
  1. Create a service account and save its ID to an environment variable:
  2. Grant edit access to the service account:
    1. Get the tenant ID.
    2. Get the ID of the default editors group:
      If you need to manage the Nebius AI Cloud resources by using the service account, use the admins group instead of editors. Specify --name admins in the command below.
    3. Add the service account to the group:
  3. Create an authorized key:
    1. Generate a key pair:
    2. Upload a public key to create the authorized key and save its ID to an environment variable:

Initialize a working directory

The configuration files for each infrastructure that you deploy with Terraform should be in their own working directory. This is where you will run the Terraform CLI commands. Before creating configuration files that define cloud resources, initialize the working directory:
  1. Create the working directory:
  2. Inside the directory, create files that contain settings related to Terraform and its providers:
    • terraform.tf lists the providers required for your configuration — in this case, the Nebius AI Cloud provider.
    • providers.tf contains settings for the provider. service_account lists the environment variables that contain the credentials from the previous step.
      If you authenticate with a user account, set provider "nebius" {token = "<access_token>"} in providers.tf instead of the configuration above. For more information, see Authentication in the Nebius AI Cloud provider for Terraform.
  3. Run the initialization command in the directory:

What’s next