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

VPCZoneIdentifier cannot be empty #6417

Closed
joshuaspence opened this issue Apr 29, 2016 · 3 comments · Fixed by hashicorp/terraform-provider-aws#1191
Closed

VPCZoneIdentifier cannot be empty #6417

joshuaspence opened this issue Apr 29, 2016 · 3 comments · Fixed by hashicorp/terraform-provider-aws#1191
Assignees
Labels
bug provider/aws waiting-response An issue/pull request is waiting for a response from the community

Comments

@joshuaspence
Copy link
Contributor

I have a module that I use for creating AWS autoscaling groups. I have the following variable defined within my module:

variable "vpc_zone_identifier" {
  type        = "string"
  default     = ""
  description = "A comma-separated list of subnet IDs to launch resources in."
}

I then have the following Terraform code:


resource "aws_autoscaling_group" "autoscaling_group" {
  name     = "${var.name}"
  max_size = "${var.max_size}"
  min_size = "${var.min_size}"

  availability_zones        = ["${split(",", var.availability_zones)}"]
  launch_configuration      = "${aws_launch_configuration.launch_configuration.name}"
  health_check_grace_period = "${var.health_check_grace_period}"
  health_check_type         = "${var.health_check_type}"
  desired_capacity          = "${var.desired_capacity}"
  load_balancers            = ["${compact(split(",", var.load_balancers))}"]
  vpc_zone_identifier       = ["${compact(split(",", var.vpc_zone_identifier))}"]
  termination_policies      = ["${compact(split(",", var.termination_policies))}"]

  wait_for_capacity_timeout = "${var.wait_for_capacity_timeout}"
  min_elb_capacity          = "${var.min_elb_capacity}"
  wait_for_elb_capacity     = "${var.wait_for_elb_capacity}"
}

If I try to use this code to create an ASG that is //not// within a VPC. I get an error from the AWS API:

* aws_autoscaling_group.autoscaling_group: Error updating Autoscaling group: InvalidParameter: 1 validation errors:
- field too short, minimum length 1: VPCZoneIdentifier

The following change seems to make things work again:

-  vpc_zone_identifier       = ["${compact(split(",", var.vpc_zone_identifier))}"]
+  vpc_zone_identifier       = ["${split(",", var.vpc_zone_identifier)}"]
@stack72
Copy link
Contributor

stack72 commented Aug 25, 2016

Hi @joshuaspence

I believe this will be fine now that we can pass lists rather than CSV based variables

Thoughts?

Paul

@stack72 stack72 added the waiting-response An issue/pull request is waiting for a response from the community label Aug 25, 2016
@stack72 stack72 self-assigned this Aug 25, 2016
@stack72
Copy link
Contributor

stack72 commented Sep 22, 2016

Closing this - not heard back in 28 days. Please do let me know if this is still an issue :)

@ghost
Copy link

ghost commented Apr 22, 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 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug provider/aws waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants