AWS Amazon Redshift Subnet Group
This page shows how to write Terraform and CloudFormation for Amazon Redshift Subnet Group and write them securely.
aws_redshift_subnet_group (Terraform)
The Subnet Group in Amazon Redshift can be configured in Terraform with the resource name aws_redshift_subnet_group
. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_redshift_subnet_group" "this" {
description = var.description
name = var.name
subnet_ids = var.subnet_ids
tags = var.tags
}
Parameters
-
arn
optional computed - string -
description
optional - string -
id
optional computed - string -
name
required - string -
subnet_ids
required - set of string -
tags
optional - map from string to string
Explanation in Terraform Registry
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.
AWS::Redshift::ClusterSubnetGroup (CloudFormation)
The ClusterSubnetGroup in Redshift can be configured in CloudFormation with the resource name AWS::Redshift::ClusterSubnetGroup
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: 'AWS::Redshift::ClusterSubnetGroup'
Properties:
Description: "SubnetGroup created to testing C7N policies"
SubnetIds: !Ref SubnetID
NotificationTopic:
Type: AWS::Redshift::ClusterSubnetGroup
Properties:
Description: Redshift Subnet group
SubnetIds:
- !Ref RedshiftSubnet
Type: AWS::Redshift::ClusterSubnetGroup
Properties:
Description: Redshift Subnet group
SubnetIds:
- !Ref RedshiftSubnet
Type: AWS::Redshift::ClusterSubnetGroup
Properties:
Description: "cluster subnet group"
SubnetIds:
- !Ref Subnet1
- !Ref Subnet2
Type: AWS::Redshift::ClusterSubnetGroup
Properties:
Description: RedshiftSNG
SubnetIds:
- !Ref Subnet1Id
- !Ref Subnet2Id
"AWS::Redshift::ClusterSubnetGroup": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-redshift-clustersubnetgroup.html",
"Properties": {
"Description": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-redshift-clustersubnetgroup.html#cfn-redshift-clustersubnetgroup-description",
"PrimitiveType": "String",
"Type" : "AWS::Redshift::ClusterSubnetGroup",
"Properties" : {
"Description" : "{{settings["description"]}}",
"SubnetIds" : [
{% for subnet in settings["subnets"] %}
{ "Fn::ImportValue" : {"Fn::Sub" : ["${VPCStack}-Subnet-{{subnet}}", {"VPCStack": {"Ref": "VPCStack"}}] }}{% if not loop.last %},{% endif %}
"AWS::Redshift::ClusterSubnetGroup": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-redshift-clustersubnetgroup.html",
"Properties": {
"Description": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-redshift-clustersubnetgroup.html#cfn-redshift-clustersubnetgroup-description",
"PrimitiveType": "String",
"AWS::Redshift::ClusterSubnetGroup": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-redshift-clustersubnetgroup.html",
"Properties": {
"Description": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-redshift-clustersubnetgroup.html#cfn-redshift-clustersubnetgroup-description",
"PrimitiveType": "String",
"AWS::Redshift::ClusterSubnetGroup": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-redshift-clustersubnetgroup.html",
"Properties": {
"Description": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-redshift-clustersubnetgroup.html#cfn-redshift-clustersubnetgroup-description",
"PrimitiveType": "String",
Parameters
-
Description
required - String -
SubnetIds
required - List -
Tags
optional - List of Tag
Explanation in CloudFormation Registry
Specifies an 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.
Frequently asked questions
What is AWS Amazon Redshift Subnet Group?
AWS Amazon Redshift Subnet Group is a resource for Amazon Redshift of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Amazon Redshift Subnet Group?
For Terraform, the niveklabs/aws source code example is useful. See the Terraform Example section for further details.
For CloudFormation, the felipekiko/finops-c7n, andresionek91/bootcamp-turma-5 and cfascina/hb-data-engineering source code examples are useful. See the CloudFormation Example section for further details.