I am using Terraform modules to maintain multiple environments and for one of the resources in modules, there is an optional argument that I only want to use for one environment and not the rest of them.
For example, in the resource below I only want the argument node_shape_config to be applied for one environment and not the rest of them. Is there a way to do this in terraform?
resource "oci_containerengine_node_pool" "nodepools" {
cluster_id = oci_containerengine_cluster.k8s_cluster.id
compartment_id = var.oci_vcn.compartment_id
depends_on = ["oci_containerengine_cluster.k8s_cluster"]
kubernetes_version = var.oke_cluster.kubernetes_version
name = "${var.oci_vcn.label_prefix}-np-${count.index + 1}"
subnet_ids = [var.oke_cluster.worker_subnet_id_1, var.oke_cluster.worker_subnet_id_2, var.oke_cluster.worker_subnet_id_3]
node_shape_config {
#Optional
ocpus = 4
}
node_source_details {
image_id = var.node_pools.create_custom_image == true ? var.node_pools.custom_image_id : var.node_pools.node_pool_node_image_id
source_type = "IMAGE"
}
...
...
...
count = var.node_pools.node_pool_count
}