Skip to main content
Added region to terraform config
Source Link

I'm attempting to create an AWS RDS Serverless v2 cluster in region ap-southeast-2 (Sydney) using the following Terraform configuration:

provider "aws" {
  region = "ap-southeast-2"
}

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

resource "aws_rds_cluster" "backend_app_db_cluster" {
  availability_zones = data.aws_availability_zones.available.names
  # ...
}

When I try to apply this configuration, I get the following error:

InvalidVPCNetworkStateFault: Availability zone '[ap-southeast-2c]' is unavailable in this region, please choose another zone set.

Full output:

module.database.aws_rds_cluster.backend_app_db_cluster: Creating...
╷
│ Error: creating RDS Cluster (<munged>20221204221217538100000001): InvalidVPCNetworkStateFault: Availability zone '[ap-southeast-2c]' is unavailable in this region, please choose another zone set.
│   status code: 400, request id: <munged>
│
│   with module.database.aws_rds_cluster.backend_app_db_cluster,
│   on modules/database/main.tf line 54, in resource "aws_rds_cluster" "backend_app_db_cluster":
│   54: resource "aws_rds_cluster" "backend_app_db_cluster" {

If I specify the availability zones manually and specifically exclude ap-southeast-2c, it works as expected:

data "aws_availability_zones" "available" {
  exclude_names = ["ap-southeast-2c"]
  state         = "available"
}
$ terraform apply
...
module.database.aws_rds_cluster_instance.backend_app_db_cluster_instance: Creation complete after 12m43s [id=tf-<munged>]

Apply complete! Resources: 3 added, 0 changed, 1 destroyed.

Why is aws_availability_zones returning an AZ that's unavailable?

I'm attempting to create an AWS RDS Serverless v2 cluster in region ap-southeast-2 (Sydney) using the following Terraform configuration:

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

resource "aws_rds_cluster" "backend_app_db_cluster" {
  availability_zones = data.aws_availability_zones.available.names
  # ...
}

When I try to apply this configuration, I get the following error:

InvalidVPCNetworkStateFault: Availability zone '[ap-southeast-2c]' is unavailable in this region, please choose another zone set.

Full output:

module.database.aws_rds_cluster.backend_app_db_cluster: Creating...
╷
│ Error: creating RDS Cluster (<munged>20221204221217538100000001): InvalidVPCNetworkStateFault: Availability zone '[ap-southeast-2c]' is unavailable in this region, please choose another zone set.
│   status code: 400, request id: <munged>
│
│   with module.database.aws_rds_cluster.backend_app_db_cluster,
│   on modules/database/main.tf line 54, in resource "aws_rds_cluster" "backend_app_db_cluster":
│   54: resource "aws_rds_cluster" "backend_app_db_cluster" {

If I specify the availability zones manually and specifically exclude ap-southeast-2c, it works as expected:

data "aws_availability_zones" "available" {
  exclude_names = ["ap-southeast-2c"]
  state         = "available"
}
$ terraform apply
...
module.database.aws_rds_cluster_instance.backend_app_db_cluster_instance: Creation complete after 12m43s [id=tf-<munged>]

Apply complete! Resources: 3 added, 0 changed, 1 destroyed.

Why is aws_availability_zones returning an AZ that's unavailable?

I'm attempting to create an AWS RDS Serverless v2 cluster in region ap-southeast-2 (Sydney) using the following Terraform configuration:

provider "aws" {
  region = "ap-southeast-2"
}

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

resource "aws_rds_cluster" "backend_app_db_cluster" {
  availability_zones = data.aws_availability_zones.available.names
  # ...
}

When I try to apply this configuration, I get the following error:

InvalidVPCNetworkStateFault: Availability zone '[ap-southeast-2c]' is unavailable in this region, please choose another zone set.

Full output:

module.database.aws_rds_cluster.backend_app_db_cluster: Creating...
╷
│ Error: creating RDS Cluster (<munged>20221204221217538100000001): InvalidVPCNetworkStateFault: Availability zone '[ap-southeast-2c]' is unavailable in this region, please choose another zone set.
│   status code: 400, request id: <munged>
│
│   with module.database.aws_rds_cluster.backend_app_db_cluster,
│   on modules/database/main.tf line 54, in resource "aws_rds_cluster" "backend_app_db_cluster":
│   54: resource "aws_rds_cluster" "backend_app_db_cluster" {

If I specify the availability zones manually and specifically exclude ap-southeast-2c, it works as expected:

data "aws_availability_zones" "available" {
  exclude_names = ["ap-southeast-2c"]
  state         = "available"
}
$ terraform apply
...
module.database.aws_rds_cluster_instance.backend_app_db_cluster_instance: Creation complete after 12m43s [id=tf-<munged>]

Apply complete! Resources: 3 added, 0 changed, 1 destroyed.

Why is aws_availability_zones returning an AZ that's unavailable?

Source Link

aws_availability_zones returns an availability zone ap-southeast-2c that is not available

I'm attempting to create an AWS RDS Serverless v2 cluster in region ap-southeast-2 (Sydney) using the following Terraform configuration:

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

resource "aws_rds_cluster" "backend_app_db_cluster" {
  availability_zones = data.aws_availability_zones.available.names
  # ...
}

When I try to apply this configuration, I get the following error:

InvalidVPCNetworkStateFault: Availability zone '[ap-southeast-2c]' is unavailable in this region, please choose another zone set.

Full output:

module.database.aws_rds_cluster.backend_app_db_cluster: Creating...
╷
│ Error: creating RDS Cluster (<munged>20221204221217538100000001): InvalidVPCNetworkStateFault: Availability zone '[ap-southeast-2c]' is unavailable in this region, please choose another zone set.
│   status code: 400, request id: <munged>
│
│   with module.database.aws_rds_cluster.backend_app_db_cluster,
│   on modules/database/main.tf line 54, in resource "aws_rds_cluster" "backend_app_db_cluster":
│   54: resource "aws_rds_cluster" "backend_app_db_cluster" {

If I specify the availability zones manually and specifically exclude ap-southeast-2c, it works as expected:

data "aws_availability_zones" "available" {
  exclude_names = ["ap-southeast-2c"]
  state         = "available"
}
$ terraform apply
...
module.database.aws_rds_cluster_instance.backend_app_db_cluster_instance: Creation complete after 12m43s [id=tf-<munged>]

Apply complete! Resources: 3 added, 0 changed, 1 destroyed.

Why is aws_availability_zones returning an AZ that's unavailable?