Skip to content
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

ELB creation with multiple subnets in the same AZ cause "Default VPC not found" error #15899

Closed
5 tasks
harpermann opened this issue Aug 24, 2017 · 3 comments
Closed
5 tasks

Comments

@harpermann
Copy link

harpermann commented Aug 24, 2017

Hi Hashicorp,
Terraform is great stuff. We're using it a ton. We found a minor bug were we get a misleading error message.

Terraform Version

** terraform -v = Terraform v0.9.8 **

Terraform Configuration Files

**ELB with multiple subnets in same AZ in subnet ids**
resource "aws_elb" "jenkins" {
  name               = "elb-jenkins-${var.dp_env}"
  #availability_zones = [  "us-west-2a", "use-west-2b", "us-west-2c" ]
  subnets            = [ "subnet-xxxxxxx", "subnet-xxxxxxxx", "subnet-xxxxxxxx", "subnet-xxxxxxxx", "subnet-xxxxxxx" ]
  security_groups    = [
    "${var.sg_app_elb}",
    "${var.sg_app_elb_ppd_apigw}",
    "${var.sg_app_elb_prd_apigw}",
    "${var.sg_app_elb_perf_portal}"
  ]

Debug Output

  • use subnets or availability_zones but not both on ELB Create. (with subnets defined and multiple subnets in the same AZ, and availability_zones commented out)
  • InvalidConfigurationRequest: Default VPC not found (with subnets commented and using only avaiability_zones)
  • Failure adding ELB subnets: InvalidConfigurationRequest: ELB cannot be attached to multiple subnets in the same AZ" (after creating ELB with subnets with one subnet per AZ, no availability_zones, then updating with multiple subnets in same AZ)

Crash Output

not crashing

Expected Behavior

**On ELB create with multiple subnets in the same AZ, should get error:
Failure adding ELB subnets: InvalidConfigurationRequest: ELB cannot be attached to multiple subnets in the same AZ
**

Actual Behavior

Got misleading "Default VPC not found" error

Steps to Reproduce

  • If we use only the subnets (some in same AZ), we get an error saying either we need to use subnets or availability_zones but not both on ELB Create.
  • if we coment out subnets and use 3 AZ's, we get the error on ELB Create: InvalidConfigurationRequest: Default VPC not found
  • If we start with 3 subnets not in multi AZ's ELB create works.
  • if we add 3 more subnets in same AZ's for a total of 6, we get " Failure adding ELB subnets: InvalidConfigurationRequest: ELB cannot be attached to multiple subnets in the same AZ"
  • This is likely the error we want in the first case.

Important Factoids

Are there anything atypical about your situation that we should know? For example: is Terraform running in a wrapper script or in a CI system? Are you passing any unusual command line options or environment variables to opt-in to non-default behavior?

  • We run with a wrapper script, but this is TF configuration and not caused by the script.

References

Looked but couldn't find related issues.

@hashibot
Copy link
Contributor

This issue has been automatically migrated to hashicorp/terraform-provider-aws#1497 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to this issue and let us know.

@abhishikth01
Copy link

not able to launch elb in a new VPC. it launches in the default vpc of mine.

@ghost
Copy link

ghost commented Apr 7, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants