Skip to content

output value for dns_custom_resolver_id is returning dns instance id #1018

@hFti

Description

@hFti

Affected modules

terraform-ibm-landingzone-vpc

Terraform CLI and Terraform provider versions

  • Terraform version: 1.10
  • Provider version: 1.80.0

Terraform resource

resource "ibm_dns_custom_resolver_forwarding_rule" "dns_custom_resolver_fw_rule_external" {
instance_id = module.vpc_hub.dns_instance_id
resolver_id = module.vpc_hub.dns_custom_resolver_id
description = "dns zone Fw Rule"
type = "zone"
match = var.domain_name
forward_to = var.vpc_hub.external_dns_list
}

Terraform output

in tha plan I see that the resolver id is not correct (itn takes the instance id)

2025/07/09 09:25:06 Terraform plan| # ibm_dns_custom_resolver_forwarding_rule.dns_custom_resolver_fw_rule_internal["cloud.ibm.com"] will be created
2025/07/09 09:25:06 Terraform plan| + resource "ibm_dns_custom_resolver_forwarding_rule" "dns_custom_resolver_fw_rule_internal" {
2025/07/09 09:25:06 Terraform plan| + description = "Dns zone Fw Rule"
2025/07/09 09:25:06 Terraform plan| + forward_to = [
2025/07/09 09:25:06 Terraform plan| + "161.27.0.7",
2025/07/09 09:25:06 Terraform plan| + "161.28.0.8",
2025/07/09 09:25:06 Terraform plan| ]
2025/07/09 09:25:06 Terraform plan| + id = (known after apply)
2025/07/09 09:25:06 Terraform plan| + instance_id = "ef0994c-ca98-4ba1-43af-db48969eh736"
2025/07/09 09:25:06 Terraform plan| + match = "cloud.ibm.com"
2025/07/09 09:25:06 Terraform plan| + resolver_id = "ef0994c-ca98-4ba1-43af-db48969eh736"
2025/07/09 09:25:06 Terraform plan| + rule_id = (known after apply)
2025/07/09 09:25:06 Terraform plan| + type = "zone"
2025/07/09 09:25:06 Terraform plan| }

and when applying it can't find the resolver as the id is not correct:

2025/07/09 09:25:32 Terraform apply | "code": "resource_not_found",
2025/07/09 09:25:32 Terraform apply | "message": "The resource you are trying to access does not exist.",
2025/07/09 09:25:32 Terraform apply | "more_info": "https://cloud.ibm.com/apidocs/dns-svcs#error-handling",

Expected behavior

the output dns_custom_resolver_id should return the custom resolver id as here

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/dns_custom_resolver#custom_resolver_id-1

when in this line it is returning dns instance_id https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone-vpc/blob/main/outputs.tf#L177

Actual behavior

Output returned dns instance id , therefore forwarding rules couldn't be created

Steps to reproduce (including links and screen captures)

create vpc using module landingzone-vpc with dns_custom_resolver_name

try to create forwarding rule resource : https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/dns_custom_resolver_forwarding_rule


Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions