Steps
Install the required tools
-
Install Terraform:
-
Install jq:
- 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 theadmin 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:
-
Create a service account and save its ID to an environment variable:
-
Grant edit access to the service account:
- Get the tenant ID.
-
Get the ID of the default
editorsgroup:If you need to manage the Nebius AI Cloud resources by using the service account, use theadminsgroup instead ofeditors. Specify--name adminsin the command below. -
Add the service account to the group:
-
Create an authorized key:
-
Generate a key pair:
-
Upload a public key to create the authorized key and save its ID to an environment variable:
-
Generate a key pair:
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:-
Create the working directory:
-
Inside the directory, create files that contain settings related to Terraform and its providers:
-
terraform.tflists the providers required for your configuration — in this case, the Nebius AI Cloud provider. -
providers.tfcontains settings for the provider.service_accountlists the environment variables that contain the credentials from the previous step.If you authenticate with a user account, setprovider "nebius" {token = "<access_token>"}inproviders.tfinstead of the configuration above. For more information, see Authentication in the Nebius AI Cloud provider for Terraform.
-
-
Run the initialization command in the directory:
What’s next
- Create resources by using the Terraform provider.
- Learn how to authenticate with a user account.
- If you had version 0.5.x of the provider, migrate to the latest version with the Terraform Registry.