Skip to content

Error with regex using vpc datasource #162

@ferdinandopaes

Description

@ferdinandopaes

Hello,

I am using the VPC datasource to retrieve the data.
But I am receiving the following error:

Error: No VPC is matching with the specified regex

It occurs even when changing and using any other filter.

My main.tf

terraform {
  required_providers {
    cloudstack = {
        source  = "cloudstack/cloudstack"
        version = "0.5.0"
    }
  }
}

provider "cloudstack" {
  api_url     = "https://<my_cloudstack_url>/client/api"
  api_key     = "${var.cloudstack_api_key}"
  secret_key  = "${var.cloudstack_secret_key}"
}

variable "cloudstack_api_key" {
  description = "API KEY for CloudStack"
  type        = string
}

variable "cloudstack_secret_key" {
  description = "SECRET KEY for CloudStack"
  type        = string
}

My data.tf

data "cloudstack_vpc" "vpc" {
  filter{
    name  = "cidr"
    value = "10.25.0.0/16"
  }
  filter{
    name  = "name"
    value = "boilerplate"
  }
  filter{
    name = "project"
    value  = "boilerplate"
  }
}

I tried using the datasource with all the filters, but I also tried one filter at a time to identify any issues with the values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions