Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vpc): dns update fix on resolver system to delegated #5937

Merged
merged 4 commits into from
Jan 31, 2025

Conversation

uibm
Copy link
Collaborator

@uibm uibm commented Jan 24, 2025

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Output from acceptance testing:

 % make testacc TEST=./ibm/service/vpc TESTARGS='-run=TestAccIBMISVPC_ResolverTypeTransition'
=== RUN   TestAccIBMISVPC_ResolverTypeTransition
--- PASS: TestAccIBMISVPC_ResolverTypeTransition (363.21s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     365.391s

Constant config

data "ibm_resource_group" "rg" {
  is_default = true
}
resource "ibm_is_vpc" "hub_true" {
  name = "${var.name}-vpc-hub-true"
  dns {
    enable_hub = true
  }
}
resource "ibm_is_subnet" "hub_true_sub1" {
  name                     = "hub-true-subnet1"
  vpc                      = ibm_is_vpc.hub_true.id
  zone                     = "${var.region}-2"
  total_ipv4_address_count = 16
}
resource "ibm_is_subnet" "hub_true_sub2" {
  name                     = "hub-true-subnet2"
  vpc                      = ibm_is_vpc.hub_true.id
  zone                     = "${var.region}-2"
  total_ipv4_address_count = 16
}
resource "ibm_resource_instance" "dns-cr-instance" {
  name              = "dns-cr-instance"
  resource_group_id = data.ibm_resource_group.rg.id
  location          = "global"
  service           = "dns-svcs"
  plan              = "standard-dns"
}
resource "ibm_dns_custom_resolver" "test_hub_true" {
  name              = "test-hub-true-customresolver"
  instance_id       = ibm_resource_instance.dns-cr-instance.guid
  description       = "new test CR - TF"
  high_availability = true
  enabled           = true
  locations {
    subnet_crn = ibm_is_subnet.hub_true_sub1.crn
    enabled    = true
  }
  locations {
    subnet_crn = ibm_is_subnet.hub_true_sub2.crn
    enabled    = true
  }
}

Config 1: System Resolver

resource "ibm_is_vpc" "hub_false_delegated" {
  depends_on = [ibm_dns_custom_resolver.test_hub_true]
  name       = "${var.name}-vpc-hub-false"
  dns {
    enable_hub = false
    resolver {
      type = "system"
    }
  }
}

Config 2: Delegated Resolver

resource "ibm_is_vpc" "hub_false_delegated" {
  depends_on = [ibm_dns_custom_resolver.test_hub_true]
  name       = "${var.name}-vpc-hub-false"
  dns {
    enable_hub = false
    resolver {
      type             = "delegated"
      dns_binding_name = "test-delegation"
      vpc_id           = ibm_is_vpc.hub_true.id
    }
  }
}

Resolver type updated to delegated, with a binding


Config 3: Revert to System Resolver

resource "ibm_is_vpc" "hub_false_delegated" {
  depends_on = [ibm_dns_custom_resolver.test_hub_true]
  name       = "${var.name}-vpc-hub-false"
  dns {
    enable_hub = false
    resolver {
      type             = "system"
      vpc_id           = "null"
      dns_binding_name = "null"
    }
  }
}

Resolver type reverted to system, null specifies the removal of binding


Summary of the Three configs

Config Resolver Type Key Attributes
Config 1 system type = "system"
Config 2 delegated type = "delegated", vpc_id, dns_binding_name
Config 3 system type = "system", vpc_id = "null", dns_binding_name = "null"

@uibm uibm marked this pull request as ready for review January 30, 2025 21:01
@uibm
Copy link
Collaborator Author

uibm commented Jan 30, 2025

 % make testacc TEST=./ibm/service/vpc TESTARGS='-run=TestAccIBMISVPC_basic'
=== RUN   TestAccIBMISVPC_basic
--- PASS: TestAccIBMISVPC_basic (193.22s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     195.019s

--- PASS: TestAccIBMISVPC_noSGACLRules (56.24s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     57.684s
--- PASS: TestAccIBMISVPC_securityGroups (64.23s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     65.726s
--- PASS: TestAccIBMISVPC_basic_apm (101.32s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     103.088s
--- PASS: TestAccIBMISVPC_dns_system (78.20s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     80.012s

@uibm
Copy link
Collaborator Author

uibm commented Jan 30, 2025

--- PASS: TestAccIBMISVPC_dns_delegated_first (264.07s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     267.419s
--- PASS: TestAccIBMISVPC_dns_manual2 (97.81s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     99.260s
--- PASS: TestAccIBMISVPC_dns_manual (79.62s)
=== RUN   TestAccIBMISVPC_dns_manual2
--- PASS: TestAccIBMISVPC_dns_manual (80.59s)
=== RUN   TestAccIBMISVPC_dns_manual2
--- PASS: TestAccIBMISVPC_dns_manual2 (79.91s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     162.312s

@uibm
Copy link
Collaborator Author

uibm commented Jan 30, 2025

--- PASS: TestAccIBMISVPC_dns_delegated (331.00s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     332.870s

@hkantare
Copy link
Collaborator

Resolve the conflicts

@uibm
Copy link
Collaborator Author

uibm commented Jan 31, 2025

@hkantare resolved the conflicts

@uibm uibm requested a review from hkantare January 31, 2025 03:59
@uibm
Copy link
Collaborator Author

uibm commented Jan 31, 2025

--- PASS: TestAccIBMISVPC_dns_system (87.06s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     88.739s

@uibm
Copy link
Collaborator Author

uibm commented Jan 31, 2025

--- PASS: TestAccIBMISVPC_dns_manual (97.20s)
=== RUN   TestAccIBMISVPC_dns_manual2
--- PASS: TestAccIBMISVPC_dns_manual2 (89.77s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     188.804s

@uibm
Copy link
Collaborator Author

uibm commented Jan 31, 2025

--- PASS: TestAccIBMISVPC_basic_apm (110.15s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     111.941s
--- PASS: TestAccIBMISVPC_securityGroups (85.06s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     86.896s
--- PASS: TestAccIBMISVPC_noSGACLRules (67.51s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     69.301s
=== RUN   TestAccIBMISVPC_basic
--- PASS: TestAccIBMISVPC_basic (196.13s)
=== RUN   TestAccIBMISVPC_basic_apm
=== RUN   TestAccIBMISVPC_basicAddressPrefix
--- PASS: TestAccIBMISVPC_basicAddressPrefix (165.49s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     487.653s

@uibm
Copy link
Collaborator Author

uibm commented Jan 31, 2025


--- PASS: TestAccIBMISVPC_ResolverTypeTransition (407.77s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     409.541s

@uibm
Copy link
Collaborator Author

uibm commented Jan 31, 2025

--- PASS: TestAccIBMISVPC_dns_delegated (340.54s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     342.341s

--- PASS: TestAccIBMISVPC_dns_delegated_first (279.17s)
PASS
ok      github.com/IBM-Cloud/terraform-provider-ibm/ibm/service/vpc     280.978s

@uibm uibm self-assigned this Jan 31, 2025
@hkantare hkantare merged commit e50b298 into IBM-Cloud:master Jan 31, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants