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 | The AWS::MemoryDB::SubnetGroup resource creates an Amazon MemoryDB Subnet Group. |
Id | aws.memorydb.subnet_groups |
Fields
Name | Datatype | Description |
---|---|---|
subnet_group_name | string | The name of the subnet group. This value must be unique as it also serves as the subnet group identifier. |
description | string | An optional description of the subnet group. |
subnet_ids | array | A list of VPC subnet IDs for the subnet group. |
tags | array | An array of key-value pairs to apply to this subnet group. |
arn | string | The Amazon Resource Name (ARN) of the subnet group. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | SubnetGroupName, 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,
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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.memorydb.subnet_groups (
SubnetGroupName,
SubnetIds,
region
)
SELECT
'{{ SubnetGroupName }}',
'{{ SubnetIds }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.memorydb.subnet_groups (
SubnetGroupName,
Description,
SubnetIds,
Tags,
region
)
SELECT
'{{ SubnetGroupName }}',
'{{ Description }}',
'{{ SubnetIds }}',
'{{ 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: SubnetGroupName
value: '{{ SubnetGroupName }}'
- name: Description
value: '{{ Description }}'
- name: SubnetIds
value:
- '{{ SubnetIds[0] }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
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