-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
import block: generate config within local modules #35596
Comments
Thanks for this report! If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again! |
Related to #33376 |
I've relabelled this as an enhancement instead of a bug. There are three kinds of modules: local, registry and remote. Generating configuration for registry and remote based modules from the root module is not something that will ever be possible. It does seem possible that we could add support for generating configuration within local modules. It's worth noting there are considerable complications with this given the A workaround here would be to generate the configuration at the root level, and then move the generated configuration into the local module, before rerunning the plan command to connect the import block up to the correct module. If you're interested in this as a feature, please give a 👍 reaction to the original comment! |
Terraform Version
Terraform Configuration Files
Debug Output
https://gist.github.com/vazome/d639adc98c0999d0edae4abf80f4a816
Expected Behavior
Terraform creates resource configuration file for the given import
Actual Behavior
│ Error: Configuration for import target does not exist
│
│ on main.tf line 15, in import:
│ 15: to = module.azure-rg.azurerm_resource_group.rg-databricks
│
│ The configuration for the given import target module.azure-rg.azurerm_resource_group.rg-databricks does not exist. All target
│ instances must have an associated configuration to be imported.
Steps to Reproduce
terraform plan -generate-config-out=generated_resources.tf
Additional Context
This issue seems to be covered in this Japanese blog
References
No response
The text was updated successfully, but these errors were encountered: