AWS ElastiCache Global Replication Group
This page shows how to write Terraform and CloudFormation for ElastiCache Global Replication Group and write them securely.
aws_elasticache_global_replication_group (Terraform)
The Global Replication Group in ElastiCache can be configured in Terraform with the resource name aws_elasticache_global_replication_group
. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_elasticache_global_replication_group" "this" {
global_replication_group_id_suffix = "ha"
primary_replication_group_id = module.redis_main.elasticache_replication_group_id
}
module "redis_replica" {
Parameters
-
actual_engine_version
optional computed - string -
arn
optional computed - string -
at_rest_encryption_enabled
optional computed - bool -
auth_token_enabled
optional computed - bool -
cache_node_type
optional computed - string -
cluster_enabled
optional computed - bool -
engine
optional computed - string -
global_replication_group_description
optional - string -
global_replication_group_id
optional computed - string -
global_replication_group_id_suffix
required - string -
id
optional computed - string -
primary_replication_group_id
required - string -
transit_encryption_enabled
optional computed - bool
Explanation in Terraform Registry
Provides an ElastiCache Global Replication Group resource, which manages replication between two or more Replication Groups in different regions. For more information, see the ElastiCache User Guide.
Tips: Best Practices for The Other AWS ElastiCache Resources
In addition to the aws_elasticache_cluster, AWS ElastiCache has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.
aws_elasticache_cluster
Ensure to enable backup retention of Elasitcache
It's better to take snapshots of Redis clusters to improve data availability.
aws_elasticache_replication_group
Ensure to enable in-transit encryption of ElastiCache
It's better to enable in-transit encryption of ElastiCahe. If the ElastiCache replication group uses unencrypted traffic, it is vulnerable to meet-in-the-middle (MITM) attacks.
AWS::ElastiCache::GlobalReplicationGroup (CloudFormation)
The GlobalReplicationGroup in ElastiCache can be configured in CloudFormation with the resource name AWS::ElastiCache::GlobalReplicationGroup
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
GlobalReplicationGroupIdSuffix
optional - String -
AutomaticFailoverEnabled
optional - Boolean -
CacheNodeType
optional - String -
EngineVersion
optional - String -
CacheParameterGroupName
optional - String -
GlobalNodeGroupCount
optional - Integer -
GlobalReplicationGroupDescription
optional - String -
Members
required - List of GlobalReplicationGroupMember -
RegionalConfigurations
optional - List of RegionalConfiguration
Explanation in CloudFormation Registry
Consists of a primary cluster that accepts writes and an associated secondary cluster that resides in a different Amazon region. The secondary cluster accepts only reads. The primary cluster automatically replicates updates to the secondary cluster.
- The GlobalReplicationGroupIdSuffix represents the name of the Global datastore, which is what you use to associate a secondary cluster.
Frequently asked questions
What is AWS ElastiCache Global Replication Group?
AWS ElastiCache Global Replication Group is a resource for ElastiCache of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS ElastiCache Global Replication Group?
For Terraform, the umotif-public/terraform-aws-elasticache-redis source code example is useful. See the Terraform Example section for further details.