oracle / oci-designer-toolkit

OCI designer toolKIT (OKIT) is a set of tools for enabling design, deploy and visualise OCI environments through a graphical web based interface.
Universal Permissive License v1.0
262 stars 123 forks source link

BUG: OKIT 0.60.0 and 0.61.0 generates incorrect TF code for DRG #649

Closed samktan closed 1 week ago

samktan commented 2 months ago

OKIT generates Terraform (TF) scripts that attempt to set the default route pointing to the DRG attachement which is wrong, it should be pointing to the DRG itself. See examples below from network.tf file.

This is in the network.tf file:-

------ Create DRG Attachment

resource "oci_core_drg_attachment" "Okit_DRGA_1720136222231" { drg_id = local.Okit_DRG_1720136217826_id <-- THIS IS THE DRG ID vcn_id = local.Okit_VCN_1720136040877_id <-- THIS IS THE VCN ID display_name = "au-drg-attachment" freeform_tags = {"okit_version": "0.61.0", "okit_model_id": "okit-model-2722e0e0-8a06-43a6-bc12-4de803254e5f", "okit_reference": "okit-6ba8d58f-7872-45e4-b09d-ad0fc048da7e"} }

locals { Okit_DRGA_1720136222231_id = oci_core_drg_attachment.Okit_DRGA_1720136222231.id <-- THIS IS THE DRG ATTACHMENT ID }

------ Create Route Table

------- Update VCN Default Route Table

resource "oci_core_default_route_table" "Okit_RT_1720136040882" {

Required

manage_default_resource_id = local.Okit_VCN_1720136040877_default_route_table_id
route_rules    {
    destination_type  = "CIDR_BLOCK"
    destination       = "0.0.0.0/0"
    network_entity_id = local.Okit_DRGA_1720136222231_id   <-- THIS IS WRONG
    network_entity_id = local.Okit_DRG_1720136217826_id   <-- IT SHOULD BE THIS
    description       = "Default Gateway DRG"
}
# Optional
display_name   = "au-routetable"
freeform_tags  = {"okit_version": "0.61.0", "okit_model_id": "okit-model-2722e0e0-8a06-43a6-bc12-4de803254e5f", "okit_reference": "okit-4bcf7065-d444-4c28-8cdc-ad29e3367d93"}

}

samktan commented 1 month ago

Could someone please look into this bug report? Not being able to generate TF code for DRGs is a big limitation of the tool.

toxophilist commented 1 week ago

Reverted functionality to DRGv1 in release 0.63.0