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

main.tf#L15
resource "aws_rds_global_cluster" "example" {
 provider = "aws.primary"

  global_cluster_identifier = "example"
}

main.tf#L15
resource "aws_rds_global_cluster" "example" {
 provider = "aws.primary"

  global_cluster_identifier = "example"
}

main.tf#L15
resource "aws_rds_global_cluster" "example" {
 provider = "aws.primary"

  global_cluster_identifier = "example"
}

main.tf#L15
resource "aws_rds_global_cluster" "example" {
 provider = "aws.primary"

  global_cluster_identifier = "example"
}

main.tf#L5
resource "aws_rds_global_cluster" "global" {
  global_cluster_identifier = "cloudrail-test-non-encrypted"
  force_destroy             = true
}

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

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.

risk-label

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.

risk-label

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.

risk-label

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.

Review your AWS Amazon RDS settings

In addition to the above, there are other security points you should be aware of making sure that your .tf files are protected in Shisho Cloud.

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

stack-db.yml#L82
    Type: AWS::RDS::GlobalCluster
    Description: Global Database Cluster
    Properties:
      Engine: aurora-postgresql
      EngineVersion: '12.8'
      GlobalClusterIdentifier: !Sub ${ProjectId}-global-cluster
global-database.yml#L20
    Type: AWS::RDS::GlobalCluster
    DeletionPolicy: Retain
    UpdateReplacePolicy: Retain
    Properties:
      DeletionProtection: true
      SourceDBClusterIdentifier: !Ref GlobalClusterSourceDBClusterIdentifier
global-database.yml#L20
    Type: AWS::RDS::GlobalCluster
    DeletionPolicy: Retain
    UpdateReplacePolicy: Retain
    Properties:
      DeletionProtection: true
      SourceDBClusterIdentifier: !Ref GlobalClusterSourceDBClusterIdentifier
PilotLightDR.yaml#L214
    Type: 'AWS::RDS::GlobalCluster'
    Properties:
      GlobalClusterIdentifier: !Sub 'dr-immersionday-global-pilot'
      SourceDBClusterIdentifier: !Ref RDSClusterPrimary
  RDSClusterPrimary:
    Condition: CreatePrimaryDB
WarmStandbyDR.yaml#L213
    Type: 'AWS::RDS::GlobalCluster'
    Properties:
      GlobalClusterIdentifier: !Sub 'dr-immersionday-global-warm'
      SourceDBClusterIdentifier: !Ref RDSClusterPrimary
  RDSClusterPrimary:
    Condition: CreatePrimaryDB
template.json#L907
    "AWS::RDS::GlobalCluster": {
      "Type": "AWS::RDS::GlobalCluster",
      "Properties": {}
    },
    "AWS::FIS::ExperimentTemplate": {
      "Type": "AWS::FIS::ExperimentTemplate",
aurora_vpc_region.json#L626
    Type: AWS::RDS::GlobalCluster
    Properties:
      GlobalClusterIdentifier: !Ref GlobalDBClusterIdentifier
      SourceDBClusterIdentifier: !Ref AuroraDBCluster
      DeletionProtection: false

awsResouceIconMatches.json#L2067
        "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

Explanation in CloudFormation Registry

The AWS::RDS::GlobalCluster resource 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.