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_versionoptional computed - string -
arnoptional computed - string -
at_rest_encryption_enabledoptional computed - bool -
auth_token_enabledoptional computed - bool -
cache_node_typeoptional computed - string -
cluster_enabledoptional computed - bool -
engineoptional computed - string -
global_replication_group_descriptionoptional - string -
global_replication_group_idoptional computed - string -
global_replication_group_id_suffixrequired - string -
idoptional computed - string -
primary_replication_group_idrequired - string -
transit_encryption_enabledoptional 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
-
GlobalReplicationGroupIdSuffixoptional - String -
AutomaticFailoverEnabledoptional - Boolean -
CacheNodeTypeoptional - String -
EngineVersionoptional - String -
CacheParameterGroupNameoptional - String -
GlobalNodeGroupCountoptional - Integer -
GlobalReplicationGroupDescriptionoptional - String -
Membersrequired - List of GlobalReplicationGroupMember -
RegionalConfigurationsoptional - 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.