Skip to main content

cluster_subnet_groups

Creates, updates, deletes, gets or lists a cluster_subnet_groups resource.

Overview

Namecluster_subnet_groups
TypeResource
Idaws.redshift.cluster_subnet_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
cluster_subnet_group_namestringThe name of the cluster subnet group.
descriptionstringThe description of the cluster subnet group.
subnet_group_statusstringThe status of the cluster subnet group. Possible values are Complete, Incomplete and Invalid.
subnetsstringA list of the VPC Subnet elements.
supported_cluster_ip_address_typesstringThe IP address types supported by this cluster subnet group. Possible values are ipv4 and dualstack.
tagsstringThe list of tags for the cluster subnet group.
vpc_idstringThe VPC ID of the cluster subnet group.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_cluster_subnet_groupsselectregionClusterSubnetGroupName, MaxRecords, Marker, TagKeys, TagValuesReturns 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_groupinsertClusterSubnetGroupName, SubnetIds, regionDescription, TagsCreates 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_groupupdateClusterSubnetGroupName, SubnetIds, regionDescriptionModifies 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_groupdeleteClusterSubnetGroupName, regionDeletes 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.

NameDatatypeDescription
ClusterSubnetGroupNamestringThe name of the cluster subnet group name to be deleted.
SubnetIdsarrayAn array of VPC subnet IDs. A maximum of 20 subnets can be modified in a single request.
regionstringAWS region (default: us-east-1)
ClusterSubnetGroupNamestringThe name of the cluster subnet group for which information is requested.
DescriptionstringA text description of the subnet group to be modified.
MarkerstringAn 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.
MaxRecordsintegerThe 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.
TagKeysarrayA 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.
TagValuesarrayA 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.
TagsarrayA list of tag instances.

SELECT examples

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

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
;

UPDATE examples

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

Deletes the specified cluster subnet group.

DELETE FROM aws.redshift.cluster_subnet_groups
WHERE ClusterSubnetGroupName = '{{ ClusterSubnetGroupName }}' --required
AND region = '{{ region }}' --required
;