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 #1497

Closed
5 tasks
hashibot opened this issue Aug 24, 2017 · 3 comments
Closed
5 tasks
Labels
bug Addresses a defect in current functionality. service/elb Issues and PRs that pertain to the elb service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@hashibot
Copy link

This issue was originally opened by @harpermann as hashicorp/terraform#15899. It was migrated here as a result of the provider split. The original body of the issue is below.


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 hashibot added the bug Addresses a defect in current functionality. label Aug 24, 2017
@radeksimko radeksimko added the service/elb Issues and PRs that pertain to the elb service. label Jan 28, 2018
@kmcquade
Copy link

+1

@github-actions
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Mar 30, 2020
@ghost
Copy link

ghost commented May 31, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators May 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/elb Issues and PRs that pertain to the elb service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

3 participants