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

Changing of subnet's DNS settings is not a one-step process #1922

Open
IngIhorMuzychka opened this issue Sep 8, 2022 · 1 comment
Open
Labels
enhancement otc-issue Blocked by OTC issues

Comments

@IngIhorMuzychka
Copy link

Hі, colleagues!

I met with the strange work of opentelekomcloud_vpc_subnet_v1.
When I create a resource without specifying the primary and secondary DNS I get the expected result (with default values):

resource "opentelekomcloud_vpc_subnet_v1" "subnet" {
  name          = "subnet-${var.project_name}"
  vpc_id        = opentelekomcloud_vpc_v1.vpc-1.id
  cidr          = var.project.frontend_subnet_cidr
  gateway_ip    = var.project.frontend_gateway_ip  
  tags          = var.tags
}

When I try to add or change existing values ​​in the created resource (for example, secondary DNS) and do not touch the primary one, it looks good on the plan, but after applying these changes, the secondary DNS overrides the primary and only one remains.

So, one subnet is already created based on this code:

resource "opentelekomcloud_vpc_subnet_v1" "subnet" {
  name          = "subnet-${var.project_name}"
  vpc_id        = opentelekomcloud_vpc_v1.vpc-1.id
  cidr          = var.project.frontend_subnet_cidr
  gateway_ip    = var.project.frontend_gateway_ip
  primary_dns   = "100.125.4.25"
  secondary_dns = "100.125.129.199"  
  tags          = var.tags
}

I want to make the following changes: secondary_dns = "100.125.129.199" -> "100.125.129.200"

Planning results:

Terraform will perform the following actions:

  # module.network.opentelekomcloud_vpc_subnet_v1.subnet will be updated in-place
  ~ resource "opentelekomcloud_vpc_subnet_v1" "subnet" {
        id              = "3c4f51cb-f7fc-4dc6-ac2b-8e2c7b721b66"
        name            = "subnet-project-name"
      ~ secondary_dns   = "100.125.129.199" -> "100.125.129.200"
        # (10 unchanged attributes hidden)
    }

So, keeping the same parameters as before, I run the plan again and get the following result:

Terraform will perform the following actions:

  # module.network.opentelekomcloud_vpc_subnet_v1.subnet will be updated in-place
  ~ resource "opentelekomcloud_vpc_subnet_v1" "subnet" {
        id            = "3c4f51cb-f7fc-4dc6-ac2b-8e2c7b721b66"
        name          = "subnet-project-name"
      ~ primary_dns   = "100.125.129.200" -> "100.125.4.25"
      + secondary_dns = "100.125.129.200"
        # (10 unchanged attributes hidden)
    }

After that I get the expected result, I wanted from the beginning, but after 2 runs of apply command..

It was originally planned, or is it a bug?
The problem is not critical, but it brings discomfort..

I will be grateful for a hint or an answer, thanks!

@anton-sidelnikov
Copy link
Member

@IngIhorMuzychka Hi this is a bug, created internal incident ONS-11395

@anton-sidelnikov anton-sidelnikov added otc-issue Blocked by OTC issues and removed accepted labels Sep 8, 2022
@anton-sidelnikov anton-sidelnikov removed their assignment Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement otc-issue Blocked by OTC issues
Projects
None yet
Development

No branches or pull requests

2 participants