lxc / terraform-provider-incus

Incus provider for Terraform/OpenTofu
https://linuxcontainers.org/incus
Mozilla Public License 2.0
35 stars 8 forks source link

Add Profile as data source #63

Closed maveonair closed 1 month ago

maveonair commented 1 month ago

This pull request introduces a new data source for Incus profiles in the Terraform provider for Incus.

This makes it possible to use an existing profile that was not created by Terraform, such as the default profile as mentioned in https://github.com/lxc/terraform-provider-incus/issues/58:

data "incus_profile" "default" {
  name = "default"
}

resource "incus_instance" "d1" {
  profiles = [data.incus_profile.default.name]
  image    = "images:debian/12"
  name     = "d1"
}

Documentation:

Changes: