umotif-public / terraform-aws-elasticache-redis

A Terraform module to create an AWS Redis ElastiCache cluster.
https://registry.terraform.io/modules/umotif-public/elasticache-redis/aws
Other
40 stars 64 forks source link

Fix count for redis_egress sg rule #42

Open IrmantasMarozas opened 1 year ago

IrmantasMarozas commented 1 year ago

Description

Fix count for redis_egress sg rule

I'm not sure why, but pre-commit hook for docs didn't work for me, so I commented it out.

Terraform docs...........................................................Failed

Ohid25 commented 1 year ago

Has this been validated using one of the examples?

I tried running this change against one of the examples and I got

❯ terraform validate
╷
│ Error: Incorrect attribute value type
│
│   on ../../main.tf line 142, in resource "aws_security_group_rule" "redis_egress":
│  142:   cidr_blocks       = var.egress_cidr_blocks[count.index]
│     ├────────────────
│     │ count.index is a number
│     │ var.egress_cidr_blocks is a list of string
│
│ Inappropriate value for attribute "cidr_blocks": list of string required.

Second, I'm not totally sure what the issue is here in the first place. What is this solution trying to solve?