cloudposse / terraform-aws-elasticache-redis

Terraform module to provision an ElastiCache Redis Cluster
https://cloudposse.com/accelerate
Apache License 2.0
142 stars 246 forks source link

v0.43.0 should require aws >=4.0, because it uses root level "replicas_per_node_group" #167

Closed nate-selzer closed 2 years ago

nate-selzer commented 2 years ago

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

The required version of the aws provider for v0.43.0 of this module is >= 3.26

As you can see here, the variable aws_elasticache_replication_group.replicas_per_node_group is used in this version of the module.

However, this variable was only introduced in v4.0.0 of the aws terraform provider (previously, it was specified under the cluster_mode variable)

Expected Behavior

Expect the module to use only variables that are supported by the versions of the aws provider specified in versions.tf of the module.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Using v0.43.0 of this module, implement a component that requires v3.x of the aws terraform provider
  2. Specify replicas_per_node_group
  3. Run `atmos terraform plan -s
  4. See error

    
    Error: Unsupported argument
    
    on .terraform/modules/redis_clusters.redis/main.tf line 150, in resource "aws_elasticache_replication_group" "default":
    150:   replicas_per_node_group = var.cluster_mode_enabled ? var.cluster_mode_replicas_per_node_group : null

An argument named "replicas_per_node_group" is not expected here.


## Screenshots
If applicable, add screenshots or logs to help explain your problem.

## Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:
 - My output of `atmos terraform version`

Terraform v0.14.11

Your version of Terraform is out of date! The latest version is 1.2.2. You can update by downloading from https://www.terraform.io/downloads.html



## Additional Context
This issue also exists for the `num_node_groups` variable (and maybe others)