mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-08-22 19:38:35 +00:00
* feat(lxc): add `proxmox_virtual_environment_containers` data source - Implements a new data source for fetching container details in Proxmox environments. - Includes support for filtering by attributes such as name, template, status, and tags. - Provides documentation and test coverage for the new functionality. Signed-off-by: k69420s <k69420s@localhost.localdomain> * suppress duplication error in linter, fix example code Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> --------- Signed-off-by: k69420s <k69420s@localhost.localdomain> Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
35 lines
878 B
HCL
35 lines
878 B
HCL
data "proxmox_virtual_environment_containers" "example" {
|
|
depends_on = [proxmox_virtual_environment_container.example]
|
|
tags = ["example"]
|
|
|
|
lifecycle {
|
|
postcondition {
|
|
condition = length(self.containers) == 1
|
|
error_message = "Only 1 container should have this tag"
|
|
}
|
|
}
|
|
}
|
|
|
|
data "proxmox_virtual_environment_containers" "template_example" {
|
|
depends_on = [proxmox_virtual_environment_container.example]
|
|
tags = ["example"]
|
|
|
|
filter {
|
|
name = "template"
|
|
values = [false]
|
|
}
|
|
|
|
filter {
|
|
name = "status"
|
|
values = ["running"]
|
|
}
|
|
}
|
|
|
|
output "proxmox_virtual_environment_containers_example" {
|
|
value = data.proxmox_virtual_environment_containers.example.containers
|
|
}
|
|
|
|
output "proxmox_virtual_environment_template_containers_example" {
|
|
value = data.proxmox_virtual_environment_containers.template_example.containers
|
|
}
|