-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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 0.9.11 prompting user for value for provider.aws.region #15524
Comments
I'm seeing this too |
getting the same issue. So the atlas plan failed due to this issue. |
I found out the reason I encountered this issue was because I hadn't created a default aws provider. My stack was targetting multiple aws accounts so originally all my aws providers had aliases defined, and all my resources referenced one of these provider aliases. Despite this, Terraform plan/apply was asking for a
I think this is different to the problem the OP is referring to, but hopefully it helps someone. |
I'm experiencing this issue as well only I don't have a single |
Experiencing this issue as well when running a |
Having this issue with Terraform v0.11.1 as well. |
I'm seeing this again as well, using v0.11.2. Worked fine in v0.10.8 |
I'm still seeing this in 0.11.7, example module: https://github.com/traveloka/terraform-aws-iam-role/tree/master/modules/service |
Hi all! I think there may be a few different causes here leading to the same symptom. @revprez, in your case I see your You also have As a result, as far as Terraform is concerned you really have two completely-separate configurations here. In order to get the expected behavior, the The usual way to arrange things in a multi-environment scenario is to have a root module for each environment, and then factor out the items that are common to all environments into a child module. The provider configurations then live inside the environment-specific root module. In your case, this would mean that your variable "profile" {
type = "string"
}
variable "region" {
type = "string"
default = "us-east-1"
}
provider "aws" {
profile = "${var.profile}"
region = "${var.region}"
}
module "vpc" {
source = "../../modules/vpc"
} ...and then this other directory resource "aws_vpc" "promptbug-vpc" {
cidr_block = "10.0.0.0/16"
tags {
Name = "promptbug-vpc"
}
} The child module, containing the For others who have commented in this issue, without configuration examples I can't be sure exactly what is going on for you, but it may help to understand what causes Terraform to display these input prompts: Early on in its processing, Terraform goes through a process of associating each The full behavior for this resource-to-provider matching is detailed in Providers within Modules, but here's a summary:
(The provider selection behavior changed in Terraform v0.11, so the above is describing v0.11 and does not apply exactly to prior versions. Earlier versions have behavior that is similar in spirit, however.) Finally, Terraform then visits each of the With all of the above in mind, a common cause of unwanted input prompts is having a @salvianreynaldi, this seems to be the reason for the behavior in your example: your root module contains In most cases, I hope the above information helps explain the behavior you are all seeing. If you are on Terraform 0.11.0 or higher and are seeing behavior different than I described above, please do open a new issue and share your configuration so we can try to reproduce it. Since the original request here describes expected behavior, I'm going to 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. |
References
Terraform Version
0.9.11
Affected Resource(s)
Provider
aws
Example configuration
Example project is available here.
Project structure
Key project file contents
modules/providers/aws/variables.tf
:modules/providers/aws/main.tf
:deployments/qa/promptbug/main.tf
:Expected Behavior
VPC is created without incident or prompt.
Actual Behavior
User is prompted immediately to supply value for
provider.aws.region
:Steps to Reproduce
The text was updated successfully, but these errors were encountered: