Cluster class

Provides a Redshift Cluster Resource.

> NOTE: A Redshift cluster's default IAM role can be managed both by this resource's defaultIamRoleArn argument and the aws.redshift.ClusterIamRoles resource's defaultIamRoleArn argument. Do not configure different values for both arguments. Doing so will cause a conflict of default IAM roles.

> Note: Write-Only argument masterPasswordWo is available to use in place of masterPassword. Write-Only arguments are supported in HashiCorp Terraform 1.11.0 and later. Learn more.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.redshift.Cluster("example", {
    clusterIdentifier: "tf-redshift-cluster",
    databaseName: "mydb",
    masterUsername: "exampleuser",
    masterPassword: "Mustbe8characters",
    nodeType: "dc1.large",
    clusterType: "single-node",
});
import pulumi
import pulumi_aws as aws

example = aws.redshift.Cluster("example",
    cluster_identifier="tf-redshift-cluster",
    database_name="mydb",
    master_username="exampleuser",
    master_password="Mustbe8characters",
    node_type="dc1.large",
    cluster_type="single-node")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.RedShift.Cluster("example", new()
    {
        ClusterIdentifier = "tf-redshift-cluster",
        DatabaseName = "mydb",
        MasterUsername = "exampleuser",
        MasterPassword = "Mustbe8characters",
        NodeType = "dc1.large",
        ClusterType = "single-node",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/redshift"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := redshift.NewCluster(ctx, "example", &redshift.ClusterArgs{
			ClusterIdentifier: pulumi.String("tf-redshift-cluster"),
			DatabaseName:      pulumi.String("mydb"),
			MasterUsername:    pulumi.String("exampleuser"),
			MasterPassword:    pulumi.String("Mustbe8characters"),
			NodeType:          pulumi.String("dc1.large"),
			ClusterType:       pulumi.String("single-node"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_redshift_cluster" "example" {
  cluster_identifier = "tf-redshift-cluster"
  database_name      = "mydb"
  master_username    = "exampleuser"
  master_password    = "Mustbe8characters"
  node_type          = "dc1.large"
  cluster_type       = "single-node"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.redshift.Cluster;
import com.pulumi.aws.redshift.ClusterArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new Cluster("example", ClusterArgs.builder()
            .clusterIdentifier("tf-redshift-cluster")
            .databaseName("mydb")
            .masterUsername("exampleuser")
            .masterPassword("Mustbe8characters")
            .nodeType("dc1.large")
            .clusterType("single-node")
            .build());

    }
}
resources:
  example:
    type: aws:redshift:Cluster
    properties:
      clusterIdentifier: tf-redshift-cluster
      databaseName: mydb
      masterUsername: exampleuser
      masterPassword: Mustbe8characters
      nodeType: dc1.large
      clusterType: single-node

With Managed Credentials

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.redshift.Cluster("example", {
    clusterIdentifier: "tf-redshift-cluster",
    databaseName: "mydb",
    masterUsername: "exampleuser",
    nodeType: "dc1.large",
    clusterType: "single-node",
    manageMasterPassword: true,
});
import pulumi
import pulumi_aws as aws

example = aws.redshift.Cluster("example",
    cluster_identifier="tf-redshift-cluster",
    database_name="mydb",
    master_username="exampleuser",
    node_type="dc1.large",
    cluster_type="single-node",
    manage_master_password=True)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.RedShift.Cluster("example", new()
    {
        ClusterIdentifier = "tf-redshift-cluster",
        DatabaseName = "mydb",
        MasterUsername = "exampleuser",
        NodeType = "dc1.large",
        ClusterType = "single-node",
        ManageMasterPassword = true,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/redshift"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := redshift.NewCluster(ctx, "example", &redshift.ClusterArgs{
			ClusterIdentifier:    pulumi.String("tf-redshift-cluster"),
			DatabaseName:         pulumi.String("mydb"),
			MasterUsername:       pulumi.String("exampleuser"),
			NodeType:             pulumi.String("dc1.large"),
			ClusterType:          pulumi.String("single-node"),
			ManageMasterPassword: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_redshift_cluster" "example" {
  cluster_identifier     = "tf-redshift-cluster"
  database_name          = "mydb"
  master_username        = "exampleuser"
  node_type              = "dc1.large"
  cluster_type           = "single-node"
  manage_master_password = true
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.redshift.Cluster;
import com.pulumi.aws.redshift.ClusterArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new Cluster("example", ClusterArgs.builder()
            .clusterIdentifier("tf-redshift-cluster")
            .databaseName("mydb")
            .masterUsername("exampleuser")
            .nodeType("dc1.large")
            .clusterType("single-node")
            .manageMasterPassword(true)
            .build());

    }
}
resources:
  example:
    type: aws:redshift:Cluster
    properties:
      clusterIdentifier: tf-redshift-cluster
      databaseName: mydb
      masterUsername: exampleuser
      nodeType: dc1.large
      clusterType: single-node
      manageMasterPassword: true

Import

Using pulumi import, import Redshift Clusters using the clusterIdentifier. For example:

$ pulumi import aws:redshift/cluster:Cluster myprodcluster tf-redshift-cluster-12345

Constructors

Cluster(String name, {ClusterArgs? args, CustomResourceOptions? options})
Creates a new Cluster. name The Pulumi resource name. args Arguments used to configure this Cluster. The set of arguments for Cluster. options Resource options controlling this resource's behavior.
Cluster.reference(String urn)
Creates a typed reference to an existing Cluster resource.

Properties

allowVersionUpgrade ↔ Output<bool?>
If true , major version upgrades can be applied during the maintenance window to the Amazon Redshift engine that is running on the cluster. Default is true.
latefinal
applyImmediately ↔ Output<bool?>
Specifies whether any cluster modifications are applied immediately, or during the next maintenance window. Default is false.
latefinal
aquaConfigurationStatus ↔ Output<String>
The value represents how the cluster is configured to use AQUA (Advanced Query Accelerator) after the cluster is restored. No longer supported by the AWS API. Always returns auto.
latefinal
arn ↔ Output<String>
ARN of cluster
latefinal
automatedSnapshotRetentionPeriod ↔ Output<int?>
The number of days that automated snapshots are retained. If the value is 0, automated snapshots are disabled. Even if automated snapshots are disabled, you can still create manual snapshots when you want with create-cluster-snapshot. Default is 1.
latefinal
availabilityZone ↔ Output<String>
The EC2 Availability Zone (AZ) in which you want Amazon Redshift to provision the cluster. For example, if you have several EC2 instances running in a specific Availability Zone, then you might want the cluster to be provisioned in the same zone in order to decrease network latency. Can only be changed if availabilityZoneRelocationEnabled is true.
latefinal
availabilityZoneRelocationEnabled ↔ Output<bool?>
If true, the cluster can be relocated to another availabity zone, either automatically by AWS or when requested. Default is false. Available for use on clusters from the RA3 instance family.
latefinal
childResources → Set<Resource>
finalinherited
clusterIdentifier ↔ Output<String>
The Cluster Identifier. Must be a lower case string.
latefinal
clusterNamespaceArn ↔ Output<String>
Namespace ARN of the cluster
latefinal
clusterNodes ↔ Output<List<ClusterClusterNode>>
The nodes in the cluster. Cluster node blocks are documented below
latefinal
clusterParameterGroupName ↔ Output<String>
The name of the parameter group to be associated with this cluster.
latefinal
clusterPublicKey ↔ Output<String>
The public key for the cluster
latefinal
clusterRevisionNumber ↔ Output<String>
The specific revision number of the database in the cluster
latefinal
clusterSubnetGroupName ↔ Output<String>
Name of a cluster subnet group to be associated with this cluster. If this parameter is not provided the resulting cluster will be deployed outside VPC.
latefinal
clusterType ↔ Output<String>
The cluster type to use. Either single-node or multi-node.
latefinal
clusterVersion ↔ Output<String?>
The version of the Amazon Redshift engine software that you want to deploy on the cluster. The version selected runs on all the nodes in the cluster.
latefinal
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
databaseName ↔ Output<String>
The name of the first database to be created when the cluster is created. If you do not provide a name, Amazon Redshift will create a default database called dev.
latefinal
defaultIamRoleArn ↔ Output<String>
ARN for the IAM role that was set as default for the cluster when the cluster was created.
latefinal
dnsName ↔ Output<String>
The DNS name of the cluster
latefinal
elasticIp ↔ Output<String?>
The Elastic IP (EIP) address for the cluster.
latefinal
encrypted ↔ Output<String?>
If true , the data in the cluster is encrypted at rest. Default is true.
latefinal
endpoint ↔ Output<String>
The connection endpoint
latefinal
enhancedVpcRouting ↔ Output<bool>
If true , enhanced VPC routing is enabled.
latefinal
finalSnapshotIdentifier ↔ Output<String?>
The identifier of the final snapshot that is to be created immediately before deleting the cluster. If this parameter is provided, skipFinalSnapshot must be false.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
iamRoles ↔ Output<List<String>>
A list of IAM Role ARNs to associate with the cluster. A Maximum of 10 can be associated to the cluster at any time.
latefinal
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
kmsKeyId ↔ Output<String>
The ARN for the KMS encryption key. When specifying kmsKeyId, encrypted needs to be set to true.
latefinal
maintenanceTrackName ↔ Output<String?>
The name of the maintenance track for the restored cluster. When you take a snapshot, the snapshot inherits the MaintenanceTrack value from the cluster. The snapshot might be on a different track than the cluster that was the source for the snapshot. For example, suppose that you take a snapshot of a cluster that is on the current track and then change the cluster to be on the trailing track. In this case, the snapshot and the source cluster are on different tracks. Default value is current.
latefinal
manageMasterPassword ↔ Output<bool?>
Whether to use AWS SecretsManager to manage the cluster admin credentials. Conflicts with masterPassword and masterPasswordWo. One of masterPassword or manageMasterPassword is required unless snapshotIdentifier is provided.
latefinal
manualSnapshotRetentionPeriod ↔ Output<int?>
The default number of days to retain a manual snapshot. If the value is -1, the snapshot is retained indefinitely. This setting doesn't change the retention period of existing snapshots. Valid values are between -1 and 3653. Default value is -1.
latefinal
masterPassword ↔ Output<String?>
Password for the master DB user. Conflicts with manageMasterPassword and masterPasswordWo. One of masterPassword, masterPasswordWo or manageMasterPassword is required unless snapshotIdentifier is provided. Note that this may show up in logs, and it will be stored in the state file. Password must contain at least 8 characters and contain at least one uppercase letter, one lowercase letter, and one number.
latefinal
masterPasswordSecretArn ↔ Output<String>
ARN of the cluster admin credentials secret
latefinal
masterPasswordSecretKmsKeyId ↔ Output<String>
ID of the KMS key used to encrypt the cluster admin credentials secret.
latefinal
masterPasswordWo ↔ Output<String?>
NOTE: This field is write-only and its value will not be updated in state as part of read operations. Password for the master DB user. Conflicts with manageMasterPassword and masterPassword. One of masterPasswordWo, masterPassword or manageMasterPassword is required unless snapshotIdentifier is provided. Note that this may show up in logs. Password must contain at least 8 characters and contain at least one uppercase letter, one lowercase letter, and one number.
latefinal
masterPasswordWoVersion ↔ Output<int?>
Used together with masterPasswordWo to trigger an update. Increment this value when an update to the masterPasswordWo is required.
latefinal
masterUsername ↔ Output<String?>
Username for the master DB user.
latefinal
multiAz ↔ Output<bool?>
Specifies if the Redshift cluster is multi-AZ.
latefinal
nodeType ↔ Output<String>
The node type to be provisioned for the cluster.
latefinal
numberOfNodes ↔ Output<int?>
The number of compute nodes in the cluster. This parameter is required when the ClusterType parameter is specified as multi-node. Default is 1.
latefinal
ownerAccount ↔ Output<String?>
The AWS customer account used to create or copy the snapshot. Required if you are restoring a snapshot you do not own, optional if you own the snapshot.
latefinal
port ↔ Output<int?>
The port number on which the cluster accepts incoming connections. Valid values are between 1115 and 65535. The cluster is accessible only via the JDBC and ODBC connection strings. Part of the connection string requires the port on which the cluster will listen for incoming connections. Default port is 5439.
latefinal
preferredMaintenanceWindow ↔ Output<String>
The weekly time range (in UTC) during which automated cluster maintenance can occur. Format: ddd:hh24:mi-ddd:hh24:mi
latefinal
publiclyAccessible ↔ Output<bool?>
If true, the cluster can be accessed from a public network. Default is false.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
skipFinalSnapshot ↔ Output<bool?>
Determines whether a final snapshot of the cluster is created before Amazon Redshift deletes the cluster. If true , a final cluster snapshot is not created. If false , a final cluster snapshot is created before the cluster is deleted. Default is false.
latefinal
snapshotArn ↔ Output<String?>
The ARN of the snapshot from which to create the new cluster. Conflicts with snapshotIdentifier.
latefinal
snapshotClusterIdentifier ↔ Output<String?>
The name of the cluster the source snapshot was created from.
latefinal
snapshotIdentifier ↔ Output<String?>
The name of the snapshot from which to create the new cluster. Conflicts with snapshotArn.
latefinal
tags ↔ Output<Map<String, String>?>
A map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
vpcSecurityGroupIds ↔ Output<List<String>>
List of VPC security groups to be associated with the cluster.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ClusterState? state, CustomResourceOptions? options}) → Cluster
Gets an existing Cluster resource's state with the given name and id.