Skip to main content

subnet_groups

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

Overview

Namesubnet_groups
TypeResource
Idaws.memorydb.subnet_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe ARN (Amazon Resource Name) of the subnet group.
descriptionstringA description of the subnet group
namestringThe name of the subnet group
subnetsarrayA list of subnets associated with the subnet group.
supported_network_typesarrayThe network types supported by this subnet group. Returns an array of strings that can include 'ipv4', 'ipv6', or both, indicating the IP address types that can be used for clusters deployed in this subnet group.
vpc_idstringThe Amazon Virtual Private Cloud identifier (VPC ID) of the subnet group.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_subnet_groupsselectregionReturns a list of subnet group descriptions. If a subnet group name is specified, the list contains only the description of that group.
create_subnet_groupinsertregion, SubnetGroupName, SubnetIdsCreates a subnet group. A subnet group is a collection of subnets (typically private) that you can designate for your clusters running in an Amazon Virtual Private Cloud (VPC) environment. When you create a cluster in an Amazon VPC, you must specify a subnet group. MemoryDB uses that subnet group to choose a subnet and IP addresses within that subnet to associate with your nodes. For more information, see Subnets and subnet groups.
update_subnet_groupupdateregion, SubnetGroupNameUpdates a subnet group. For more information, see Updating a subnet group
delete_subnet_groupdeleteregionDeletes a subnet group. You cannot delete a default subnet group or one that is associated with any clusters.

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
regionstringAWS region (default: us-east-1)

SELECT examples

Returns a list of subnet group descriptions. If a subnet group name is specified, the list contains only the description of that group.

SELECT
arn,
description,
name,
subnets,
supported_network_types,
vpc_id
FROM aws.memorydb.subnet_groups
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a subnet group. A subnet group is a collection of subnets (typically private) that you can designate for your clusters running in an Amazon Virtual Private Cloud (VPC) environment. When you create a cluster in an Amazon VPC, you must specify a subnet group. MemoryDB uses that subnet group to choose a subnet and IP addresses within that subnet to associate with your nodes. For more information, see Subnets and subnet groups.

INSERT INTO aws.memorydb.subnet_groups (
SubnetGroupName,
Description,
SubnetIds,
Tags,
region
)
SELECT
'{{ SubnetGroupName }}' /* required */,
'{{ Description }}',
'{{ SubnetIds }}' /* required */,
'{{ Tags }}',
'{{ region }}'
RETURNING
subnet_group
;

UPDATE examples

Updates a subnet group. For more information, see Updating a subnet group

UPDATE aws.memorydb.subnet_groups
SET
SubnetGroupName = '{{ SubnetGroupName }}',
Description = '{{ Description }}',
SubnetIds = '{{ SubnetIds }}'
WHERE
region = '{{ region }}' --required
AND SubnetGroupName = '{{ SubnetGroupName }}' --required
RETURNING
subnet_group;

DELETE examples

Deletes a subnet group. You cannot delete a default subnet group or one that is associated with any clusters.

DELETE FROM aws.memorydb.subnet_groups
WHERE region = '{{ region }}' --required
;