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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

TF plan showing recreate cluster is needed when a new subnet id is added to output variables #2146

Open
putharekulu opened this issue Jun 25, 2024 · 1 comment
Labels
bug In-Progress Terraform Team is working on the reproduce & fix

Comments

@putharekulu
Copy link

putharekulu commented Jun 25, 2024

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version and Provider Version

Terraform 0.13.5 (Used with OCI Shepherd)
OCI provider 5.45.0

Affected Resource(s)

oci_containerengine_cluster, oci_containerengine_node_pool

Terraform Configuration Files

resource "oci_containerengine_cluster" "cluster" {

  compartment_id       = var.compartment_id
  kubernetes_version = var.controlplane_kubernetes_version
  name               = var.name
  vcn_id             = var.service_vcn_id
  type                 = var.cluster_type

  endpoint_config {
    is_public_ip_enabled = true
    subnet_id            = var.k8s_endpoint_subnet_id
  }

  kms_key_id = var.encrypt_etcd ? var.kms_key_id : null

  options {

    add_ons {
      is_kubernetes_dashboard_enabled = var.is_kubernetes_dashboard_enabled
      is_tiller_enabled               = false
    }

    kubernetes_network_config {
      pods_cidr     = var.pods_cidr
      services_cidr = var.services_cidr
    }

    service_lb_subnet_ids = [var.service_lb_subnet_id]
  }
}

network module

// Test
resource "oci_core_subnet" "test_subnet" {
  cidr_block = 10.10.200.0/24
  compartment_id = var.compartment_id
  vcn_id = oci_core_vcn.service_vcn.id
  prohibit_public_ip_on_vnic = true
  display_name = "test_${oci_core_vcn.service_vcn.display_name}"
  dns_label = "justatest"
}

output "just_a_test" {
  value = oci_core_subnet.test_subnet.id
}

Expected Behavior

With adding a new subnet and output the subnet ID, no changes should be shown in terraform plan for OKE module.

Actual Behavior

Just add the subnet code and the terraform plan shows just creating of the subnet which is correct.
When I add an output variable to get the id of the new subnet, TF plan shows terminating and rebuilding the oke cluster. Plan shows this change

~ endpoint_config { 
            is_public_ip_enabled = true 
          - nsg_ids              = [] -> null 
          ~ subnet_id            = "ocid1.subnet.oc1.iad.xxxxxxxx -> (known after apply) # forces replacement 
        } 

Steps to Reproduce

terraform plan by adding new subnet and output variable

@putharekulu putharekulu changed the title TF plan showing recreate cluster is needed whenever a new output variable is added on oke module TF plan showing recreate cluster is needed whenever a new output variable is added on network module Jun 25, 2024
@putharekulu putharekulu changed the title TF plan showing recreate cluster is needed whenever a new output variable is added on network module TF plan showing recreate cluster is needed when a new subnet id is added to output variables Jun 25, 2024
@tf-oci-pub tf-oci-pub added the In-Progress Terraform Team is working on the reproduce & fix label Jun 26, 2024
@tf-oci-pub
Copy link
Member

Thank you for reporting the issue. We have raised an internal ticket to track this. Our service engineers will get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug In-Progress Terraform Team is working on the reproduce & fix
Projects
None yet
Development

No branches or pull requests

2 participants