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
Open PR to remove providers from module #109
Comments
Is this really standard practice now? We need to pass providers into every module? |
No. The primary provider instance does not need an provider "aws" {
region = "us-east-1"
}
provider "aws" {
region = "us-east-2"
alias = "dr"
} The default provider is automatically passed through to modules for their use. Setting It is recommended best practice not to define providers within modules. It is really frustrating from a module provider's PoV as you cannot specify the minimum compatible provider version. This has caused confusion in the community VPC module a few times when e.g. the new tags-on-EIPs feature was used. Removing Chris's example is better written as:
|
Alright, let's do that now. I'll make a PR. |
How does this look? #168 |
PR is now merged so I'll close this issue. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I have issues
I'm submitting a...
What is the current behavior?
Currently, because of providers defined at the module level, you cannot delete the module to remove your infrastructure. Conversely, you have to use commands to remove items from the state file before you can delete. See #108
Per these 2 issues, it seems after terraform 0.11 these providers should no longer be in modules.
hashicorp/terraform#16824
hashicorp/terraform#17928
If this is a bug, how to reproduce? Please include a code sample if relevvant.
User Terraform > 0.11 and add the module to create infra, after the apply remove the code, you will get error.
What's the expected behavior?
All infra in this module is deleted.
Are you able to fix this problem and submit a PR? Link here if you have already.
Yes, but don't have permissions to contribute. eg create branch for a PR.
Environment details
Any other relevant info
Something like this should fix the issues, I tested locally and it works on my machine.
Next remove these lines from main.tf
The text was updated successfully, but these errors were encountered: