Table: aws_redshift_subnet_group - Query AWS Redshift Subnet Groups using SQL
The AWS Redshift Subnet Group is a collection of subnets that you may want to designate for your Amazon Redshift clusters in a Virtual Private Cloud (VPC). This resource allows you to specify a range of IP addresses in the VPC and a set of security groups to be associated with the Amazon Redshift cluster. The subnets must be in the same VPC and you can specify up to 20 subnets in a subnet group.
Table Usage Guide
The aws_redshift_subnet_group
table in Steampipe provides you with information about subnet groups within AWS Redshift. This table allows you, as a DevOps engineer, to query subnet group-specific details, including their names, descriptions, VPC IDs, subnet IDs, and their status. You can utilize this table to gather insights on subnet groups, such as which subnet groups are available, their associated VPCs and subnets, and their current status. The schema outlines the various attributes of the subnet group for you, including the subnet group name, VPC ID, subnet IDs, and status.
Examples
Basic info
Explore the status of your Redshift subnet groups within your Virtual Private Cloud (VPC) to understand their current condition. This can help in assessing the health of your cloud resources, enabling timely interventions and maintenance.
select cluster_subnet_group_name, description, subnet_group_status, vpc_idfrom aws_redshift_subnet_group;
select cluster_subnet_group_name, description, subnet_group_status, vpc_idfrom aws_redshift_subnet_group;
Get the subnet info for each subnet group
Determine the availability and status of each subnet within a group. This query is useful for understanding the health and configuration of your network infrastructure, enabling proactive management and troubleshooting.
select cluster_subnet_group_name, subnet -> 'SubnetAvailabilityZone' ->> 'Name' as subnet_availability_zone, subnet -> 'SubnetAvailabilityZone' ->> 'SupportedPlatforms' as supported_platforms, subnet ->> 'SubnetIdentifier' as subnet_identifier, subnet ->> 'SubnetStatus' as subnet_statusfrom aws_redshift_subnet_group, jsonb_array_elements(subnets) as subnet;
select cluster_subnet_group_name, json_extract(subnet.value, '$.SubnetAvailabilityZone.Name') as subnet_availability_zone, json_extract( subnet.value, '$.SubnetAvailabilityZone.SupportedPlatforms' ) as supported_platforms, json_extract(subnet.value, '$.SubnetIdentifier') as subnet_identifier, json_extract(subnet.value, '$.SubnetStatus') as subnet_statusfrom aws_redshift_subnet_group, json_each(subnets) as subnet;
List subnet groups without the application tag key
Discover the segments that are missing the 'application' tag key within your subnet groups. This can be useful for identifying areas in your AWS Redshift environment that may not be correctly tagged, ensuring proper resource tracking and management.
select cluster_subnet_group_name, tagsfrom aws_redshift_subnet_groupwhere not tags :: JSONB ? 'application';
select cluster_subnet_group_name, tagsfrom aws_redshift_subnet_groupwhere json_extract(tags, '$.application') is null;
Query examples
Schema for aws_redshift_subnet_group
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
cluster_subnet_group_name | text | = | The name of the cluster subnet group. |
description | text | The description of the cluster subnet group. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
region | text | The AWS Region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
subnet_group_status | text | The status of the cluster subnet group. | |
subnets | jsonb | A list of the VPC Subnet elements. | |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | A list of tags attached to the subnet group. | |
title | text | Title of the resource. | |
vpc_id | text | The VPC ID of the cluster subnet group. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_redshift_subnet_group