Skip to content

Commit

Permalink
Adds documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gdavison committed May 26, 2022
1 parent 4dc0ebf commit f5c26df
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions website/docs/r/elasticache_global_replication_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,65 @@ resource "aws_elasticache_replication_group" "secondary" {
}
```

### Managing Redis Engine Versions

The initial Redis version is deterined by the version set on the primary replication group.
However, once it is part of a Global Replication Group,
the Global Replication Group manages the version of all member replication groups.

In this example,
the primary replication group will be created with Redis 6.0,
and then upgraded to Redis 6.2 once added to the Global Replication Group.
The secondary replication group will be created with Redis 6.2.

```terraform
resource "aws_elasticache_global_replication_group" "example" {
global_replication_group_id_suffix = "example"
primary_replication_group_id = aws_elasticache_replication_group.primary.id
engine_version = "6.2"
}
resource "aws_elasticache_replication_group" "primary" {
replication_group_id = "example-primary"
replication_group_description = "primary replication group"
engine = "redis"
engine_version = "6.0"
node_type = "cache.m5.large"
number_cache_clusters = 1
}
resource "aws_elasticache_replication_group" "secondary" {
provider = aws.other_region
replication_group_id = "example-secondary"
replication_group_description = "secondary replication group"
global_replication_group_id = aws_elasticache_global_replication_group.example.global_replication_group_id
number_cache_clusters = 1
}
```

## Argument Reference

The following arguments are supported:

* `engine_version` - (Optional) Redis version to use for the Global Replication Group.
When creating, by default the Global Replication Group inherits the version of the primary replication group.
If a version is specified, the Global Replication Group and all member replication groups will be upgraded to this version.
Cannot be downgraded without replacing the Global Replication Group and all member replication groups.
If the version is 6 or higher, the major and minor version can be set, e.g., `6.2`,
or the minor version can be unspecified which will use the latest version at creation time, e.g., `6.x`.
The actual engine version used is returned in the attribute `engine_version_actual`, see [Attributes Reference](#attributes-reference) below.
* `global_replication_group_id_suffix` – (Required) The suffix name of a Global Datastore. If `global_replication_group_id_suffix` is changed, creates a new resource.
* `primary_replication_group_id` – (Required) The ID of the primary cluster that accepts writes and will replicate updates to the secondary cluster. If `primary_replication_group_id` is changed, creates a new resource.
* `global_replication_group_description` – (Optional) A user-created description for the global replication group.
* `parameter_group_name` - (Optional) An ElastiCache Parameter Group to use for the Global Replication Group.
Required when upgrading a major engine version, but will be ignored if left configured after the upgrade is complete.
Specifying without a major version upgrade will fail.
Note that ElastiCache creates a copy of this parameter group for each member replication group.

## Attributes Reference

Expand Down

0 comments on commit f5c26df

Please sign in to comment.