-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
terraform prompts several times to enter a provider.aws.region when a certain number of nested modules is reached. #8680
Comments
Well this is strange. I just upgraded from 0.7.2 to 0.7.3 and the problem disappeared. Cannot tell why, even when taking a look in the change log. Will keep working in my "complex" modules for some hours and if the problem do not occur again will just close this ticket. |
The problem is still there. Right now I'm alternating between two almost identical modules (redis/memcached), one of them produces terraform to prompt for the region and the other one does not. Cannot see any differences between them. Will try to gather more information in order to create a test case. |
I just got a configuration setup in which I can reproduce the problem. But I cannot tell what the problem is. I'll try to get a simplified test case soon. This may take time because as of tomorrow will be in vacation for 2 weeks, so I'll not be able to work in this until then. |
Got an example for reproducing this problem, please check https://github.com/martin-flaregames/terraform-aws-region-prompt |
This is fixed with master (0.8) and we added a number of tests around this. :) |
Well the test provided at github.com/martin-flaregames/terraform-aws-region-prompt is still failing, I guess I must open another ticket with a more focused description. |
Sorry @martin-flaregames, I am pretty sure I ran your example and it passed so I must've missed something. I apologize!! I'll look at the new issue and move discussion over there. |
Any update on this? I'm using the same folder structure to modularize but it keeps asking me for the region as well. |
Currently on v0.9.1 and seeing the same 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. |
EDIT: in order to reproduce this issue check out https://github.com/martin-flaregames/terraform-aws-region-prompt and follow the instructions provided in README.md
EDIT: (!) Please notice that the prompt for
provider.aws.region
will only occur if your~./aws
credential configuration is missing the entry for the default region. If not, Terraform may silently just read and use those credentials instead of the ones declared in the AWS provider.Terraform is prompting me to manually specify the
provider.aws.region
although it is already configured and properly working. This occurs when my projects uses more or less deep or complex module structures, like: module uses module uses module, etc.If I do enter the region then there is a second problem, the provider fails with an error telling me that a specific VPC id cannot be found, although it actually exists and was created by the provider itself some seconds ago.
Funnily the problem disappears if I reduce the number of nested modules. See below.
Terraform Version
Terraform v0.7.2
Terraform v0.7.3
Terraform v0.7.4
Terraform v0.7.5
Terraform v0.7.6
Affected Resource(s)
Expected Behavior
The provider should be configured once and work in all childs
Actual Behavior
It fails after some few nested modules including other modules
Steps to Reproduce
rm -rf .terraform/modules
terraform get
terraform plan
terraform apply
Steps to Reproduce (detailed)
The relevant part of the project folder structure looks like this
The main test module is located in
/main/
and the nested module calls occur in this orderfrom
main/
module "mongolayer" { source = "../opsworks/layer/mongo" }
from
opsworks/layer/mongo/
module "realm" { source = "../../../security/realm" }
from
security/realm/
module "securitygroup" { source = "../group" }
module "allow" { source = "../allow" }
module "allowself" { source = "../allow" }
the number of times the region input is requested is in accordance with the number of modules used in the "realm" module.
As described before, when I enter
rm -rf .terraform/modules; terraform get; terraform plan
then terraform asks for the provider region several timesThe plan works as expected. And after executing
terraform apply
I get the prompt again.but the provider still fails.
Although that VPC was recently created by the AWS provider.
Current workaround
If I copy/paste the contents of
security/realm/
into theopsworks/layer/mongo/
module then all runs ok. So I reduced the number of nested modules and all seems to work again.References
Seems to be related to 4443
The text was updated successfully, but these errors were encountered: