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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Current difference between aztfexport & official Terraform 1.5.0-beta2 configuration generator? #406

Open
majorku5anagi opened this issue May 30, 2023 · 2 comments
Labels
question Further information is requested

Comments

@majorku5anagi
Copy link

majorku5anagi commented May 30, 2023

Hi, just wanted to ask what is the current difference in generated HCL code given the fact that the latest beta realease of Terraform now finally has this long anticipated and similar functionality? When using import blocks as part of the configuration in .tf files and terraform plan -generate-config-out=PATH it imports already existing cloud infrastructure mentioned in the import block and generates the HCL code in similar manner like aztfexport so I just wanted to know if the roots of this functionality is the same for both of them or the quality varies? Has anyone compared them yet? I'm asking only about the end quality of the imported configuration atm.

@magodo magodo added the question Further information is requested label May 31, 2023
@magodo
Copy link
Collaborator

magodo commented May 31, 2023

@majorku5anagi Thank you for asking this! There are following nuances of the aztfexport generated configurations comparing to terraform plannable import:

  1. The generated configuration is provider schema aware, which ideally make the configuration to be "valid". See https://github.com/magodo/tfadd#intro and https://github.com/magodo/tfpluginschema for details. While the "plannable import" is only aware of the core schema, which has less information than needed to generate a valid config, which means users will likely have to modify the config before it can be used.
  2. The generated configuration has dependency injected based on the Azure resource id relationships. This is something "plannable import" can't afford since it only has "Terraform" resource id, which might not be the same as its Azure id sometimes.

Whilst, aztfexport can also play well together with "plannable import". "plannable import" is not good at discovering resources today, which in contrast is what aztfexport good at. In which case, with #398 merged, users can use aztfexport to discover resources and generate the import blocks, and then consume it via "plannable import".

@magodo magodo pinned this issue May 31, 2023
@stemaMSFT
Copy link
Member

To further add on to what @magodo has mentioned, we were and are continuing to work closely with HashiCorp in regards to their plannable import functionality. The hope is that both parties can benefit from both solutions to make all of you enjoy a smoother experience on Terraform for Azure.

@xuzhang3 xuzhang3 unpinned this issue Dec 13, 2023
@magodo magodo pinned this issue Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants