awscc_rds_db_subnet_group (Resource)

The AWS::RDS::DBSubnetGroup resource creates a database subnet group. Subnet groups must contain at least two subnets in two different Availability Zones in the same region. For more information, see Working with DB subnet groups in the Amazon RDS User Guide.

Example Usage

Basic usage - create database subnet group in us-east-1 region

resource "awscc_ec2_vpc" "main" {
  cidr_block = "10.0.0.0/16"
}

resource "awscc_ec2_subnet" "subnet_a" {
  vpc_id            = resource.awscc_ec2_vpc.main.id
  cidr_block        = "10.0.1.0/24"
  availability_zone = "us-east-1a"
}

resource "awscc_ec2_subnet" "subnet_b" {
  vpc_id            = resource.awscc_ec2_vpc.main.id
  cidr_block        = "10.0.2.0/24"
  availability_zone = "us-east-1b"
}

resource "awscc_rds_db_subnet_group" "example" {
  db_subnet_group_description = "example description"
  db_subnet_group_name        = "example-subnet-group"
  subnet_ids                  = [awscc_ec2_subnet.subnet_a.subnet_id, awscc_ec2_subnet.subnet_b.subnet_id]
}

Schema

Required

Optional

Read-Only

Nested Schema for tags

Required:

Optional:

Import

Import is supported using the following syntax:

$ terraform import awscc_rds_db_subnet_group.example <resource ID>