Terraform apply occasionally prompts for 'region' in aws provider

823 views
Skip to first unread message

Chris Burrell

unread,
Feb 23, 2016, 4:47:57 AM2/23/16
to Terraform
Hi

I'm new to Terraform but I have some kind of weird issue where running the same command, without any code changes, I sometimes get prompted to enter the 'region'  for the AWS provider and sometimes not.

Any ideas what might be happening.

Here's case 1:
$ terraform plan -var-file=terraform.tfvars
provider.aws.region
  The region where AWS operations will take place. Examples
  are us-east-1, us-west-2, etc.

  Default: us-east-1
  Enter a value:


Here's case 2:
$ terraform plan -var-file=terraform.tfvars
Refreshing Terraform state prior to plan...


The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.

Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.

+ module.network.vpc.aws_vpc.environment
    cidr_block:                "" => "10.0.0.0/16"
    default_network_acl_id:    "" => "<computed>"
    default_security_group_id: "" => "<computed>"
    dhcp_options_id:           "" => "<computed>"
    enable_classiclink:        "" => "<computed>"
    enable_dns_hostnames:      "" => "<computed>"
    enable_dns_support:        "" => "<computed>"
    main_route_table_id:       "" => "<computed>"

+ module.network.subnet.aws_subnet.private-subnet.0
    availability_zone:       "" => "us-west-1a"
    cidr_block:              "" => "10.0.0.0/21"
    map_public_ip_on_launch: "" => "0"
    tags.#:                  "" => "1"
    tags.Name:               "" => "private-us-west-1a-sn"
    vpc_id:                  "" => "${var.vpc_id}"

+ module.network.subnet.aws_subnet.private-subnet.1
    availability_zone:       "" => "us-west-1b"
    cidr_block:              "" => "10.0.8.0/21"
    map_public_ip_on_launch: "" => "0"
    tags.#:                  "" => "1"
    tags.Name:               "" => "private-us-west-1b-sn"
    vpc_id:                  "" => "${var.vpc_id}"


Plan: 3 to add, 0 to change, 0 to destroy.

I'm on windows (using a linux shell, but same occurs in a standard command prompt). I can provide the relevant fragments if required.

Just not sure what's helpful given the same issue doesn't happen all the time. Is this a bug?
Chris

Justin Nauman

unread,
Feb 29, 2016, 8:51:34 AM2/29/16
to Terraform
By the looks of things, it may be this issue, which we ran into as well: https://github.com/hashicorp/terraform/issues/4865

We ended up just declaring the provider in the sub-modules for now. 

JRN 

Paul Hinze

unread,
Feb 29, 2016, 10:00:21 AM2/29/16
to terrafo...@googlegroups.com
We'll definitely get this fixed up. Just wanted to chime in with another workaround: each provider documents environment variables that can be used to configure it. If you use those variables it works around the nested module config inheritance bug.

Hope this helps!

Paul

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/a1752fb0-19c7-48df-bec0-fe9f24ec7313%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages