subnet_groups
Creates, updates, deletes or gets a subnet_group
resource or lists subnet_groups
in a region
Overview
Name | subnet_groups |
Type | Resource |
Description | Resource Type definition for AWS::ElastiCache::SubnetGroup |
Id | aws.elasticache.subnet_groups |
Fields
Name | Datatype | Description |
---|---|---|
description | string | The description for the cache subnet group. |
subnet_ids | array | The EC2 subnet IDs for the cache subnet group. |
cache_subnet_group_name | string | The name for the cache subnet group. This value is stored as a lowercase string. |
tags | array | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Description, SubnetIds, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.elasticache.subnet_groups (
Description,
SubnetIds,
region
)
SELECT
'{{ Description }}',
'{{ SubnetIds }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.elasticache.subnet_groups (
Description,
SubnetIds,
CacheSubnetGroupName,
Tags,
region
)
SELECT
'{{ Description }}',
'{{ SubnetIds }}',
'{{ CacheSubnetGroupName }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: subnet_group
props:
- name: Description
value: '{{ Description }}'
- name: SubnetIds
value:
- '{{ SubnetIds[0] }}'
- name: CacheSubnetGroupName
value: '{{ CacheSubnetGroupName }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
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