GlobalCluster
Manages an RDS Global Cluster, which is an Aurora global database spread across multiple regions. The global database contains a single primary cluster with read-write capability, and a read-only secondary cluster that receives data from the primary cluster through high-speed replication performed by the Aurora storage subsystem.
More information about Aurora global databases can be found in the Aurora User Guide.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var primary = new Aws.Provider("primary", new Aws.ProviderArgs
{
Region = "us-east-2",
});
var secondary = new Aws.Provider("secondary", new Aws.ProviderArgs
{
Region = "us-west-2",
});
var example = new Aws.Rds.GlobalCluster("example", new Aws.Rds.GlobalClusterArgs
{
GlobalClusterIdentifier = "example",
}, new CustomResourceOptions
{
Provider = "aws.primary",
});
var primaryCluster = new Aws.Rds.Cluster("primaryCluster", new Aws.Rds.ClusterArgs
{
EngineMode = "global",
GlobalClusterIdentifier = example.Id,
}, new CustomResourceOptions
{
Provider = "aws.primary",
});
var primaryClusterInstance = new Aws.Rds.ClusterInstance("primaryClusterInstance", new Aws.Rds.ClusterInstanceArgs
{
ClusterIdentifier = primaryCluster.Id,
}, new CustomResourceOptions
{
Provider = "aws.primary",
});
var secondaryCluster = new Aws.Rds.Cluster("secondaryCluster", new Aws.Rds.ClusterArgs
{
EngineMode = "global",
GlobalClusterIdentifier = example.Id,
}, new CustomResourceOptions
{
Provider = "aws.secondary",
DependsOn =
{
"aws_rds_cluster_instance.primary",
},
});
var secondaryClusterInstance = new Aws.Rds.ClusterInstance("secondaryClusterInstance", new Aws.Rds.ClusterInstanceArgs
{
ClusterIdentifier = secondaryCluster.Id,
}, new CustomResourceOptions
{
Provider = "aws.secondary",
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/providers"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/rds"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := providers.Newaws(ctx, "primary", &providers.awsArgs{
Region: pulumi.String("us-east-2"),
})
if err != nil {
return err
}
_, err = providers.Newaws(ctx, "secondary", &providers.awsArgs{
Region: pulumi.String("us-west-2"),
})
if err != nil {
return err
}
example, err := rds.NewGlobalCluster(ctx, "example", &rds.GlobalClusterArgs{
GlobalClusterIdentifier: pulumi.String("example"),
}, pulumi.Provider("aws.primary"))
if err != nil {
return err
}
primaryCluster, err := rds.NewCluster(ctx, "primaryCluster", &rds.ClusterArgs{
EngineMode: pulumi.String("global"),
GlobalClusterIdentifier: example.ID(),
}, pulumi.Provider("aws.primary"))
if err != nil {
return err
}
_, err = rds.NewClusterInstance(ctx, "primaryClusterInstance", &rds.ClusterInstanceArgs{
ClusterIdentifier: primaryCluster.ID(),
}, pulumi.Provider("aws.primary"))
if err != nil {
return err
}
secondaryCluster, err := rds.NewCluster(ctx, "secondaryCluster", &rds.ClusterArgs{
EngineMode: pulumi.String("global"),
GlobalClusterIdentifier: example.ID(),
}, pulumi.Provider("aws.secondary"), pulumi.DependsOn([]pulumi.Resource{
"aws_rds_cluster_instance.primary",
}))
if err != nil {
return err
}
_, err = rds.NewClusterInstance(ctx, "secondaryClusterInstance", &rds.ClusterInstanceArgs{
ClusterIdentifier: secondaryCluster.ID(),
}, pulumi.Provider("aws.secondary"))
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
import pulumi_pulumi as pulumi
primary = pulumi.providers.Aws("primary", region="us-east-2")
secondary = pulumi.providers.Aws("secondary", region="us-west-2")
example = aws.rds.GlobalCluster("example", global_cluster_identifier="example",
opts=ResourceOptions(provider="aws.primary"))
primary_cluster = aws.rds.Cluster("primaryCluster",
engine_mode="global",
global_cluster_identifier=example.id,
opts=ResourceOptions(provider="aws.primary"))
primary_cluster_instance = aws.rds.ClusterInstance("primaryClusterInstance", cluster_identifier=primary_cluster.id,
opts=ResourceOptions(provider="aws.primary"))
secondary_cluster = aws.rds.Cluster("secondaryCluster",
engine_mode="global",
global_cluster_identifier=example.id,
opts=ResourceOptions(provider="aws.secondary",
depends_on=["aws_rds_cluster_instance.primary"]))
secondary_cluster_instance = aws.rds.ClusterInstance("secondaryClusterInstance", cluster_identifier=secondary_cluster.id,
opts=ResourceOptions(provider="aws.secondary"))import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const primary = new aws.Provider("primary", {
region: "us-east-2",
});
const secondary = new aws.Provider("secondary", {
region: "us-west-2",
});
const example = new aws.rds.GlobalCluster("example", {
globalClusterIdentifier: "example",
}, { provider: primary });
const primaryCluster = new aws.rds.Cluster("primary", {
// ... other configuration ...
engineMode: "global",
globalClusterIdentifier: example.id,
}, { provider: primary });
const primaryClusterInstance = new aws.rds.ClusterInstance("primary", {
// ... other configuration ...
clusterIdentifier: primaryCluster.id,
}, { provider: primary });
const secondaryCluster = new aws.rds.Cluster("secondary", {
// ... other configuration ...
engineMode: "global",
globalClusterIdentifier: example.id,
}, { provider: secondary, dependsOn: [primaryClusterInstance] });
const secondaryClusterInstance = new aws.rds.ClusterInstance("secondary", {
// ... other configuration ...
clusterIdentifier: secondaryCluster.id,
}, { provider: secondary });Create a GlobalCluster Resource
new GlobalCluster(name: string, args: GlobalClusterArgs, opts?: CustomResourceOptions);def GlobalCluster(resource_name, opts=None, database_name=None, deletion_protection=None, engine=None, engine_version=None, global_cluster_identifier=None, storage_encrypted=None, __props__=None);func NewGlobalCluster(ctx *Context, name string, args GlobalClusterArgs, opts ...ResourceOption) (*GlobalCluster, error)public GlobalCluster(string name, GlobalClusterArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args GlobalClusterArgs
- 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 GlobalClusterArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GlobalClusterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
GlobalCluster Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The GlobalCluster resource accepts the following input properties:
- Global
Cluster stringIdentifier The global cluster identifier.
- Database
Name string Name for an automatically created database on cluster creation.
- Deletion
Protection bool If the Global Cluster should have deletion protection enabled. The database can’t be deleted when this value is set to
true. The default isfalse.- Engine string
Name of the database engine to be used for this DB cluster. Valid values:
aurora,aurora-mysql,aurora-postgresql. Defaults toaurora.- Engine
Version string Engine version of the Aurora global database. * NOTE: When the engine is set to
aurora-mysql, an engine version compatible with global database is required. The earliest available version is5.7.mysql_aurora.2.06.0.- Storage
Encrypted bool Specifies whether the DB cluster is encrypted. The default is
false.
- Global
Cluster stringIdentifier The global cluster identifier.
- Database
Name string Name for an automatically created database on cluster creation.
- Deletion
Protection bool If the Global Cluster should have deletion protection enabled. The database can’t be deleted when this value is set to
true. The default isfalse.- Engine string
Name of the database engine to be used for this DB cluster. Valid values:
aurora,aurora-mysql,aurora-postgresql. Defaults toaurora.- Engine
Version string Engine version of the Aurora global database. * NOTE: When the engine is set to
aurora-mysql, an engine version compatible with global database is required. The earliest available version is5.7.mysql_aurora.2.06.0.- Storage
Encrypted bool Specifies whether the DB cluster is encrypted. The default is
false.
- global
Cluster stringIdentifier The global cluster identifier.
- database
Name string Name for an automatically created database on cluster creation.
- deletion
Protection boolean If the Global Cluster should have deletion protection enabled. The database can’t be deleted when this value is set to
true. The default isfalse.- engine string
Name of the database engine to be used for this DB cluster. Valid values:
aurora,aurora-mysql,aurora-postgresql. Defaults toaurora.- engine
Version string Engine version of the Aurora global database. * NOTE: When the engine is set to
aurora-mysql, an engine version compatible with global database is required. The earliest available version is5.7.mysql_aurora.2.06.0.- storage
Encrypted boolean Specifies whether the DB cluster is encrypted. The default is
false.
- global_
cluster_ stridentifier The global cluster identifier.
- database_
name str Name for an automatically created database on cluster creation.
- deletion_
protection bool If the Global Cluster should have deletion protection enabled. The database can’t be deleted when this value is set to
true. The default isfalse.- engine str
Name of the database engine to be used for this DB cluster. Valid values:
aurora,aurora-mysql,aurora-postgresql. Defaults toaurora.- engine_
version str Engine version of the Aurora global database. * NOTE: When the engine is set to
aurora-mysql, an engine version compatible with global database is required. The earliest available version is5.7.mysql_aurora.2.06.0.- storage_
encrypted bool Specifies whether the DB cluster is encrypted. The default is
false.
Outputs
All input properties are implicitly available as output properties. Additionally, the GlobalCluster resource produces the following output properties:
- Arn string
RDS Global Cluster Amazon Resource Name (ARN)
- Global
Cluster stringResource Id AWS Region-unique, immutable identifier for the global database cluster. This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB cluster is accessed
- Id string
- The provider-assigned unique ID for this managed resource.
- Arn string
RDS Global Cluster Amazon Resource Name (ARN)
- Global
Cluster stringResource Id AWS Region-unique, immutable identifier for the global database cluster. This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB cluster is accessed
- Id string
- The provider-assigned unique ID for this managed resource.
- arn string
RDS Global Cluster Amazon Resource Name (ARN)
- global
Cluster stringResource Id AWS Region-unique, immutable identifier for the global database cluster. This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB cluster is accessed
- id string
- The provider-assigned unique ID for this managed resource.
- arn str
RDS Global Cluster Amazon Resource Name (ARN)
- global_
cluster_ strresource_ id AWS Region-unique, immutable identifier for the global database cluster. This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB cluster is accessed
- id str
- The provider-assigned unique ID for this managed resource.
Look up an Existing GlobalCluster Resource
Get an existing GlobalCluster 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?: GlobalClusterState, opts?: CustomResourceOptions): GlobalClusterstatic get(resource_name, id, opts=None, arn=None, database_name=None, deletion_protection=None, engine=None, engine_version=None, global_cluster_identifier=None, global_cluster_resource_id=None, storage_encrypted=None, __props__=None);func GetGlobalCluster(ctx *Context, name string, id IDInput, state *GlobalClusterState, opts ...ResourceOption) (*GlobalCluster, error)public static GlobalCluster Get(string name, Input<string> id, GlobalClusterState? 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
RDS Global Cluster Amazon Resource Name (ARN)
- Database
Name string Name for an automatically created database on cluster creation.
- Deletion
Protection bool If the Global Cluster should have deletion protection enabled. The database can’t be deleted when this value is set to
true. The default isfalse.- Engine string
Name of the database engine to be used for this DB cluster. Valid values:
aurora,aurora-mysql,aurora-postgresql. Defaults toaurora.- Engine
Version string Engine version of the Aurora global database. * NOTE: When the engine is set to
aurora-mysql, an engine version compatible with global database is required. The earliest available version is5.7.mysql_aurora.2.06.0.- Global
Cluster stringIdentifier The global cluster identifier.
- Global
Cluster stringResource Id AWS Region-unique, immutable identifier for the global database cluster. This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB cluster is accessed
- Storage
Encrypted bool Specifies whether the DB cluster is encrypted. The default is
false.
- Arn string
RDS Global Cluster Amazon Resource Name (ARN)
- Database
Name string Name for an automatically created database on cluster creation.
- Deletion
Protection bool If the Global Cluster should have deletion protection enabled. The database can’t be deleted when this value is set to
true. The default isfalse.- Engine string
Name of the database engine to be used for this DB cluster. Valid values:
aurora,aurora-mysql,aurora-postgresql. Defaults toaurora.- Engine
Version string Engine version of the Aurora global database. * NOTE: When the engine is set to
aurora-mysql, an engine version compatible with global database is required. The earliest available version is5.7.mysql_aurora.2.06.0.- Global
Cluster stringIdentifier The global cluster identifier.
- Global
Cluster stringResource Id AWS Region-unique, immutable identifier for the global database cluster. This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB cluster is accessed
- Storage
Encrypted bool Specifies whether the DB cluster is encrypted. The default is
false.
- arn string
RDS Global Cluster Amazon Resource Name (ARN)
- database
Name string Name for an automatically created database on cluster creation.
- deletion
Protection boolean If the Global Cluster should have deletion protection enabled. The database can’t be deleted when this value is set to
true. The default isfalse.- engine string
Name of the database engine to be used for this DB cluster. Valid values:
aurora,aurora-mysql,aurora-postgresql. Defaults toaurora.- engine
Version string Engine version of the Aurora global database. * NOTE: When the engine is set to
aurora-mysql, an engine version compatible with global database is required. The earliest available version is5.7.mysql_aurora.2.06.0.- global
Cluster stringIdentifier The global cluster identifier.
- global
Cluster stringResource Id AWS Region-unique, immutable identifier for the global database cluster. This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB cluster is accessed
- storage
Encrypted boolean Specifies whether the DB cluster is encrypted. The default is
false.
- arn str
RDS Global Cluster Amazon Resource Name (ARN)
- database_
name str Name for an automatically created database on cluster creation.
- deletion_
protection bool If the Global Cluster should have deletion protection enabled. The database can’t be deleted when this value is set to
true. The default isfalse.- engine str
Name of the database engine to be used for this DB cluster. Valid values:
aurora,aurora-mysql,aurora-postgresql. Defaults toaurora.- engine_
version str Engine version of the Aurora global database. * NOTE: When the engine is set to
aurora-mysql, an engine version compatible with global database is required. The earliest available version is5.7.mysql_aurora.2.06.0.- global_
cluster_ stridentifier The global cluster identifier.
- global_
cluster_ strresource_ id AWS Region-unique, immutable identifier for the global database cluster. This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB cluster is accessed
- storage_
encrypted bool Specifies whether the DB cluster is encrypted. The default is
false.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.