Manage Incus server configuration with incus_server
mainThe incus_server resource manages the configuration settings of an Incus server or cluster.
Important Lifecycle Behavior: Because an Incus server must exist before Terraform can connect to it, this resource behaves uniquely:
- Creation: When you first add the resource, Terraform shows it as
createin the plan, but it actually only updates the Terraform state to reflect that the existing server is now managed by Terraform. - Configuration Scope: The resource only manages configuration keys that are explicitly set in your Terraform configuration. Any existing keys on the server that are not mentioned in your HCL will be preserved and ignored by Terraform.
- Destruction: When you delete the resource from your configuration, the Incus server itself is not deleted. Instead, only the specific configuration keys managed by Terraform are unset. All other server configuration keys remain untouched.
resource "incus_server" "test" {
config = {
"logging.loki01.target.type" = "loki"
"logging.loki01.target.address" = "https://loki01.int.example.net"
"logging.loki01.target.username" = "foo"
"logging.loki01.target.password" = "bar"
"logging.loki01.types" = "lifecycle,network-acl"
"logging.loki01.lifecycle.types" = "instance"
}
}