Skip to main content
You can use Pulumi to manage Nebius AI Cloud resources by using the Nebius Terraform provider. Pulumi generates a local SDK, adds it to your project and lets you write your infrastructure in your preferred language instead of writing Terraform configuration. In this guide, you will learn how to set up authentication when using the Nebius Terraform provider with Pulumi, write a Pulumi configuration in Python and create an Object Storage bucket.

Costs

Nebius AI Cloud only charges you for Object Storage buckets. For more details, see the Object Storage pricing.

Prerequisites

  1. Install Python version 3.10 or higher.
  2. Create a Pulumi account.
  3. Install Pulumi.
  4. Install and configure the Nebius AI Cloud CLI.
  5. Create an access token to authenticate with your user account to Terraform and save it to an environment variable:
    export NEBIUS_ACCESS_TOKEN="$(nebius iam get-access-token)"
    

Steps

Initialize a working directory

Create a dedicated directory on your local machine to work with Pulumi:
mkdir nebius-terraform-pulumi
cd nebius-terraform-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.
Run the following command:
pulumi login
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:
pulumi new python
When you run this command, Pulumi prompts you for a project name, description and stack name. It will also install the required dependencies, and create a Python virtual environment and a __main__.py file.

Generate the Nebius provider SDK

  1. From your Pulumi project directory, run the following command to add the Nebius Terraform provider:
    pulumi package add terraform-provider terraform-provider.storage.eu-north1.nebius.cloud/nebius/nebius
    
    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.
  2. Check the command output to see the import statement for the generated SDK. For Python, it looks like this:
    import pulumi_nebius as nebius
    
  3. In your __main__.py file, import the generated Nebius SDK in your Pulumi project:
    import os
    import pulumi
    import pulumi_nebius as nebius
    

Configure the provider

  1. In your __main__.py file, configure the Nebius provider to use the access token from the NEBIUS_ACCESS_TOKEN environment variable:
    import os
    import pulumi
    import pulumi_nebius as nebius
    
    nb_provider = nebius.Provider(
        "nebius",
        token=os.environ.get("NEBIUS_ACCESS_TOKEN"),
    )
    
    This example authenticates by using an access token for your user account. You can also authenticate with a service account.
  2. Check your provider configuration by running the following command from your Pulumi project directory:
    pulumi up
    
    Pulumi shows a preview and asks you to confirm the deployment.
  3. Confirm the deployment.
After the deployment, your Pulumi project is configured to use the Nebius provider and you can start adding resources.

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 the nebius-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:
  1. In your __main__.py file, add the resource definition for an Object Storage bucket:
    import os
    import pulumi
    import pulumi_nebius as nebius
    
    nb_provider = nebius.Provider(
        "nebius",
        token=os.environ.get("NEBIUS_ACCESS_TOKEN"),
    )
    
    bucket = nebius.StorageV1Bucket(
        "my-bucket",
        name="my-bucket",
        parent_id="<project_ID>",
    
        opts=pulumi.ResourceOptions(provider=nb_provider),
    )
    
    pulumi.export("output", bucket.id)
    
    In the resource definition, specify:
    • name: The name of the bucket that will be created.
    • parent_id: Project ID.
    See the Terraform reference for other resource arguments that you can configure.
  2. From your Pulumi project directory, run the following command:
    pulumi up
    
    After the deployment, Pulumi prints the ID of the bucket that was created in Nebius AI Cloud.
You can confirm that the bucket was created in the web console. In the sidebar, go to https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/storage.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=0a2dad6b48aea10e85f6f3e2343aee26 Storage → Object Storage, and then search by bucket name or ID.

How to delete the created resources

The created Object Storage bucket is chargeable. If you don’t need it, delete this resource, so Nebius AI Cloud doesn’t charge for it.