terraform-aws-elasticache-redis icon indicating copy to clipboard operation
terraform-aws-elasticache-redis copied to clipboard

invalid value for replication_group_id

Open artemkozlenkov opened this issue 3 years ago • 2 comments

Describe the Bug

After resources have been created the following outputs are present:

 Error: expected length of replication_group_id to be in the range (1 - 40), got 
│ 
│   with module.redis.aws_elasticache_replication_group.default[0],
│   on .terraform/modules/redis/main.tf line 120, in resource "aws_elasticache_replication_group" "default":
│  120:   replication_group_id          = var.replication_group_id == "" ? module.this.id : var.replication_group_id
│ 
╵
╷
│ Error: invalid value for replication_group_id (must contain only alphanumeric characters and hyphens)
│ 
│   with module.redis.aws_elasticache_replication_group.default[0],
│   on .terraform/modules/redis/main.tf line 120, in resource "aws_elasticache_replication_group" "default":
│  120:   replication_group_id          = var.replication_group_id == "" ? module.this.id : var.replication_group_id
│ 
╵
╷
│ Error: invalid value for replication_group_id (must begin with a letter)
│ 
│   with module.redis.aws_elasticache_replication_group.default[0],
│   on .terraform/modules/redis/main.tf line 120, in resource "aws_elasticache_replication_group" "default":
│  120:   replication_group_id          = var.replication_group_id == "" ? module.this.id : var.replication_group_id
│ 
╵
╷
│ Error: expected "replication_group_description" to not be an empty string, got 
│ 
│   with module.redis.aws_elasticache_replication_group.default[0],
│   on .terraform/modules/redis/main.tf line 121, in resource "aws_elasticache_replication_group" "default":
│  121:   replication_group_description = var.replication_group_id == "" ? module.this.id : var.replication_group_id

Expected Behavior

Expected no missing values in the module script.

Steps to Reproduce

Steps to reproduce the behavior:

  1. go to examples/complete
  2. terraform apply
  3. terraform apply
  4. See error

PS

to those affected as well in order to destroy resources go to .terraform/modules/redis/examples/complete/main.tf line 120,121 and replace the values with replication group id which you may query instead by utilizing aws cli aws elasticache describe-replication-groups

artemkozlenkov avatar May 17 '22 20:05 artemkozlenkov

any news ?

anthonykinetix avatar Oct 05 '23 11:10 anthonykinetix

Note that if you're trying to upgrade using the latest AWS provider (as of this writing, version 5.x), you have to bump this provider to at least version 0.51.1.

jpeeler avatar Jul 19 '24 21:07 jpeeler