oracle-devrel / cd3-automation-toolkit

The CD3 Automation Toolkit generates Terraform modules from a design spec in an Excel sheet. It also enables a user to export an OCI tenancy into Excel and corresponding TF modules (and associated tfvars)
Universal Permissive License v1.0
53 stars 24 forks source link

Load Balancer Routing Policy Import Inaccuracies #125

Open Anay-Pampatwar opened 1 week ago

Anay-Pampatwar commented 1 week ago

Hello,

I've encountered some issues with the CD3 export of load balancer routing policies from our OCI Tenancy. The imported Terraform configuration doesn't accurately reflect the actual infrastructure for certain aspects of the routing rules. Here are the main problems I've identified:

  1. Truncation of Complex Conditions: For rules with numerous path conditions, the CD3 import truncates the list. For example:

    Imported (truncated):

    condition = "any(http.request.url.path sw (i '/Path1'), http.request.url.path sw (i '/Path2'), http.request.url.path sw (i '/Path3'),"

    Actual (full condition):

    condition = "any(http.request.url.path sw (i '/Path1'), http.request.url.path sw (i '/Path2'), http.request.url.path sw (i '/Path3'), http.request.url.path sw (i '/Path4'), http.request.url.path sw (i '/Path5'), ...)"
  2. Missing backend_set_names: Some rules have their backend_set_names incorrectly omitted in the CD3 import. For instance:

    Imported:

    {
     condition = "any(http.request.url.path sw (i '/SomePath'))"
     name = "route_example"
     backend_set_name = ""
    }

    Actual:

    {
     condition = "any(http.request.url.path sw (i '/SomePath'))"
     name = "route_example"
     backend_set_name = "ExampleBackendSet"
    }
  3. Incomplete Conditions: In some cases, only the beginning of a condition is captured. For example:

    Imported:

    condition = "any("

    Actual:

    condition = "any(http.request.url.path sw (i '/Path1'), http.request.url.path sw (i '/Path2'), ...)"

These inaccuracies require manual intervention to correct the Terraform configuration after using CD3 for export.

Environment details:

Steps to reproduce:

  1. Use CD3 to export resources from OCI Tenancy
  2. Check the exported Terraform configuration for load balancer routing policies
  3. Compare with the actual infrastructure using terraform plan

Expected behavior: CD3 should accurately capture all aspects of the load balancer routing policies, including full conditions and correct backend_set_names.

Actual behavior: The exported configuration has truncated conditions, missing backend_set_names, and in some cases, incomplete conditions.

xs2suruchi commented 1 week ago

Will look into this and revert asap.

xs2suruchi commented 1 week ago

Is it possible to share the Excel file may be just the 'LB-RoutingPolicy' to see how the exported data looks like? @Anay-Pampatwar

Anay-Pampatwar commented 1 week ago

@xs2suruchi Thanks for your response. I have sent the Excel file containing the 'LB-RoutingPolicy' sheet to you via a direct Slack message.