# nebius/terraform-provider-nebius architecture

> Architecture diagram of the GitHub repository nebius/terraform-provider-nebius, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nebius/terraform-provider-nebius
- Repository: https://github.com/nebius/terraform-provider-nebius

## Overview

This is a Terraform provider for Nebius AI Cloud. Terraform configures the provider, then uses its resources, data sources, and ephemeral values to interact with the cloud and return state or diagnostics. The tree shows shared service, conversion, and validation layers, but no concrete Nebius resource implementations; those domain-specific operations and their API call paths are therefore not mapped. Provider configuration details are sampled, while several service modules are represented only by their paths and names.

Main entry points: [`service/resource.go`](https://github.com/nebius/terraform-provider-nebius/blob/main/service/resource.go) (Resources), [`conversion/to.go`](https://github.com/nebius/terraform-provider-nebius/blob/main/conversion/to.go) (Terraform conversion), [`provider/impl/provider.go`](https://github.com/nebius/terraform-provider-nebius/blob/main/provider/impl/provider.go) (Provider configuration), [`main.go`](https://github.com/nebius/terraform-provider-nebius/blob/main/main.go) (Provider server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Provider entry"]
  node_main["Provider server<br/>[main.go]"]
  node_provider["Provider configuration<br/>[provider.go]"]
  node_sdk["Nebius SDK"]
end

subgraph group_operations["Terraform operations"]
  node_resources["Resources<br/>[resource.go]"]
  node_datasources["Data sources<br/>[datasource.go]"]
  node_simpleds["Simple data sources"]
  node_ephemeral["Ephemeral values<br/>[ephemeral.go]"]
  node_writeonly["Write-only handling<br/>[write_only.go]"]
end

subgraph group_mapping["Value mapping"]
  node_conversion["Proto conversion<br/>[from.go]"]
  node_to_tf["Terraform conversion<br/>[to.go]"]
  node_wellknown["Well-known types<br/>[types.go]"]
  node_normalizers["Value normalizers<br/>[registry.go]"]
end

subgraph group_support["Shared support"]
  node_validators["Field validators<br/>[protovalidate.go]"]
  node_preflight["Preflight checks<br/>[preflight.go]"]
  node_requestctx["Request context<br/>[context.go]"]
  node_diagnostics["Diagnostic helpers<br/>[diagnostic.go]"]
end

node_terraform(("Terraform"))
node_nebius["Nebius AI Cloud"]

node_terraform -->|"starts provider"| node_main
node_main -->|"serves"| node_provider
node_terraform -->|"configures"| node_provider
node_provider -->|"creates SDK"| node_sdk
node_terraform -->|"requests lifecycle"| node_resources
node_terraform -->|"requests lookup"| node_datasources
node_terraform -->|"requests lookup"| node_simpleds
node_terraform -->|"requests value"| node_ephemeral
node_resources -->|"cloud operations"| node_nebius
node_datasources -->|"cloud queries"| node_nebius
node_simpleds -->|"cloud queries"| node_nebius
node_resources -->|"maps inputs"| node_conversion
node_conversion -->|"converts values"| node_to_tf
node_to_tf -->|"handles types"| node_wellknown
node_to_tf -->|"normalizes strings"| node_normalizers
node_resources -->|"handles secrets"| node_writeonly
node_resources -->|"validates fields"| node_validators
node_resources -->|"checks requests"| node_preflight
node_resources -->|"tracks requests"| node_requestctx
node_requestctx -->|"wraps diagnostics"| node_diagnostics

click node_main "https://github.com/nebius/terraform-provider-nebius/blob/main/main.go"
click node_provider "https://github.com/nebius/terraform-provider-nebius/blob/main/provider/impl/provider.go"
click node_resources "https://github.com/nebius/terraform-provider-nebius/blob/main/service/resource.go"
click node_datasources "https://github.com/nebius/terraform-provider-nebius/blob/main/service/datasource.go"
click node_simpleds "https://github.com/nebius/terraform-provider-nebius/blob/main/service/simple_datasource.go"
click node_ephemeral "https://github.com/nebius/terraform-provider-nebius/blob/main/service/ephemeral.go"
click node_writeonly "https://github.com/nebius/terraform-provider-nebius/blob/main/service/write_only.go"
click node_conversion "https://github.com/nebius/terraform-provider-nebius/blob/main/conversion/from.go"
click node_to_tf "https://github.com/nebius/terraform-provider-nebius/blob/main/conversion/to.go"
click node_wellknown "https://github.com/nebius/terraform-provider-nebius/blob/main/conversion/wellknown/types.go"
click node_normalizers "https://github.com/nebius/terraform-provider-nebius/blob/main/conversion/normalizers/registry.go"
click node_validators "https://github.com/nebius/terraform-provider-nebius/blob/main/validators/protovalidate.go"
click node_preflight "https://github.com/nebius/terraform-provider-nebius/blob/main/service/preflight.go"
click node_requestctx "https://github.com/nebius/terraform-provider-nebius/blob/main/service/requestcontext/context.go"
click node_diagnostics "https://github.com/nebius/terraform-provider-nebius/blob/main/service/requestcontext/diagnostic.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_provider,node_sdk toneBlue
class node_resources,node_datasources,node_simpleds,node_ephemeral,node_writeonly toneAmber
class node_conversion,node_to_tf,node_wellknown,node_normalizers toneMint
class node_validators,node_preflight,node_requestctx,node_diagnostics toneRose
class node_terraform,node_nebius toneIndigo
```

## Components

### Provider entry

- [Provider server](https://github.com/nebius/terraform-provider-nebius/blob/main/main.go): `main.go`
- [Provider configuration](https://github.com/nebius/terraform-provider-nebius/blob/main/provider/impl/provider.go): `provider/impl/provider.go`
- **Nebius SDK**

### Terraform operations

- [Resources](https://github.com/nebius/terraform-provider-nebius/blob/main/service/resource.go): `service/resource.go`
- [Data sources](https://github.com/nebius/terraform-provider-nebius/blob/main/service/datasource.go): `service/datasource.go`
- [Simple data sources](https://github.com/nebius/terraform-provider-nebius/blob/main/service/simple_datasource.go): `service/simple_datasource.go`
- [Ephemeral values](https://github.com/nebius/terraform-provider-nebius/blob/main/service/ephemeral.go): `service/ephemeral.go`
- [Write-only handling](https://github.com/nebius/terraform-provider-nebius/blob/main/service/write_only.go): `service/write_only.go`

### Value mapping

- [Proto conversion](https://github.com/nebius/terraform-provider-nebius/blob/main/conversion/from.go): `conversion/from.go`
- [Terraform conversion](https://github.com/nebius/terraform-provider-nebius/blob/main/conversion/to.go): `conversion/to.go`
- [Well-known types](https://github.com/nebius/terraform-provider-nebius/blob/main/conversion/wellknown/types.go): `conversion/wellknown/types.go`
- [Value normalizers](https://github.com/nebius/terraform-provider-nebius/blob/main/conversion/normalizers/registry.go): `conversion/normalizers/registry.go`

### Shared support

- [Field validators](https://github.com/nebius/terraform-provider-nebius/blob/main/validators/protovalidate.go): `validators/protovalidate.go`
- [Preflight checks](https://github.com/nebius/terraform-provider-nebius/blob/main/service/preflight.go): `service/preflight.go`
- [Request context](https://github.com/nebius/terraform-provider-nebius/blob/main/service/requestcontext/context.go): `service/requestcontext/context.go`
- [Diagnostic helpers](https://github.com/nebius/terraform-provider-nebius/blob/main/service/requestcontext/diagnostic.go): `service/requestcontext/diagnostic.go`

### Other components

- **Terraform**
- **Nebius AI Cloud**

## Connections

- Terraform → Provider server: starts provider
- Provider server → Provider configuration: serves
- Terraform → Provider configuration: configures
- Provider configuration → Nebius SDK: creates SDK
- Terraform → Resources: requests lifecycle
- Terraform → Data sources: requests lookup
- Terraform → Simple data sources: requests lookup
- Terraform → Ephemeral values: requests value
- Resources → Nebius AI Cloud: cloud operations
- Data sources → Nebius AI Cloud: cloud queries
- Simple data sources → Nebius AI Cloud: cloud queries
- Resources → Proto conversion: maps inputs
- Proto conversion → Terraform conversion: converts values
- Terraform conversion → Well-known types: handles types
- Terraform conversion → Value normalizers: normalizes strings
- Resources → Write-only handling: handles secrets
- Resources → Field validators: validates fields
- Resources → Preflight checks: checks requests
- Resources → Request context: tracks requests
- Request context → Diagnostic helpers: wraps diagnostics
