Skip to content

data.cloudstack_instance filters not working [CS 4.21][CTP 0.6.0] #266

@chrxmvtik

Description

@chrxmvtik

Hi, recently moved to terraform provider v0.6.0 and wanted to obtain IP address of instance nic.

I created instances using resource - works fine.

resource "cloudstack_instance" "controlplane" {
  count            = var.controlplane_count
  name             = "${var.cluster_name}-control-${count.index + 1}"
  service_offering = "CS"
  boot_mode        = "legacy"
  template         = cloudstack_template.talos.id
  zone             = var.zone
  project          = var.project
  uefi             = true
  network_id       = cloudstack_network.talos.id
  expunge          = true
  root_disk_size   = 200
}

Then I tried to obtain instance details using datasource:

data "cloudstack_instance" "controlplane" {
  count      = var.controlplane_count
  depends_on = [cloudstack_instance.controlplane]
  
  filter {
    name  = "display_name" # Tried also "name"
    value = "${var.cluster_name}-control-${count.index + 1}"
  }
}

But provider returns an error:
Error: No instance is matching with the specified regex

While it certainly exists and should match.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions