Show / Hide Table of Contents

Class Cluster

Manages a RDS Aurora Cluster. To manage cluster instances that inherit configuration from the cluster (when not running the cluster in serverless engine mode), see the aws.rds.ClusterInstance resource. To manage non-Aurora databases (e.g. MySQL, PostgreSQL, SQL Server, etc.), see the aws.rds.Instance resource.

For information on the difference between the available Aurora MySQL engines see Comparison between Aurora MySQL 1 and Aurora MySQL 2 in the Amazon RDS User Guide.

Changes to an RDS Cluster can occur when you manually change a parameter, such as port, and are reflected in the next maintenance window. Because of this, this provider may report a difference in its planning phase because a modification has not yet taken place. You can use the apply_immediately flag to instruct the service to apply the change immediately (see documentation below).

Note: using apply_immediately can result in a brief downtime as the server reboots. See the AWS Docs on RDS Maintenance for more information.

Note: All arguments including the username and password will be stored in the raw state as plain-text. Read more about sensitive data in state.

Example Usage

Aurora MySQL 2.x (MySQL 5.7)

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var @default = new Aws.Rds.Cluster("default", new Aws.Rds.ClusterArgs
    {
        AvailabilityZones = 
        {
            "us-west-2a",
            "us-west-2b",
            "us-west-2c",
        },
        BackupRetentionPeriod = 5,
        ClusterIdentifier = "aurora-cluster-demo",
        DatabaseName = "mydb",
        Engine = "aurora-mysql",
        EngineVersion = "5.7.mysql_aurora.2.03.2",
        MasterPassword = "bar",
        MasterUsername = "foo",
        PreferredBackupWindow = "07:00-09:00",
    });
}

}

Aurora MySQL 1.x (MySQL 5.6)

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var @default = new Aws.Rds.Cluster("default", new Aws.Rds.ClusterArgs
    {
        AvailabilityZones = 
        {
            "us-west-2a",
            "us-west-2b",
            "us-west-2c",
        },
        BackupRetentionPeriod = 5,
        ClusterIdentifier = "aurora-cluster-demo",
        DatabaseName = "mydb",
        MasterPassword = "bar",
        MasterUsername = "foo",
        PreferredBackupWindow = "07:00-09:00",
    });
}

}

Aurora with PostgreSQL engine

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var postgresql = new Aws.Rds.Cluster("postgresql", new Aws.Rds.ClusterArgs
    {
        AvailabilityZones = 
        {
            "us-west-2a",
            "us-west-2b",
            "us-west-2c",
        },
        BackupRetentionPeriod = 5,
        ClusterIdentifier = "aurora-cluster-demo",
        DatabaseName = "mydb",
        Engine = "aurora-postgresql",
        MasterPassword = "bar",
        MasterUsername = "foo",
        PreferredBackupWindow = "07:00-09:00",
    });
}

}

Aurora Multi-Master Cluster

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var example = new Aws.Rds.Cluster("example", new Aws.Rds.ClusterArgs
    {
        ClusterIdentifier = "example",
        DbSubnetGroupName = aws_db_subnet_group.Example.Name,
        EngineMode = "multimaster",
        MasterPassword = "barbarbarbar",
        MasterUsername = "foo",
        SkipFinalSnapshot = true,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Cluster
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Rds
Assembly: Pulumi.Aws.dll
Syntax
public class Cluster : CustomResource

Constructors

View Source

Cluster(String, ClusterArgs, CustomResourceOptions)

Create a Cluster resource with the given unique name, arguments, and options.

Declaration
public Cluster(string name, ClusterArgs args = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

ClusterArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

ApplyImmediately

Specifies whether any cluster modifications are applied immediately, or during the next maintenance window. Default is false. See Amazon RDS Documentation for more information.

Declaration
public Output<bool> ApplyImmediately { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

Arn

Amazon Resource Name (ARN) of cluster

Declaration
public Output<string> Arn { get; }
Property Value
Type Description
Output<System.String>
View Source

AvailabilityZones

A list of EC2 Availability Zones for the DB cluster storage where DB cluster instances can be created. RDS automatically assigns 3 AZs if less than 3 AZs are configured, which will show as a difference requiring resource recreation next deployment. It is recommended to specify 3 AZs or use ignore_changes if necessary.

Declaration
public Output<ImmutableArray<string>> AvailabilityZones { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

BacktrackWindow

The target backtrack window, in seconds. Only available for aurora engine currently. To disable backtracking, set this value to 0. Defaults to 0. Must be between 0 and 259200 (72 hours)

Declaration
public Output<int?> BacktrackWindow { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

BackupRetentionPeriod

The days to retain backups for. Default 1

Declaration
public Output<int?> BackupRetentionPeriod { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

ClusterIdentifier

The cluster identifier. If omitted, this provider will assign a random, unique identifier.

Declaration
public Output<string> ClusterIdentifier { get; }
Property Value
Type Description
Output<System.String>
View Source

ClusterIdentifierPrefix

Creates a unique cluster identifier beginning with the specified prefix. Conflicts with cluster_identifier.

Declaration
public Output<string> ClusterIdentifierPrefix { get; }
Property Value
Type Description
Output<System.String>
View Source

ClusterMembers

List of RDS Instances that are a part of this cluster

Declaration
public Output<ImmutableArray<string>> ClusterMembers { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

ClusterResourceId

The RDS Cluster Resource ID

Declaration
public Output<string> ClusterResourceId { get; }
Property Value
Type Description
Output<System.String>
View Source

CopyTagsToSnapshot

Copy all Cluster tags to snapshots. Default is false.

Declaration
public Output<bool?> CopyTagsToSnapshot { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

DatabaseName

Name for an automatically created database on cluster creation. There are different naming restrictions per database engine: RDS Naming Constraints

Declaration
public Output<string> DatabaseName { get; }
Property Value
Type Description
Output<System.String>
View Source

DbClusterParameterGroupName

A cluster parameter group to associate with the cluster.

Declaration
public Output<string> DbClusterParameterGroupName { get; }
Property Value
Type Description
Output<System.String>
View Source

DbSubnetGroupName

A DB subnet group to associate with this DB instance. NOTE: This must match the db_subnet_group_name specified on every aws.rds.ClusterInstance in the cluster.

Declaration
public Output<string> DbSubnetGroupName { get; }
Property Value
Type Description
Output<System.String>
View Source

DeletionProtection

If the DB instance should have deletion protection enabled. The database can't be deleted when this value is set to true. The default is false.

Declaration
public Output<bool?> DeletionProtection { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

EnabledCloudwatchLogsExports

List of log types to export to cloudwatch. If omitted, no logs will be exported. The following log types are supported: audit, error, general, slowquery, postgresql (PostgreSQL).

Declaration
public Output<ImmutableArray<string>> EnabledCloudwatchLogsExports { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

EnableHttpEndpoint

Enable HTTP endpoint (data API). Only valid when engine_mode is set to serverless.

Declaration
public Output<bool?> EnableHttpEndpoint { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Endpoint

The DNS address of the RDS instance

Declaration
public Output<string> Endpoint { get; }
Property Value
Type Description
Output<System.String>
View Source

Engine

The name of the database engine to be used for this DB cluster. Defaults to aurora. Valid Values: aurora, aurora-mysql, aurora-postgresql

Declaration
public Output<string> Engine { get; }
Property Value
Type Description
Output<System.String>
View Source

EngineMode

The database engine mode. Valid values: global, multimaster, parallelquery, provisioned, serverless. Defaults to: provisioned. See the RDS User Guide for limitations when using serverless.

Declaration
public Output<string> EngineMode { get; }
Property Value
Type Description
Output<System.String>
View Source

EngineVersion

The database engine version. Updating this argument results in an outage. See the Aurora MySQL and Aurora Postgres documentation for your configured engine to determine this value. For example with Aurora MySQL 2, a potential value for this argument is 5.7.mysql_aurora.2.03.2.

Declaration
public Output<string> EngineVersion { get; }
Property Value
Type Description
Output<System.String>
View Source

FinalSnapshotIdentifier

The name of your final DB snapshot when this DB cluster is deleted. If omitted, no final snapshot will be made.

Declaration
public Output<string> FinalSnapshotIdentifier { get; }
Property Value
Type Description
Output<System.String>
View Source

GlobalClusterIdentifier

The global cluster identifier specified on aws.rds.GlobalCluster.

Declaration
public Output<string> GlobalClusterIdentifier { get; }
Property Value
Type Description
Output<System.String>
View Source

HostedZoneId

The Route53 Hosted Zone ID of the endpoint

Declaration
public Output<string> HostedZoneId { get; }
Property Value
Type Description
Output<System.String>
View Source

IamDatabaseAuthenticationEnabled

Specifies whether or mappings of AWS Identity and Access Management (IAM) accounts to database accounts is enabled. Please see AWS Documentation for availability and limitations.

Declaration
public Output<bool?> IamDatabaseAuthenticationEnabled { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

IamRoles

A List of ARNs for the IAM roles to associate to the RDS Cluster.

Declaration
public Output<ImmutableArray<string>> IamRoles { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

KmsKeyId

The ARN for the KMS encryption key. When specifying kms_key_id, storage_encrypted needs to be set to true.

Declaration
public Output<string> KmsKeyId { get; }
Property Value
Type Description
Output<System.String>
View Source

MasterPassword

Password for the master DB user. Note that this may show up in logs, and it will be stored in the state file. Please refer to the RDS Naming Constraints

Declaration
public Output<string> MasterPassword { get; }
Property Value
Type Description
Output<System.String>
View Source

MasterUsername

Username for the master DB user. Please refer to the RDS Naming Constraints. This argument does not support in-place updates and cannot be changed during a restore from snapshot.

Declaration
public Output<string> MasterUsername { get; }
Property Value
Type Description
Output<System.String>
View Source

Port

The port on which the DB accepts connections

Declaration
public Output<int> Port { get; }
Property Value
Type Description
Output<System.Int32>
View Source

PreferredBackupWindow

The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.Time in UTC Default: A 30-minute window selected at random from an 8-hour block of time per region. e.g. 04:00-09:00

Declaration
public Output<string> PreferredBackupWindow { get; }
Property Value
Type Description
Output<System.String>
View Source

PreferredMaintenanceWindow

The weekly time range during which system maintenance can occur, in (UTC) e.g. wed:04:00-wed:04:30

Declaration
public Output<string> PreferredMaintenanceWindow { get; }
Property Value
Type Description
Output<System.String>
View Source

ReaderEndpoint

A read-only endpoint for the Aurora cluster, automatically load-balanced across replicas

Declaration
public Output<string> ReaderEndpoint { get; }
Property Value
Type Description
Output<System.String>
View Source

ReplicationSourceIdentifier

ARN of a source DB cluster or DB instance if this DB cluster is to be created as a Read Replica.

Declaration
public Output<string> ReplicationSourceIdentifier { get; }
Property Value
Type Description
Output<System.String>
View Source

S3Import

Declaration
public Output<ClusterS3Import> S3Import { get; }
Property Value
Type Description
Output<ClusterS3Import>
View Source

ScalingConfiguration

Nested attribute with scaling properties. Only valid when engine_mode is set to serverless. More details below.

Declaration
public Output<ClusterScalingConfiguration> ScalingConfiguration { get; }
Property Value
Type Description
Output<ClusterScalingConfiguration>
View Source

SkipFinalSnapshot

Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from final_snapshot_identifier. Default is false.

Declaration
public Output<bool?> SkipFinalSnapshot { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

SnapshotIdentifier

Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot.

Declaration
public Output<string> SnapshotIdentifier { get; }
Property Value
Type Description
Output<System.String>
View Source

SourceRegion

The source region for an encrypted replica DB cluster.

Declaration
public Output<string> SourceRegion { get; }
Property Value
Type Description
Output<System.String>
View Source

StorageEncrypted

Specifies whether the DB cluster is encrypted. The default is false for provisioned engine_mode and true for serverless engine_mode.

Declaration
public Output<bool?> StorageEncrypted { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Tags

A map of tags to assign to the DB cluster.

Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>
View Source

VpcSecurityGroupIds

List of VPC security groups to associate with the Cluster

Declaration
public Output<ImmutableArray<string>> VpcSecurityGroupIds { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>

Methods

View Source

Get(String, Input<String>, ClusterState, CustomResourceOptions)

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

Declaration
public static Cluster Get(string name, Input<string> id, ClusterState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

ClusterState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Cluster
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.