Skip to main content

db_subnet_groups

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

Overview

Namedb_subnet_groups
TypeResource
Idaws.neptune.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 DB subnet group.
db_subnet_group_namestringThe name of the DB subnet group.
subnet_group_statusstringProvides the status of the DB subnet group.
subnetsstringContains a list of Subnet elements.
supported_network_typesstringThe network types supported by the DB subnet group. Valid network types include IPV4 and DUAL. A DB subnet group supports DUAL if all subnets in the group have both IPv4 and IPv6 CIDRs.
vpc_idstringProvides the VpcId of the DB 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. For an overview of CIDR ranges, go to the Wikipedia Tutorial.
create_db_subnet_groupinsertDBSubnetGroupName, DBSubnetGroupDescription, SubnetIds, regionTagsCreates a new DB subnet group. DB subnet groups must contain at least one subnet in at least two AZs in the Amazon Region.
modify_db_subnet_groupupdateDBSubnetGroupName, SubnetIds, regionDBSubnetGroupDescriptionModifies an existing DB subnet group. DB subnet groups must contain at least one subnet in at least two AZs in the Amazon Region.
delete_db_subnet_groupdeleteDBSubnetGroupName, regionDeletes a DB 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 DB subnet group.
DBSubnetGroupNamestringThe name of the database subnet group to delete. You can't delete the default subnet group. Constraints: Constraints: Must match the name of an existing DBSubnetGroup. Must not be default. Example: mySubnetgroup
SubnetIdsarrayThe EC2 subnet IDs for the DB subnet group.
regionstringAWS region (default: us-east-1)
DBSubnetGroupDescriptionstringThe description for the DB subnet group.
DBSubnetGroupNamestringThe name of the DB subnet group to return details for.
FiltersarrayThis parameter is not currently supported.
MarkerstringAn optional pagination token provided by a previous DescribeDBSubnetGroups 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 called a 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 new DB 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. For an overview of CIDR ranges, go to the Wikipedia Tutorial.

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

INSERT examples

Creates a new DB subnet group. DB subnet groups must contain at least one subnet in at least two AZs in the Amazon Region.

INSERT INTO aws.neptune.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 DB subnet group. DB subnet groups must contain at least one subnet in at least two AZs in the Amazon Region.

UPDATE aws.neptune.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 DB subnet group. The specified database subnet group must not be associated with any DB instances.

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