Skip to content

Add replication-group-secondary module for global datastore members#46

Merged
OlamideOl1 merged 3 commits into
mainfrom
create-replication-group-module
Jun 4, 2026
Merged

Add replication-group-secondary module for global datastore members#46
OlamideOl1 merged 3 commits into
mainfrom
create-replication-group-module

Conversation

@OlamideOl1

Copy link
Copy Markdown
Contributor

The existing elasticache-redis/replication-group module always configures engine, engine_version, node_type, transit/at-rest encryption, parameter group, snapshots, and an auth token on aws_elasticache_replication_group. When a replication group joins a global datastore via global_replication_group_id, AWS inherits all of those from the primary and the provider's ConflictsWith rules reject them -- even when passed as null, because Terraform still sees the attribute as configured. The node_type=null path also crashed the alarm locals via replace(var.node_type, ...).

This adds a dedicated replication-group-secondary module that omits every inherited/conflicting argument and exposes only what a secondary member needs (name, description, global_replication_group_id, subnets, replica count, security groups, alarms). The CloudWatch alarm node-type lookup now reads the node_type back off the created resource instead of a variable, and the random provider / auth-token generation are dropped since the token is inherited.

The existing elasticache-redis/replication-group module always configures
engine, engine_version, node_type, transit/at-rest encryption, parameter
group, snapshots, and an auth token on aws_elasticache_replication_group.
When a replication group joins a global datastore via
global_replication_group_id, AWS inherits all of those from the primary and
the provider's ConflictsWith rules reject them -- even when passed as null,
because Terraform still sees the attribute as configured. The node_type=null
path also crashed the alarm locals via replace(var.node_type, ...).

This adds a dedicated replication-group-secondary module that omits every
inherited/conflicting argument and exposes only what a secondary member needs
(name, description, global_replication_group_id, subnets, replica count,
security groups, alarms). The CloudWatch alarm node-type lookup now reads the
node_type back off the created resource instead of a variable, and the random
provider / auth-token generation are dropped since the token is inherited.
@OlamideOl1 OlamideOl1 requested a review from clarissalimab as a code owner June 4, 2026 08:08
@OlamideOl1 OlamideOl1 merged commit baa86df into main Jun 4, 2026
@OlamideOl1 OlamideOl1 deleted the create-replication-group-module branch June 4, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant