### Basic Incus Provider Configuration for Terraform Source: https://registry.terraform.io/providers/lxc/incus/latest/docs/index This snippet shows the most basic configuration for the Incus Terraform provider. It assumes Incus remotes are already defined using the `incus` client. No specific arguments are required for this minimal setup. ```Terraform provider "incus" { } ``` -------------------------------- ### Incus Provider Configuration with Multiple Remotes and Certificate Generation Source: https://registry.terraform.io/providers/lxc/incus/latest/docs/index This example demonstrates configuring the Incus Terraform provider to manage multiple Incus remotes and automatically generate client certificates. It's useful when Terraform is run from a system without the `incus` client installed locally. It specifies a default remote and allows accepting remote certificates. ```Terraform provider "incus" { generate_client_certificates = true accept_remote_certificate = true default_remote = "local" remote { name = "local" address = "unix://" } remote { name = "incus-server-2" address = "https://10.1.2.8" token = "token" } } ``` -------------------------------- ### Incus Provider Configuration Source: https://registry.terraform.io/providers/lxc/incus/latest/docs/index This section details how to configure the Incus Terraform provider, including specifying remotes, client certificates, and connection details. ```APIDOC ## Incus Provider Configuration ### Description Configuration options for the Terraform Incus provider. ### Method Provider Configuration ### Endpoint N/A ### Parameters #### Configuration Arguments - **remote** (Block) - _Optional_ - Specifies an Incus remote (Incus server) to connect to. See the `remote` reference below for details. - **config_dir** (String) - _Optional_ - The directory to look for existing Incus configuration. This can also be set with the `INCUS_CONF` Environment variable. Defaults to `$HOME/.config/incus` - **generate_client_certificates** (Boolean) - _Optional_ - Automatically generate the Incus client certificate if it does not exist. Valid values are `true` and `false`. This can also be set with the `INCUS_GENERATE_CLIENT_CERTS` Environment variable. Defaults to `false`. - **accept_remote_certificate** (Boolean) - _Optional_ - Automatically accept the Incus remote's certificate. Valid values are `true` and `false`. If this is not set to `true`, you must accept the certificate out of band of Terraform. This can also be set with the `INCUS_ACCEPT_SERVER_CERTIFICATE` environment variable. Defaults to `false` - **project** (String) - _Optional_ - The project where project-scoped resources will be created. Can be overridden in individual resources. Defaults to `default`. - **default_remote** (String) - _Optional_ - The `name` of the default remote to use when no other remote is defined in a resource. #### Remote Block Arguments - **address** (String) - _Optional_ - The address of the Incus remote. - **name** (String) - _Required_ - The name of the Incus remote. - **protocol** (String) - _Optional_ - The server protocol to use. Valid values are `incus`, `oci`, or `simplestreams`. Defaults to `incus`. - **authentication_type** (String) - _Optional_ - Server authentication type. Valid values are `tls` or `oidc`. Defaults to `tls`. ( Only for the `incus` protocol ) - **token** (String) - _Optional_ - The one-time trust token used for initial authentication with the Incus remote. - **public** (Boolean) - _Optional_ - Public image server. Valid values are `true` and `false`. Defaults to `false`. ### Request Example ```terraform provider "incus" { generate_client_certificates = true accept_remote_certificate = true default_remote = "local" remote { name = "local" address = "unix://" } remote { name = "incus-server-2" address = "https://10.1.2.8" token = "token" } } ``` ### Response #### Success Response (Configuration Applied) - N/A (Provider configuration does not have a direct response) #### Response Example N/A ``` -------------------------------- ### Environment Variable Remote Configuration Source: https://registry.terraform.io/providers/lxc/incus/latest/docs/index Configuring an Incus remote using environment variables for convenience. ```APIDOC ## Environment Variable Remote Configuration ### Description It is possible to define a single `remote` through environment variables. ### Method Provider Configuration via Environment Variables ### Endpoint N/A ### Parameters #### Environment Variables - **INCUS_REMOTE** (String) - Required - The name of the remote. - **INCUS_ADDR** (String) - Required - The address of the Incus remote. - **INCUS_PROTOCOL** (String) - Optional - The server protocol to use. - **INCUS_AUTHENTICATION_TYPE** (String) - Optional - Server authentication type. - **INCUS_TOKEN** (String) - Optional - The trust token of the Incus remote. ### Request Example ```bash export INCUS_REMOTE="my-remote" export INCUS_ADDR="https://incus.example.com" export INCUS_PROTOCOL="incus" export INCUS_TOKEN="your-token" ``` ### Response #### Success Response (Configuration Applied) - N/A (Provider configuration does not have a direct response) #### Response Example N/A ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.