cf-terraforming icon indicating copy to clipboard operation
cf-terraforming copied to clipboard

Incorrect Terraform Code Generate and State Import

Open lokeshsharma000 opened this issue 1 year ago • 0 comments

Confirmation

  • [X] My issue isn't already found on the issue tracker.
  • [X] I have replicated my issue using the latest version of the library and it is still present.

cf-terraforming version

0.19.0

Expected outcome

Expected to have the correct Terraform code generated and State Imported.

cloudflare_custom_ssl --> Identified that the Terraform Code was incomplete/incorrect (only zone_id was generated for custom ssl resource Terraform code), While the State contained most parameters for that resource. This led to a drift with Original configurations on Cloudflare Screenshot 2024-03-08 at 1 00 37 PM

Screenshot 2024-03-25 at 11 24 45 AM

cloudflare_load_balancer --> Identified that the Terraform Code has parameters which are not Imported in the State. This causes a drift with every merge Screenshot 2024-03-08 at 1 36 36 PM

Screenshot 2024-03-08 at 1 38 32 PM

Actual outcome

Expecting correct Terraform generate and State Import

Steps to reproduce

  1. Upload custom SSL certificate for your Zone in Cloudflare dashboard.
  2. use generate function of cf-terraforming to generate the Terraform code for cloudflare_custom_ssl resource of your zone from step-1
  3. Observe that the generated code only has Zone ID parameter
  4. Import State from the generated resource from Step-2
  5. Observe that State contains most parameters which are not part of generated Terraform Code.
  6. Perform Terraform Plan and observe that there is drift

References

No response

lokeshsharma000 avatar Mar 25 '24 03:03 lokeshsharma000