Skip to main content

db_subnet_groups

Creates, updates, deletes, gets or lists a db_subnet_groups resource.

Overview

Namedb_subnet_groups
TypeResource
Idaws.docdb.db_subnet_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
db_subnet_group_arnstringThe Amazon Resource Name (ARN) for the DB subnet group.
db_subnet_group_descriptionstringProvides the description of the subnet group.
db_subnet_group_namestringThe name of the subnet group.
subnet_group_statusstringProvides the status of the subnet group.
subnetsstringDetailed information about one or more subnets within a subnet group.
supported_network_typesstringThe network type of the DB subnet group. Valid Values: IPV4 | DUAL A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and the IPv6 protocols (DUAL).
vpc_idstringProvides the virtual private cloud (VPC) ID of the subnet group.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_db_subnet_groupsselectregionDBSubnetGroupName, Filters, MaxRecords, MarkerReturns a list of DBSubnetGroup descriptions. If a DBSubnetGroupName is specified, the list will contain only the descriptions of the specified DBSubnetGroup.
create_db_subnet_groupinsertDBSubnetGroupName, DBSubnetGroupDescription, SubnetIds, regionTagsCreates a new subnet group. subnet groups must contain at least one subnet in at least two Availability Zones in the Amazon Web Services Region.
modify_db_subnet_groupupdateDBSubnetGroupName, SubnetIds, regionDBSubnetGroupDescriptionModifies an existing subnet group. subnet groups must contain at least one subnet in at least two Availability Zones in the Amazon Web Services Region.
delete_db_subnet_groupdeleteDBSubnetGroupName, regionDeletes a subnet group. The specified database subnet group must not be associated with any DB instances.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
DBSubnetGroupDescriptionstringThe description for the subnet group.
DBSubnetGroupNamestringThe name of the database subnet group to delete. You can't delete the default subnet group. Constraints: Must match the name of an existing DBSubnetGroup. Must not be default. Example: mySubnetgroup
SubnetIdsarrayThe Amazon EC2 subnet IDs for the subnet group.
regionstringAWS region (default: us-east-1)
DBSubnetGroupDescriptionstringThe description for the subnet group.
DBSubnetGroupNamestringThe name of the subnet group to return details for.
FiltersarrayThis parameter is not currently supported.
MarkerstringAn optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.
MaxRecordsintegerThe maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a pagination token (marker) is included in the response so that the remaining results can be retrieved. Default: 100 Constraints: Minimum 20, maximum 100.
TagsarrayThe tags to be assigned to the subnet group.

SELECT examples

Returns a list of DBSubnetGroup descriptions. If a DBSubnetGroupName is specified, the list will contain only the descriptions of the specified DBSubnetGroup.

SELECT
db_subnet_group_arn,
db_subnet_group_description,
db_subnet_group_name,
subnet_group_status,
subnets,
supported_network_types,
vpc_id
FROM aws.docdb.db_subnet_groups
WHERE region = '{{ region }}' -- required
AND DBSubnetGroupName = '{{ DBSubnetGroupName }}'
AND Filters = '{{ Filters }}'
AND MaxRecords = '{{ MaxRecords }}'
AND Marker = '{{ Marker }}'
;

INSERT examples

Creates a new subnet group. subnet groups must contain at least one subnet in at least two Availability Zones in the Amazon Web Services Region.

INSERT INTO aws.docdb.db_subnet_groups (
DBSubnetGroupName,
DBSubnetGroupDescription,
SubnetIds,
region,
Tags
)
SELECT
'{{ DBSubnetGroupName }}',
'{{ DBSubnetGroupDescription }}',
'{{ SubnetIds }}',
'{{ region }}',
'{{ Tags }}'
RETURNING
db_subnet_group_arn,
db_subnet_group_description,
db_subnet_group_name,
subnet_group_status,
subnets,
supported_network_types,
vpc_id
;

UPDATE examples

Modifies an existing subnet group. subnet groups must contain at least one subnet in at least two Availability Zones in the Amazon Web Services Region.

UPDATE aws.docdb.db_subnet_groups
SET
-- No updatable properties
WHERE
DBSubnetGroupName = '{{ DBSubnetGroupName }}' --required
AND SubnetIds = '{{ SubnetIds }}' --required
AND region = '{{ region }}' --required
AND DBSubnetGroupDescription = '{{ DBSubnetGroupDescription}}'
RETURNING
db_subnet_group_arn,
db_subnet_group_description,
db_subnet_group_name,
subnet_group_status,
subnets,
supported_network_types,
vpc_id;

DELETE examples

Deletes a subnet group. The specified database subnet group must not be associated with any DB instances.

DELETE FROM aws.docdb.db_subnet_groups
WHERE DBSubnetGroupName = '{{ DBSubnetGroupName }}' --required
AND region = '{{ region }}' --required
;