subnet_groups
Creates, updates, deletes, gets or lists a subnet_groups resource.
Overview
| Name | subnet_groups |
| Type | Resource |
| Id | aws.memorydb.subnet_groups |
Fields
The following fields are returned by SELECT queries:
- describe_subnet_groups
| Name | Datatype | Description |
|---|---|---|
arn | string | The ARN (Amazon Resource Name) of the subnet group. |
description | string | A description of the subnet group |
name | string | The name of the subnet group |
subnets | array | A list of subnets associated with the subnet group. |
supported_network_types | array | The 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_id | string | The Amazon Virtual Private Cloud identifier (VPC ID) of the subnet group. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_subnet_groups | select | region | Returns a list of subnet group descriptions. If a subnet group name is specified, the list contains only the description of that group. | |
create_subnet_group | insert | region, SubnetGroupName, SubnetIds | 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. | |
update_subnet_group | update | region, SubnetGroupName | Updates a subnet group. For more information, see Updating a subnet group | |
delete_subnet_group | delete | region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_subnet_groups
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
- create_subnet_group
- Manifest
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
;
# Description fields are for documentation purposes
- name: subnet_groups
props:
- name: region
value: "{{ region }}"
description: Required parameter for the subnet_groups resource.
- name: SubnetGroupName
value: "{{ SubnetGroupName }}"
description: |
The name of the subnet group.
- name: Description
value: "{{ Description }}"
description: |
A description for the subnet group.
- name: SubnetIds
value:
- "{{ SubnetIds }}"
description: |
A list of VPC subnet IDs for the subnet group.
- name: Tags
description: |
A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_subnet_group
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
- delete_subnet_group
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
;