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.
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]
}
db_subnet_group_description
(String) The description for the DB subnet group.subnet_ids
(List of String) The EC2 Subnet IDs for the DB subnet group.db_subnet_group_name
(String) The name for the DB subnet group. This value is stored as a lowercase string.
Constraints: Must contain no more than 255 lowercase alphanumeric characters or hyphens. Must not be "Default".
Example: mysubnetgroup
tags
(Attributes List) An optional array of key-value pairs to apply to this DB subnet group. (see below for nested schema)id
(String) Uniquely identifies the resource.tags
Required:
key
(String) A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length and can't be prefixed with aws:
or rds:
. The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$").Optional:
value
(String) A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length and can't be prefixed with aws:
or rds:
. The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$").Import is supported using the following syntax:
$ terraform import awscc_rds_db_subnet_group.example <resource ID>