AWS Amazon RDS Global Cluster
This page shows how to write Terraform and CloudFormation for Amazon RDS Global Cluster and write them securely.
aws_rds_global_cluster (Terraform)
The Global Cluster in Amazon RDS can be configured in Terraform with the resource name aws_rds_global_cluster. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_rds_global_cluster" "example" {
provider = "aws.primary"
global_cluster_identifier = "example"
}
resource "aws_rds_global_cluster" "example" {
provider = "aws.primary"
global_cluster_identifier = "example"
}
resource "aws_rds_global_cluster" "example" {
provider = "aws.primary"
global_cluster_identifier = "example"
}
resource "aws_rds_global_cluster" "example" {
provider = "aws.primary"
global_cluster_identifier = "example"
}
resource "aws_rds_global_cluster" "global" {
global_cluster_identifier = "cloudrail-test-non-encrypted"
force_destroy = true
}
Parameters
-
arnoptional computed - string -
database_nameoptional - string -
deletion_protectionoptional - bool -
engineoptional computed - string -
engine_versionoptional computed - string -
force_destroyoptional - bool -
global_cluster_identifierrequired - string -
global_cluster_membersoptional computed - set of object-
db_cluster_arn- string -
is_writer- bool
-
-
global_cluster_resource_idoptional computed - string -
idoptional computed - string -
source_db_cluster_identifieroptional computed - string -
storage_encryptedoptional computed - bool
Explanation in Terraform Registry
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.
Tips: Best Practices for The Other AWS Amazon RDS Resources
In addition to the aws_db_instance, AWS Amazon RDS has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.
aws_db_instance
Ensure backup retension of your RDS instance is specified
It's better to set it explicitly to reduce the risk of availability issues.
aws_rds_cluster
Ensure backup retension of your RDS cluster is specified
It's better to set it explicitly to reduce the risk of availability issues.
aws_rds_cluster_instance
Ensure your RDS cluster instance blocks unwanted access
It's better to limit accessibily to the minimum that is required for the application to work.
AWS::RDS::GlobalCluster (CloudFormation)
The GlobalCluster in RDS can be configured in CloudFormation with the resource name AWS::RDS::GlobalCluster. The following sections describe 8 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::RDS::GlobalCluster
Description: Global Database Cluster
Properties:
Engine: aurora-postgresql
EngineVersion: '12.8'
GlobalClusterIdentifier: !Sub ${ProjectId}-global-cluster
Type: AWS::RDS::GlobalCluster
DeletionPolicy: Retain
UpdateReplacePolicy: Retain
Properties:
DeletionProtection: true
SourceDBClusterIdentifier: !Ref GlobalClusterSourceDBClusterIdentifier
Type: AWS::RDS::GlobalCluster
DeletionPolicy: Retain
UpdateReplacePolicy: Retain
Properties:
DeletionProtection: true
SourceDBClusterIdentifier: !Ref GlobalClusterSourceDBClusterIdentifier
Type: 'AWS::RDS::GlobalCluster'
Properties:
GlobalClusterIdentifier: !Sub 'dr-immersionday-global-pilot'
SourceDBClusterIdentifier: !Ref RDSClusterPrimary
RDSClusterPrimary:
Condition: CreatePrimaryDB
Type: 'AWS::RDS::GlobalCluster'
Properties:
GlobalClusterIdentifier: !Sub 'dr-immersionday-global-warm'
SourceDBClusterIdentifier: !Ref RDSClusterPrimary
RDSClusterPrimary:
Condition: CreatePrimaryDB
"AWS::RDS::GlobalCluster": {
"Type": "AWS::RDS::GlobalCluster",
"Properties": {}
},
"AWS::FIS::ExperimentTemplate": {
"Type": "AWS::FIS::ExperimentTemplate",
Type: AWS::RDS::GlobalCluster
Properties:
GlobalClusterIdentifier: !Ref GlobalDBClusterIdentifier
SourceDBClusterIdentifier: !Ref AuroraDBCluster
DeletionProtection: false
"resourceType": "AWS::RDS::GlobalCluster",
"filePath": null
},
{
"resourceType": "AWS::RDS::DBInstance",
"filePath": "icons/aws/Resource/Res_Compute/Res_48_Dark/Res_Amazon-EC2_Instance_48_Dark_gen.png",
Parameters
-
Engineoptional - String -
EngineVersionoptional - String -
DeletionProtectionoptional - Boolean -
GlobalClusterIdentifieroptional - String -
SourceDBClusterIdentifieroptional - String -
StorageEncryptedoptional - Boolean
Explanation in CloudFormation Registry
The
AWS::RDS::GlobalClusterresource creates or updates an Amazon Aurora global database spread across multiple AWS 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.
You can create a global database that is initially empty, and then add a primary cluster and a secondary cluster to it.
For information about Aurora global databases, see Working with Amazon Aurora Global Databases in the Amazon Aurora User Guide.
Frequently asked questions
What is AWS Amazon RDS Global Cluster?
AWS Amazon RDS Global Cluster is a resource for Amazon RDS of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Amazon RDS Global Cluster?
For Terraform, the 111crb111/terraform-aws-rds-no-versions, 111crb111/terraform-uknownprovider-rds-no-versions and 111crb111/terraform-aws-allzzz source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the aws-samples/route-53-application-recovery-controller, PRX/Infrastructure and PRX/Infrastructure source code examples are useful. See the CloudFormation Example section for further details.