diff --git a/README.md b/README.md index 4ea2077..92ef5fa 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ No modules. | [parameter\_group\_name](#input\_parameter\_group\_name) | n/a | `string` | `""` | no | | [port](#input\_port) | n/a | `number` | `6379` | no | | [security\_group\_ids](#input\_security\_group\_ids) | n/a | `list(string)` | `[]` | no | +| [snapshot\_retention\_limit](#input\_snapshot\_retention\_limit) | The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, then a snapshot that was taken today will be retained for 5 days before being deleted. | `number` | `7` | no | | [tags](#input\_tags) | n/a | `map(string)` |
{| no | | [vpc\_id](#input\_vpc\_id) | n/a | `string` | n/a | yes | diff --git a/main.tf b/main.tf index 734d62d..177414d 100644 --- a/main.tf +++ b/main.tf @@ -10,19 +10,17 @@ terraform { } resource "aws_elasticache_cluster" "redis" { - cluster_id = var.cluster_id - engine = var.engine - engine_version = var.engine_version - node_type = var.node_type - num_cache_nodes = var.num_cache_nodes - parameter_group_name = var.parameter_group_name - port = var.port - security_group_ids = var.security_group_ids - - subnet_group_name = aws_subnet.private.name - - - tags = var.tags + cluster_id = var.cluster_id + engine = var.engine + engine_version = var.engine_version + node_type = var.node_type + num_cache_nodes = var.num_cache_nodes + parameter_group_name = var.parameter_group_name + port = var.port + security_group_ids = var.security_group_ids + subnet_group_name = aws_subnet.private.name + tags = var.tags + snapshot_retention_limit = var.snapshot_retention_limit } resource "aws_subnet" "private" { diff --git a/variables.tf b/variables.tf index bc1cb53..16b6213 100644 --- a/variables.tf +++ b/variables.tf @@ -54,3 +54,9 @@ variable "tags" { Owner = "Batcave" } } + +variable "snapshot_retention_limit" { + type = number + default = 7 + description = "The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, then a snapshot that was taken today will be retained for 5 days before being deleted." +}
"Owner": "Batcave"
}