-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Affected modules
vpc resource and dns binding
Terraform CLI and Terraform provider versions
terrafrom version: 1.10
ibm provider version: 1.80.0
Terraform output
2025/07/09 15:09:32 Terraform apply | summary: 'CreateVPCDnsResolutionBindingWithContext failed: This VPC already contains
2025/07/09 15:09:32 Terraform apply | DNS Resolution Bindings'
2025/07/09 15:09:32 Terraform apply | severity: error
2025/07/09 15:09:32 Terraform apply | resource: ibm_is_vpc_dns_resolution_binding
2025/07/09 15:09:32 Terraform apply | operation: create
2025/07/09 15:09:32 Terraform apply | component:
2025/07/09 15:09:32 Terraform apply | name: github.com/IBM-Cloud/terraform-provider-ibm
2025/07/09 15:09:32 Terraform apply | version: 1.80.0
Expected behavior
creating one dns resolution binding
Actual behavior
When adding delegated resolver (within vpc resource ) , the module creates the dns resolution binding with a default name for example "uncross-chrome-embark-yodel"
then it creates a second one using the resource ibm_is_vpc_dns_resolution_binding with a more meaningful name
vpc-name-dns-binding
but this fails as the binding has already been done when creating the vpc.
This is obviously caused by changes in ibm provider that added the resolution binding creation when setting resolver to delegated.
Steps to reproduce (including links and screen captures)
set enable_hub_vpc_crn and update_delegated_resolver to true
and create a spoke vpc
Run terraform apply
I guess adding removing the dns resolution resource and adding
dns_binding_name = "example-vpc-binding"
in vpc resource as mentioned here https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/is_vpc should fix the issue.
"// delegated type resolver
resource "ibm_is_vpc" "example-delegated" {
// required : add a dependency on ibm dns custom resolver of the hub vpc
depends_on = [ ibm_dns_custom_resolver.example-hub ]
name = "example-hub-false-delegated"
dns {
enable_hub = false
resolver {
type = "delegated"
vpc_id = ibm_is_vpc.example.id
dns_binding_name = "example-vpc-binding"
}
}
}"