SubnetGroup

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.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var fooVpc = new Aws.Ec2.Vpc("fooVpc", new Aws.Ec2.VpcArgs
        {
            CidrBlock = "10.1.0.0/16",
        });
        var fooSubnet = new Aws.Ec2.Subnet("fooSubnet", new Aws.Ec2.SubnetArgs
        {
            AvailabilityZone = "us-west-2a",
            CidrBlock = "10.1.1.0/24",
            Tags = 
            {
                { "Name", "tf-dbsubnet-test-1" },
            },
            VpcId = fooVpc.Id,
        });
        var bar = new Aws.Ec2.Subnet("bar", new Aws.Ec2.SubnetArgs
        {
            AvailabilityZone = "us-west-2b",
            CidrBlock = "10.1.2.0/24",
            Tags = 
            {
                { "Name", "tf-dbsubnet-test-2" },
            },
            VpcId = fooVpc.Id,
        });
        var fooSubnetGroup = new Aws.RedShift.SubnetGroup("fooSubnetGroup", new Aws.RedShift.SubnetGroupArgs
        {
            SubnetIds = 
            {
                fooSubnet.Id,
                bar.Id,
            },
            Tags = 
            {
                { "environment", "Production" },
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/redshift"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        fooVpc, err := ec2.NewVpc(ctx, "fooVpc", &ec2.VpcArgs{
            CidrBlock: pulumi.String("10.1.0.0/16"),
        })
        if err != nil {
            return err
        }
        fooSubnet, err := ec2.NewSubnet(ctx, "fooSubnet", &ec2.SubnetArgs{
            AvailabilityZone: pulumi.String("us-west-2a"),
            CidrBlock:        pulumi.String("10.1.1.0/24"),
            Tags: pulumi.StringMap{
                "Name": pulumi.String("tf-dbsubnet-test-1"),
            },
            VpcId: fooVpc.ID(),
        })
        if err != nil {
            return err
        }
        bar, err := ec2.NewSubnet(ctx, "bar", &ec2.SubnetArgs{
            AvailabilityZone: pulumi.String("us-west-2b"),
            CidrBlock:        pulumi.String("10.1.2.0/24"),
            Tags: pulumi.StringMap{
                "Name": pulumi.String("tf-dbsubnet-test-2"),
            },
            VpcId: fooVpc.ID(),
        })
        if err != nil {
            return err
        }
        _, err = redshift.NewSubnetGroup(ctx, "fooSubnetGroup", &redshift.SubnetGroupArgs{
            SubnetIds: pulumi.StringArray{
                fooSubnet.ID(),
                bar.ID(),
            },
            Tags: pulumi.StringMap{
                "environment": pulumi.String("Production"),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

foo_vpc = aws.ec2.Vpc("fooVpc", cidr_block="10.1.0.0/16")
foo_subnet = aws.ec2.Subnet("fooSubnet",
    availability_zone="us-west-2a",
    cidr_block="10.1.1.0/24",
    tags={
        "Name": "tf-dbsubnet-test-1",
    },
    vpc_id=foo_vpc.id)
bar = aws.ec2.Subnet("bar",
    availability_zone="us-west-2b",
    cidr_block="10.1.2.0/24",
    tags={
        "Name": "tf-dbsubnet-test-2",
    },
    vpc_id=foo_vpc.id)
foo_subnet_group = aws.redshift.SubnetGroup("fooSubnetGroup",
    subnet_ids=[
        foo_subnet.id,
        bar.id,
    ],
    tags={
        "environment": "Production",
    })
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const fooVpc = new aws.ec2.Vpc("foo", {
    cidrBlock: "10.1.0.0/16",
});
const fooSubnet = new aws.ec2.Subnet("foo", {
    availabilityZone: "us-west-2a",
    cidrBlock: "10.1.1.0/24",
    tags: {
        Name: "tf-dbsubnet-test-1",
    },
    vpcId: fooVpc.id,
});
const bar = new aws.ec2.Subnet("bar", {
    availabilityZone: "us-west-2b",
    cidrBlock: "10.1.2.0/24",
    tags: {
        Name: "tf-dbsubnet-test-2",
    },
    vpcId: fooVpc.id,
});
const fooSubnetGroup = new aws.redshift.SubnetGroup("foo", {
    subnetIds: [
        fooSubnet.id,
        bar.id,
    ],
    tags: {
        environment: "Production",
    },
});

Create a SubnetGroup Resource

def SubnetGroup(resource_name, opts=None, description=None, name=None, subnet_ids=None, tags=None, __props__=None);
func NewSubnetGroup(ctx *Context, name string, args SubnetGroupArgs, opts ...ResourceOption) (*SubnetGroup, error)
public SubnetGroup(string name, SubnetGroupArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args SubnetGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SubnetGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SubnetGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

SubnetGroup Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The SubnetGroup resource accepts the following input properties:

SubnetIds List<string>

An array of VPC subnet IDs.

Description string

The description of the Redshift Subnet group. Defaults to “Managed by Pulumi”.

Name string

The name of the Redshift Subnet group.

Tags Dictionary<string, string>

A map of tags to assign to the resource.

SubnetIds []string

An array of VPC subnet IDs.

Description string

The description of the Redshift Subnet group. Defaults to “Managed by Pulumi”.

Name string

The name of the Redshift Subnet group.

Tags map[string]string

A map of tags to assign to the resource.

subnetIds string[]

An array of VPC subnet IDs.

description string

The description of the Redshift Subnet group. Defaults to “Managed by Pulumi”.

name string

The name of the Redshift Subnet group.

tags {[key: string]: string}

A map of tags to assign to the resource.

subnet_ids List[str]

An array of VPC subnet IDs.

description str

The description of the Redshift Subnet group. Defaults to “Managed by Pulumi”.

name str

The name of the Redshift Subnet group.

tags Dict[str, str]

A map of tags to assign to the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the SubnetGroup resource produces the following output properties:

Arn string

Amazon Resource Name (ARN) of the Redshift Subnet group name

Id string
The provider-assigned unique ID for this managed resource.
Arn string

Amazon Resource Name (ARN) of the Redshift Subnet group name

Id string
The provider-assigned unique ID for this managed resource.
arn string

Amazon Resource Name (ARN) of the Redshift Subnet group name

id string
The provider-assigned unique ID for this managed resource.
arn str

Amazon Resource Name (ARN) of the Redshift Subnet group name

id str
The provider-assigned unique ID for this managed resource.

Look up an Existing SubnetGroup Resource

Get an existing SubnetGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SubnetGroupState, opts?: CustomResourceOptions): SubnetGroup
static get(resource_name, id, opts=None, arn=None, description=None, name=None, subnet_ids=None, tags=None, __props__=None);
func GetSubnetGroup(ctx *Context, name string, id IDInput, state *SubnetGroupState, opts ...ResourceOption) (*SubnetGroup, error)
public static SubnetGroup Get(string name, Input<string> id, SubnetGroupState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Arn string

Amazon Resource Name (ARN) of the Redshift Subnet group name

Description string

The description of the Redshift Subnet group. Defaults to “Managed by Pulumi”.

Name string

The name of the Redshift Subnet group.

SubnetIds List<string>

An array of VPC subnet IDs.

Tags Dictionary<string, string>

A map of tags to assign to the resource.

Arn string

Amazon Resource Name (ARN) of the Redshift Subnet group name

Description string

The description of the Redshift Subnet group. Defaults to “Managed by Pulumi”.

Name string

The name of the Redshift Subnet group.

SubnetIds []string

An array of VPC subnet IDs.

Tags map[string]string

A map of tags to assign to the resource.

arn string

Amazon Resource Name (ARN) of the Redshift Subnet group name

description string

The description of the Redshift Subnet group. Defaults to “Managed by Pulumi”.

name string

The name of the Redshift Subnet group.

subnetIds string[]

An array of VPC subnet IDs.

tags {[key: string]: string}

A map of tags to assign to the resource.

arn str

Amazon Resource Name (ARN) of the Redshift Subnet group name

description str

The description of the Redshift Subnet group. Defaults to “Managed by Pulumi”.

name str

The name of the Redshift Subnet group.

subnet_ids List[str]

An array of VPC subnet IDs.

tags Dict[str, str]

A map of tags to assign to the resource.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.