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
DescriptionResource Type definition for AWS::ElastiCache::SubnetGroup
Idaws.elasticache.subnet_groups

Fields

NameDatatypeDescription
descriptionstringThe description for the cache subnet group.
subnet_idsarrayThe EC2 subnet IDs for the cache subnet group.
cache_subnet_group_namestringThe name for the cache subnet group. This value is stored as a lowercase string.
tagsarray
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTDescription, 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,
description,
subnet_ids,
cache_subnet_group_name,
tags
FROM aws.elasticache.subnet_groups
WHERE region = 'us-east-1';

Gets all properties from an individual subnet_group.

SELECT
region,
description,
subnet_ids,
cache_subnet_group_name,
tags
FROM aws.elasticache.subnet_groups
WHERE region = 'us-east-1' AND data__Identifier = '<CacheSubnetGroupName>';

INSERT example

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

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

DELETE example

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

Permissions

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

Create

elasticache:CreateCacheSubnetGroup,
elasticache:AddTagsToResource,
elasticache:DescribeCacheSubnetGroups,
elasticache:ListTagsForResource

Read

elasticache:DescribeCacheSubnetGroups,
elasticache:ListTagsForResource

Delete

elasticache:DeleteCacheSubnetGroup,
elasticache:DescribeCacheSubnetGroups,
elasticache:ListTagsForResource

List

elasticache:DescribeCacheSubnetGroups

Update

elasticache:ModifyCacheSubnetGroup,
elasticache:DescribeCacheSubnetGroups,
elasticache:AddTagsToResource,
elasticache:RemoveTagsFromResource