Skip to main content

subnet_groups

Creates, updates, deletes or gets a subnet_group resource or lists subnet_groups in a region

Overview

Namesubnet_groups
TypeResource
DescriptionThe AWS::MemoryDB::SubnetGroup resource creates an Amazon MemoryDB Subnet Group.
Idaws.memorydb.subnet_groups

Fields

NameDatatypeDescription
subnet_group_namestringThe name of the subnet group. This value must be unique as it also serves as the subnet group identifier.
descriptionstringAn optional description of the subnet group.
subnet_idsarrayA list of VPC subnet IDs for the subnet group.
tagsarrayAn array of key-value pairs to apply to this subnet group.
arnstringThe Amazon Resource Name (ARN) of the subnet group.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTSubnetGroupName, SubnetIds, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all subnet_groups in a region.

SELECT
region,
subnet_group_name,
description,
subnet_ids,
tags,
arn
FROM aws.memorydb.subnet_groups
WHERE region = 'us-east-1';

Gets all properties from an individual subnet_group.

SELECT
region,
subnet_group_name,
description,
subnet_ids,
tags,
arn
FROM aws.memorydb.subnet_groups
WHERE region = 'us-east-1' AND data__Identifier = '<SubnetGroupName>';

INSERT example

Use the following StackQL query and manifest file to create a new subnet_group resource, using stack-deploy.

/*+ create */
INSERT INTO aws.memorydb.subnet_groups (
SubnetGroupName,
SubnetIds,
region
)
SELECT
'{{ SubnetGroupName }}',
'{{ SubnetIds }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.memorydb.subnet_groups
WHERE data__Identifier = '<SubnetGroupName>'
AND region = 'us-east-1';

Permissions

To operate on the subnet_groups resource, the following permissions are required:

Create

memorydb:CreateSubnetGroup,
memorydb:DescribeSubnetGroups,
memorydb:TagResource,
memorydb:ListTags

Read

memorydb:DescribeSubnetGroups,
memorydb:ListTags

Update

memorydb:UpdateSubnetGroup,
memorydb:DescribeSubnetGroups,
memorydb:ListTags,
memorydb:TagResource,
memorydb:UntagResource

Delete

memorydb:DeleteSubnetGroup,
memorydb:DescribeSubnetGroups

List

memorydb:DescribeSubnetGroups