cluster_subnet_groups
Creates, updates, deletes, gets or lists a cluster_subnet_groups resource.
Overview
| Name | cluster_subnet_groups |
| Type | Resource |
| Id | aws.redshift.cluster_subnet_groups |
Fields
The following fields are returned by SELECT queries:
- describe_cluster_subnet_groups
| Name | Datatype | Description |
|---|---|---|
cluster_subnet_group_name | string | The name of the cluster subnet group. |
description | string | The description of the cluster subnet group. |
subnet_group_status | string | The status of the cluster subnet group. Possible values are Complete, Incomplete and Invalid. |
subnets | string | A list of the VPC Subnet elements. |
supported_cluster_ip_address_types | string | The IP address types supported by this cluster subnet group. Possible values are ipv4 and dualstack. |
tags | string | The list of tags for the cluster subnet group. |
vpc_id | string | The VPC ID of the cluster subnet group. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_cluster_subnet_groups | select | region | ClusterSubnetGroupName, MaxRecords, Marker, TagKeys, TagValues | Returns one or more cluster subnet group objects, which contain metadata about your cluster subnet groups. By default, this operation returns information about all cluster subnet groups that are defined in your Amazon Web Services account. If you specify both tag keys and tag values in the same request, Amazon Redshift returns all subnet groups that match any combination of the specified keys and values. For example, if you have owner and environment for tag keys, and admin and test for tag values, all subnet groups that have any combination of those values are returned. If both tag keys and values are omitted from the request, subnet groups are returned regardless of whether they have tag keys or values associated with them. |
create_cluster_subnet_group | insert | ClusterSubnetGroupName, SubnetIds, region | Description, Tags | Creates a new Amazon Redshift subnet group. You must provide a list of one or more subnets in your existing Amazon Virtual Private Cloud (Amazon VPC) when creating Amazon Redshift subnet group. For information about subnet groups, go to Amazon Redshift Cluster Subnet Groups in the Amazon Redshift Cluster Management Guide. |
modify_cluster_subnet_group | update | ClusterSubnetGroupName, SubnetIds, region | Description | Modifies a cluster subnet group to include the specified list of VPC subnets. The operation replaces the existing list of subnets with the new list of subnets. VPC Block Public Access (BPA) enables you to block resources in VPCs and subnets that you own in a Region from reaching or being reached from the internet through internet gateways and egress-only internet gateways. If a subnet group for a provisioned cluster is in an account with VPC BPA turned on, the following capabilities are blocked: Creating a public cluster Restoring a public cluster Modifying a private cluster to be public Adding a subnet with VPC BPA turned on to the subnet group when there's at least one public cluster within the group For more information about VPC BPA, see Block public access to VPCs and subnets in the Amazon VPC User Guide. |
delete_cluster_subnet_group | delete | ClusterSubnetGroupName, region | Deletes the specified cluster subnet group. |
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 |
|---|---|---|
ClusterSubnetGroupName | string | The name of the cluster subnet group name to be deleted. |
SubnetIds | array | An array of VPC subnet IDs. A maximum of 20 subnets can be modified in a single request. |
region | string | AWS region (default: us-east-1) |
ClusterSubnetGroupName | string | The name of the cluster subnet group for which information is requested. |
Description | string | A text description of the subnet group to be modified. |
Marker | string | An optional parameter that specifies the starting point to return a set of response records. When the results of a DescribeClusterSubnetGroups request exceed the value specified in MaxRecords, Amazon Web Services returns a value in the Marker field of the response. You can retrieve the next set of response records by providing the returned marker value in the Marker parameter and retrying the request. |
MaxRecords | integer | The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified MaxRecords value, a value is returned in a marker field of the response. You can retrieve the next set of records by retrying the command with the returned marker value. Default: 100 Constraints: minimum 20, maximum 100. |
TagKeys | array | A tag key or keys for which you want to return all matching cluster subnet groups that are associated with the specified key or keys. For example, suppose that you have subnet groups that are tagged with keys called owner and environment. If you specify both of these tag keys in the request, Amazon Redshift returns a response with the subnet groups that have either or both of these tag keys associated with them. |
TagValues | array | A tag value or values for which you want to return all matching cluster subnet groups that are associated with the specified tag value or values. For example, suppose that you have subnet groups that are tagged with values called admin and test. If you specify both of these tag values in the request, Amazon Redshift returns a response with the subnet groups that have either or both of these tag values associated with them. |
Tags | array | A list of tag instances. |
SELECT examples
- describe_cluster_subnet_groups
Returns one or more cluster subnet group objects, which contain metadata about your cluster subnet groups. By default, this operation returns information about all cluster subnet groups that are defined in your Amazon Web Services account. If you specify both tag keys and tag values in the same request, Amazon Redshift returns all subnet groups that match any combination of the specified keys and values. For example, if you have owner and environment for tag keys, and admin and test for tag values, all subnet groups that have any combination of those values are returned. If both tag keys and values are omitted from the request, subnet groups are returned regardless of whether they have tag keys or values associated with them.
SELECT
cluster_subnet_group_name,
description,
subnet_group_status,
subnets,
supported_cluster_ip_address_types,
tags,
vpc_id
FROM aws.redshift.cluster_subnet_groups
WHERE region = '{{ region }}' -- required
AND ClusterSubnetGroupName = '{{ ClusterSubnetGroupName }}'
AND MaxRecords = '{{ MaxRecords }}'
AND Marker = '{{ Marker }}'
AND TagKeys = '{{ TagKeys }}'
AND TagValues = '{{ TagValues }}'
;
INSERT examples
- create_cluster_subnet_group
- Manifest
Creates a new Amazon Redshift subnet group. You must provide a list of one or more subnets in your existing Amazon Virtual Private Cloud (Amazon VPC) when creating Amazon Redshift subnet group. For information about subnet groups, go to Amazon Redshift Cluster Subnet Groups in the Amazon Redshift Cluster Management Guide.
INSERT INTO aws.redshift.cluster_subnet_groups (
ClusterSubnetGroupName,
SubnetIds,
region,
Description,
Tags
)
SELECT
'{{ ClusterSubnetGroupName }}',
'{{ SubnetIds }}',
'{{ region }}',
'{{ Description }}',
'{{ Tags }}'
RETURNING
cluster_subnet_group_name,
description,
subnet_group_status,
subnets,
supported_cluster_ip_address_types,
tags,
vpc_id
;
# Description fields are for documentation purposes
- name: cluster_subnet_groups
props:
- name: ClusterSubnetGroupName
value: "{{ ClusterSubnetGroupName }}"
description: Required parameter for the cluster_subnet_groups resource.
- name: SubnetIds
value: "{{ SubnetIds }}"
description: Required parameter for the cluster_subnet_groups resource.
- name: region
value: "{{ region }}"
description: Required parameter for the cluster_subnet_groups resource.
- name: Description
value: "{{ Description }}"
description: A description for the subnet group.
description: A description for the subnet group.
- name: Tags
value: "{{ Tags }}"
description: A list of tag instances.
description: A list of tag instances.
UPDATE examples
- modify_cluster_subnet_group
Modifies a cluster subnet group to include the specified list of VPC subnets. The operation replaces the existing list of subnets with the new list of subnets. VPC Block Public Access (BPA) enables you to block resources in VPCs and subnets that you own in a Region from reaching or being reached from the internet through internet gateways and egress-only internet gateways. If a subnet group for a provisioned cluster is in an account with VPC BPA turned on, the following capabilities are blocked: Creating a public cluster Restoring a public cluster Modifying a private cluster to be public Adding a subnet with VPC BPA turned on to the subnet group when there's at least one public cluster within the group For more information about VPC BPA, see Block public access to VPCs and subnets in the Amazon VPC User Guide.
UPDATE aws.redshift.cluster_subnet_groups
SET
-- No updatable properties
WHERE
ClusterSubnetGroupName = '{{ ClusterSubnetGroupName }}' --required
AND SubnetIds = '{{ SubnetIds }}' --required
AND region = '{{ region }}' --required
AND Description = '{{ Description}}'
RETURNING
cluster_subnet_group_name,
description,
subnet_group_status,
subnets,
supported_cluster_ip_address_types,
tags,
vpc_id;
DELETE examples
- delete_cluster_subnet_group
Deletes the specified cluster subnet group.
DELETE FROM aws.redshift.cluster_subnet_groups
WHERE ClusterSubnetGroupName = '{{ ClusterSubnetGroupName }}' --required
AND region = '{{ region }}' --required
;