InvalidVPCNetworkStateFault: Your subnet group doesn't have enough availability zones for a storage

2,429 views
Skip to first unread message

sanjay naikwadi

unread,
Nov 6, 2017, 4:16:40 AM11/6/17
to Terraform
1 error(s) occurred:

* aws_rds_cluster.automation: 1 error(s) occurred:

* aws_rds_cluster.automation: InvalidVPCNetworkStateFault: Your subnet group doesn't have enough availability zones for a storage cluster. You must have at least two availability zones to map to a storage cluster.
        status code: 400, request id: c53a9eb6-31bb-4308-9d58-41c7bfc7d049

Since today morning I am getting the following error, there has been no change in my terraform code, this code use to work without any issues like 3-4 weeks back ago, has there been anything changed on AWS side ? or any one is aware of this error ??

Any help would be appreciated.

Regards
Sanjay NAikwadi

Lowe Schmidt

unread,
Nov 6, 2017, 4:37:00 AM11/6/17
to terrafo...@googlegroups.com
What region are you in?
What does the code look like? 

--
Lowe Schmidt | +46 723 867 157

--
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-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/1312c9db-afca-43b7-897b-fa221a57198e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sanjay naikwadi

unread,
Nov 6, 2017, 6:09:01 AM11/6/17
to Terraform
Region : us-east-1

Code :

data "aws_availability_zones" "available" {
  state = "available"
}

resource "aws_subnet" "1a-public" {
        vpc_id = "${aws_vpc.automation-vpc.id}"
        cidr_block = "${var.public_subnet_cidr}"
        availability_zone = "${data.aws_availability_zones.available.names[0]}"
        map_public_ip_on_launch = true
        tags {
        Name = "Public 1A"
    }

}

resource "aws_subnet" "1b-public" {
        vpc_id = "${aws_vpc.automation-vpc.id}"
        cidr_block = "${var.private_subnet_cidr}"
         availability_zone = "${data.aws_availability_zones.available.names[1]}"
        map_public_ip_on_launch = true
        tags {
        Name = "Public 1B"
    }

}

## VPC Variables

variable "vpc_cidr" {
    description = "CIDR for the whole VPC"
    default = "10.0.0.0/16"
}

variable "public_subnet_cidr" {
    description = "CIDR for the Public Subnet"
    default = "10.0.1.0/24"
}

variable "private_subnet_cidr" {
    description = "CIDR for the Private Subnet"
    default = "10.0.2.0/24"
}

## RDS

# RDS DB Subnet Group

resource "aws_db_subnet_group" "automation-db-subnet-group" {
  name       = "automation-db-subnet-group"

  tags {
    Name = "automation-db-subnet-group"
  }
}

resource "aws_rds_cluster_instance" "kp-aurora" {
  count              = 2
  identifier         = "kp-aurora-${count.index}"
  cluster_identifier = "${aws_rds_cluster.automation.id}"
  instance_class     = "db.t2.small"
  publicly_accessible   = "true"
  db_parameter_group_name = "${aws_db_parameter_group.automation-db-para-group.id}"
}

resource "aws_rds_cluster" "automation" {
  cluster_identifier = "kp"
  vpc_security_group_ids = [ "${aws_security_group.automation_vpc_secgroup.id}" ]
  database_name      = "mydb"
  master_username    = "admin"
  master_password    = "info1234567890"
  db_cluster_parameter_group_name = "${aws_rds_cluster_parameter_group.automation-cl-para-group.id}"
  skip_final_snapshot = "true"
}

This use to work, but today getting the error.

Regards
Sanjay NAikwadi


On Monday, November 6, 2017 at 3:07:00 PM UTC+5:30, Lowe Schmidt wrote:
What region are you in?
What does the code look like? 

--
Lowe Schmidt | +46 723 867 157

On 6 November 2017 at 10:16, sanjay naikwadi <sanjay....@gmail.com> wrote:
1 error(s) occurred:

* aws_rds_cluster.automation: 1 error(s) occurred:

* aws_rds_cluster.automation: InvalidVPCNetworkStateFault: Your subnet group doesn't have enough availability zones for a storage cluster. You must have at least two availability zones to map to a storage cluster.
        status code: 400, request id: c53a9eb6-31bb-4308-9d58-41c7bfc7d049

Since today morning I am getting the following error, there has been no change in my terraform code, this code use to work without any issues like 3-4 weeks back ago, has there been anything changed on AWS side ? or any one is aware of this error ??

Any help would be appreciated.

Regards
Sanjay NAikwadi

--
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.

Lowe Schmidt

unread,
Nov 6, 2017, 2:56:18 PM11/6/17
to terrafo...@googlegroups.com
My guess is that this code here only returned one AZ.

data "aws_availability_zones" "available" {
  state = "available"
}

Which made this part here only have one subnet id 

resource "aws_db_subnet_group" "automation-db-subnet-group" {
  name       = "automation-db-subnet-group"

  tags {
    Name = "automation-db-subnet-group"
  }
}

Have you ran this after this errors occurred?

--
Lowe Schmidt | +46 723 867 157

To unsubscribe from this group and stop receiving emails from it, send an email to terraform-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/f22cc9f1-8f04-4be8-9e31-47b4713be9c4%40googlegroups.com.

sanjay naikwadi

unread,
Nov 7, 2017, 12:07:54 AM11/7/17
to Terraform
From error it looks error came when RDS cluster creation was run, if I see the output of "terraform show" it lists the availability zone.

Lucas Rafagnin

unread,
Dec 28, 2017, 12:19:37 AM12/28/17
to Terraform
I contacted AWS and they told me this is because Aurora is not available on us-east-1b and us-east-1f
There is no documentation about it and they are looking to add these AZs, but in the meantime you'll need to use another AZ
Reply all
Reply to author
Forward
0 new messages