Costs
Nebius AI Cloud only charges you for Object Storage buckets. For more details, see the Object Storage pricing.Prerequisites
- Install Python version 3.10 or higher.
- Create a Pulumi account.
- Install Pulumi.
- Install and configure the Nebius AI Cloud CLI.
-
Create an access token to authenticate with your user account to Terraform and save it to an environment variable:
Steps
Initialize a working directory
Create a dedicated directory on your local machine to work with Pulumi:Authenticate to Pulumi
You can authenticate in the browser or with an access token. If you choose the browser-based flow, Pulumi automatically generates and uses an access token for the CLI, and stores the credentials locally.- Browser
- Access token
Run the following command:The command redirects you to the Pulumi Cloud in the browser to authenticate.
Create a Pulumi project
Create a new Pulumi project with Python in your Pulumi project directory:__main__.py file.
Generate the Nebius provider SDK
-
From your Pulumi project directory, run the following command to add the Nebius Terraform provider:
This command generates a local Pulumi SDK in your Pulumi project directory. For more information about using Pulumi with any Terraform provider, see the Pulumi documentation.
-
Check the command output to see the import statement for the generated SDK. For Python, it looks like this:
-
In your
__main__.pyfile, import the generated Nebius SDK in your Pulumi project:
Configure the provider
-
In your
__main__.pyfile, configure the Nebius provider to use the access token from theNEBIUS_ACCESS_TOKENenvironment variable:This example authenticates by using an access token for your user account. You can also authenticate with a service account. -
Check your provider configuration by running the following command from your Pulumi project directory:
Pulumi shows a preview and asks you to confirm the deployment.
- Confirm the deployment.
Create an Object Storage bucket
After you configure the provider, you can start adding Nebius resources in Pulumi. The generated SDK exposes them as language-specific classes and input types. If your IDE supports it, you can use autocompletion and hints to explore them, or inspect the generated files in thenebius-terraform-pulumi/sdks/ directory.
For example, the Object Storage bucket resource is available in the generated Python SDK as nebius.StorageV1Bucket.
To create a bucket by using Pulumi:
-
In your
__main__.pyfile, add the resource definition for an Object Storage bucket:In the resource definition, specify:name: The name of the bucket that will be created.parent_id: Project ID.
-
From your Pulumi project directory, run the following command:
After the deployment, Pulumi prints the ID of the bucket that was created in Nebius AI Cloud.