db_subnet_groups
Creates, updates, deletes, gets or lists a db_subnet_groups resource.
Overview
| Name | db_subnet_groups |
| Type | Resource |
| Id | aws.docdb.db_subnet_groups |
Fields
The following fields are returned by SELECT queries:
- describe_db_subnet_groups
| Name | Datatype | Description |
|---|---|---|
db_subnet_group_arn | string | The Amazon Resource Name (ARN) for the DB subnet group. |
db_subnet_group_description | string | Provides the description of the subnet group. |
db_subnet_group_name | string | The name of the subnet group. |
subnet_group_status | string | Provides the status of the subnet group. |
subnets | string | Detailed information about one or more subnets within a subnet group. |
supported_network_types | string | The 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_id | string | Provides the virtual private cloud (VPC) ID of the subnet group. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_db_subnet_groups | select | region | DBSubnetGroupName, Filters, MaxRecords, Marker | Returns a list of DBSubnetGroup descriptions. If a DBSubnetGroupName is specified, the list will contain only the descriptions of the specified DBSubnetGroup. |
create_db_subnet_group | insert | DBSubnetGroupName, DBSubnetGroupDescription, SubnetIds, region | Tags | 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. |
modify_db_subnet_group | update | DBSubnetGroupName, SubnetIds, region | DBSubnetGroupDescription | 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. |
delete_db_subnet_group | delete | DBSubnetGroupName, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
DBSubnetGroupDescription | string | The description for the subnet group. |
DBSubnetGroupName | string | The 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 |
SubnetIds | array | The Amazon EC2 subnet IDs for the subnet group. |
region | string | AWS region (default: us-east-1) |
DBSubnetGroupDescription | string | The description for the subnet group. |
DBSubnetGroupName | string | The name of the subnet group to return details for. |
Filters | array | This parameter is not currently supported. |
Marker | string | An 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. |
MaxRecords | integer | The 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. |
Tags | array | The tags to be assigned to the subnet group. |
SELECT examples
- describe_db_subnet_groups
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
- create_db_subnet_group
- Manifest
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
;
# Description fields are for documentation purposes
- name: db_subnet_groups
props:
- name: DBSubnetGroupName
value: "{{ DBSubnetGroupName }}"
description: Required parameter for the db_subnet_groups resource.
- name: DBSubnetGroupDescription
value: "{{ DBSubnetGroupDescription }}"
description: Required parameter for the db_subnet_groups resource.
- name: SubnetIds
value: "{{ SubnetIds }}"
description: Required parameter for the db_subnet_groups resource.
- name: region
value: "{{ region }}"
description: Required parameter for the db_subnet_groups resource.
- name: Tags
value: "{{ Tags }}"
description: The tags to be assigned to the subnet group.
description: The tags to be assigned to the subnet group.
UPDATE examples
- modify_db_subnet_group
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
- delete_db_subnet_group
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
;