Skip to content

cloudconnexa_dns_record resource errors when ip_v4_addresses or ip_v6_addresses isn't known until apply #166

@tcpkump

Description

@tcpkump

Since release 1.0.0 which added this validation, I am no longer able to successfully plan my Terraform stacks with this resource. Inside my module, I define the resource like so:

resource "cloudconnexa_dns_record" "int" {
  count           = var.create_cloudconnexa_dns_record ? var.instance_count : 0
  domain          = local.hostnames[count.index]
  ip_v4_addresses = [google_compute_instance.compute_instance[count.index].network_interface[0].network_ip]
}

It appears that because ip_v4_addresses isn't known at plan time, I get the following error:

│ Error: either 'ip_v4_addresses' or 'ip_v6_addresses' must contain at least one item
│
│   with module.gcp_pipeline_instances["sts"].cloudconnexa_dns_record.int[0],
│   on .terraform/modules/gcp_pipeline_instances/dns.tf line 58, in resource "cloudconnexa_dns_record" "int":
│   58: resource "cloudconnexa_dns_record" "int" {
│
╵

When I revert back to using version 0.5.1 of this provider, I'm able to plan and apply just fine with the exact same input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions