From 97bc4b5dbab8d2ea78ffd6aaf5716ab271f11f59 Mon Sep 17 00:00:00 2001 From: Melissa Greenbaum <69476188+magreenbaum@users.noreply.github.com> Date: Sun, 4 Aug 2024 09:36:08 -0400 Subject: [PATCH 01/18] fix: Argument `replication_group_id` conflicts with `engine` and `log_delivery_configuration` (#10) --- .../README.md | 79 +++++++++ .../main.tf | 155 ++++++++++++++++++ .../outputs.tf | 142 ++++++++++++++++ .../variables.tf | 0 .../versions.tf | 10 ++ main.tf | 4 +- 6 files changed, 388 insertions(+), 2 deletions(-) create mode 100644 examples/redis-replication-group-with-cluster-replica/README.md create mode 100644 examples/redis-replication-group-with-cluster-replica/main.tf create mode 100644 examples/redis-replication-group-with-cluster-replica/outputs.tf create mode 100644 examples/redis-replication-group-with-cluster-replica/variables.tf create mode 100644 examples/redis-replication-group-with-cluster-replica/versions.tf diff --git a/examples/redis-replication-group-with-cluster-replica/README.md b/examples/redis-replication-group-with-cluster-replica/README.md new file mode 100644 index 0000000..58565af --- /dev/null +++ b/examples/redis-replication-group-with-cluster-replica/README.md @@ -0,0 +1,79 @@ +# ElastiCache example for Redis replication group with cluster replica + +Configuration in this directory creates a replication group with a cluster replica both in a single module and separate modules as well to show adding a cluster replica to an existing replication group. + +## Usage + +To run this example you need to execute: + +```bash +$ terraform init +$ terraform plan +$ terraform apply +``` + +Note that this example may create resources which will incur monetary charges on your AWS bill. Run `terraform destroy` when you no longer need these resources. + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.0 | +| [aws](#requirement\_aws) | >= 5.47 | + +## Providers + +| Name | Version | +|------|---------| +| [aws](#provider\_aws) | >= 5.47 | + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [cluster\_replica](#module\_cluster\_replica) | ../../ | n/a | +| [replication\_group](#module\_replication\_group) | ../../ | n/a | +| [replication\_group\_with\_cluster\_replica](#module\_replication\_group\_with\_cluster\_replica) | ../../ | n/a | +| [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 | + +## Resources + +| Name | Type | +|------|------| +| [aws_availability_zones.available](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zones) | data source | + +## Inputs + +No inputs. + +## Outputs + +| Name | Description | +|------|-------------| +| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | +| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | +| [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | +| [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | +| [cluster\_configuration\_endpoint](#output\_cluster\_configuration\_endpoint) | (Memcached only) Configuration endpoint to allow host discovery | +| [cluster\_engine\_version\_actual](#output\_cluster\_engine\_version\_actual) | Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine | +| [global\_replication\_group\_arn](#output\_global\_replication\_group\_arn) | ARN of the created ElastiCache Global Replication Group | +| [global\_replication\_group\_engine\_version\_actual](#output\_global\_replication\_group\_engine\_version\_actual) | The full version number of the cache engine running on the members of this global replication group | +| [global\_replication\_group\_id](#output\_global\_replication\_group\_id) | ID of the ElastiCache Global Replication Group | +| [global\_replication\_group\_node\_groups](#output\_global\_replication\_group\_node\_groups) | Set of node groups (shards) on the global replication group | +| [parameter\_group\_arn](#output\_parameter\_group\_arn) | The AWS ARN associated with the parameter group | +| [parameter\_group\_id](#output\_parameter\_group\_id) | The ElastiCache parameter group name | +| [replication\_group\_arn](#output\_replication\_group\_arn) | ARN of the created ElastiCache Replication Group | +| [replication\_group\_coniguration\_endpoint\_address](#output\_replication\_group\_coniguration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | +| [replication\_group\_engine\_version\_actual](#output\_replication\_group\_engine\_version\_actual) | Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine | +| [replication\_group\_id](#output\_replication\_group\_id) | ID of the ElastiCache Replication Group | +| [replication\_group\_member\_clusters](#output\_replication\_group\_member\_clusters) | Identifiers of all the nodes that are part of this replication group | +| [replication\_group\_primary\_endpoint\_address](#output\_replication\_group\_primary\_endpoint\_address) | Address of the endpoint for the primary node in the replication group, if the cluster mode is disabled | +| [replication\_group\_reader\_endpoint\_address](#output\_replication\_group\_reader\_endpoint\_address) | Address of the endpoint for the reader node in the replication group, if the cluster mode is disabled | +| [security\_group\_arn](#output\_security\_group\_arn) | Amazon Resource Name (ARN) of the security group | +| [security\_group\_id](#output\_security\_group\_id) | ID of the security group | +| [subnet\_group\_name](#output\_subnet\_group\_name) | The ElastiCache subnet group name | + + +Apache-2.0 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-elasticache/blob/master/LICENSE). diff --git a/examples/redis-replication-group-with-cluster-replica/main.tf b/examples/redis-replication-group-with-cluster-replica/main.tf new file mode 100644 index 0000000..c0e790e --- /dev/null +++ b/examples/redis-replication-group-with-cluster-replica/main.tf @@ -0,0 +1,155 @@ +provider "aws" { + region = local.region +} + +data "aws_availability_zones" "available" {} + +locals { + region = "eu-west-1" + name = "ex-${basename(path.cwd)}" + + vpc_cidr = "10.0.0.0/16" + azs = slice(data.aws_availability_zones.available.names, 0, 3) + + tags = { + Name = local.name + Example = local.name + Repository = "https://github.com/terraform-aws-modules/terraform-aws-elasticache" + } +} + +################################################################################ +# Replication Group with Cluster Replica (single module) +################################################################################ +module "replication_group_with_cluster_replica" { + source = "../../" + + cluster_id = "cluster" + create_cluster = true + create_replication_group = true + replication_group_id = "repl-grp-with-cluster-replica" + + log_delivery_configuration = { + slow-log = { + cloudwatch_log_group_name = "repl-grp-with-cluster-replica" + destination_type = "cloudwatch-logs" + log_format = "json" + } + } + + engine_version = "7.1" + node_type = "cache.t4g.small" + + maintenance_window = "sun:05:00-sun:09:00" + apply_immediately = true + + # Security Group + vpc_id = module.vpc.vpc_id + security_group_rules = { + ingress_vpc = { + # Default type is `ingress` + # Default port is based on the default engine port + description = "VPC traffic" + cidr_ipv4 = module.vpc.vpc_cidr_block + } + } + + # Subnet Group + subnet_group_name = "repl-grp-with-cluster-replica" + subnet_group_description = "repl-grp-with-cluster-replica subnet group" + subnet_ids = module.vpc.private_subnets + + # Parameter Group + create_parameter_group = true + parameter_group_name = "repl-grp-with-cluster-replica" + parameter_group_family = "redis7" + parameter_group_description = "repl-grp-with-cluster-replica parameter group" + parameters = [ + { + name = "latency-tracking" + value = "yes" + } + ] + + tags = local.tags +} + +################################################################################ +# Add Cluster Replica to Existing Replication Group (separate modules) +################################################################################ +module "replication_group" { + source = "../../" + + replication_group_id = "ex-replication-group" + + engine_version = "7.1" + node_type = "cache.t4g.small" + + transit_encryption_enabled = true + auth_token = "PickSomethingMoreSecure123!" + maintenance_window = "sun:05:00-sun:09:00" + apply_immediately = true + + # Security Group + vpc_id = module.vpc.vpc_id + security_group_rules = { + ingress_vpc = { + # Default type is `ingress` + # Default port is based on the default engine port + description = "VPC traffic" + cidr_ipv4 = module.vpc.vpc_cidr_block + } + } + + # Subnet Group + subnet_group_name = "ex-replication-group" + subnet_group_description = "${title(local.name)} subnet group" + subnet_ids = module.vpc.private_subnets + + # Parameter Group + create_parameter_group = true + parameter_group_name = "ex-replication-group" + parameter_group_family = "redis7" + parameter_group_description = "${title(local.name)} parameter group" + parameters = [ + { + name = "latency-tracking" + value = "yes" + } + ] + + tags = local.tags +} + +module "cluster_replica" { + source = "../../" + + cluster_id = "ex-cluster-replica" + create_cluster = true + cluster_mode_enabled = false + replication_group_id = module.replication_group.replication_group_id + create_replication_group = false + create_subnet_group = false + + log_delivery_configuration = { + create_cloudwatch_log_group = false + } +} + +################################################################################ +# Supporting Resources +################################################################################ + +module "vpc" { + source = "terraform-aws-modules/vpc/aws" + version = "~> 5.0" + + name = local.name + cidr = local.vpc_cidr + + azs = local.azs + public_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 8, k)] + private_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 8, k + 10)] + + tags = local.tags +} diff --git a/examples/redis-replication-group-with-cluster-replica/outputs.tf b/examples/redis-replication-group-with-cluster-replica/outputs.tf new file mode 100644 index 0000000..e15b230 --- /dev/null +++ b/examples/redis-replication-group-with-cluster-replica/outputs.tf @@ -0,0 +1,142 @@ +################################################################################ +# Cluster +################################################################################ + +output "cluster_arn" { + description = "The ARN of the ElastiCache Cluster" + value = module.replication_group_with_cluster_replica.cluster_arn +} + +output "cluster_engine_version_actual" { + description = "Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine" + value = module.replication_group_with_cluster_replica.cluster_engine_version_actual +} + +output "cluster_cache_nodes" { + description = "List of node objects including `id`, `address`, `port` and `availability_zone`" + value = module.replication_group_with_cluster_replica.cluster_cache_nodes +} + +output "cluster_address" { + description = "(Memcached only) DNS name of the cache cluster without the port appended" + value = module.replication_group_with_cluster_replica.cluster_address +} + +output "cluster_configuration_endpoint" { + description = "(Memcached only) Configuration endpoint to allow host discovery" + value = module.replication_group_with_cluster_replica.cluster_configuration_endpoint +} + +################################################################################ +# Replication Group +################################################################################ + +output "replication_group_arn" { + description = "ARN of the created ElastiCache Replication Group" + value = module.replication_group_with_cluster_replica.replication_group_arn +} + +output "replication_group_engine_version_actual" { + description = "Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine" + value = module.replication_group_with_cluster_replica.replication_group_engine_version_actual +} + +output "replication_group_coniguration_endpoint_address" { + description = "Address of the replication group configuration endpoint when cluster mode is enabled" + value = module.replication_group_with_cluster_replica.replication_group_coniguration_endpoint_address +} + +output "replication_group_id" { + description = "ID of the ElastiCache Replication Group" + value = module.replication_group_with_cluster_replica.replication_group_id +} + +output "replication_group_member_clusters" { + description = "Identifiers of all the nodes that are part of this replication group" + value = module.replication_group_with_cluster_replica.replication_group_member_clusters +} + +output "replication_group_primary_endpoint_address" { + description = "Address of the endpoint for the primary node in the replication group, if the cluster mode is disabled" + value = module.replication_group_with_cluster_replica.replication_group_primary_endpoint_address +} + +output "replication_group_reader_endpoint_address" { + description = "Address of the endpoint for the reader node in the replication group, if the cluster mode is disabled" + value = module.replication_group_with_cluster_replica.replication_group_reader_endpoint_address +} + +################################################################################ +# Global Replication Group +################################################################################ + +output "global_replication_group_id" { + description = "ID of the ElastiCache Global Replication Group" + value = module.replication_group_with_cluster_replica.global_replication_group_id +} + +output "global_replication_group_arn" { + description = "ARN of the created ElastiCache Global Replication Group" + value = module.replication_group_with_cluster_replica.global_replication_group_arn +} + +output "global_replication_group_engine_version_actual" { + description = "The full version number of the cache engine running on the members of this global replication group" + value = module.replication_group_with_cluster_replica.global_replication_group_engine_version_actual +} + +output "global_replication_group_node_groups" { + description = "Set of node groups (shards) on the global replication group" + value = module.replication_group_with_cluster_replica.global_replication_group_node_groups +} + +################################################################################ +# CloudWatch Log Group +################################################################################ + +output "cloudwatch_log_group_name" { + description = "Name of cloudwatch log group created" + value = module.replication_group_with_cluster_replica.cloudwatch_log_group_name +} + +output "cloudwatch_log_group_arn" { + description = "Arn of cloudwatch log group created" + value = module.replication_group_with_cluster_replica.cloudwatch_log_group_arn +} + +################################################################################ +# Parameter Group +################################################################################ + +output "parameter_group_arn" { + description = "The AWS ARN associated with the parameter group" + value = module.replication_group_with_cluster_replica.parameter_group_arn +} + +output "parameter_group_id" { + description = "The ElastiCache parameter group name" + value = module.replication_group_with_cluster_replica.parameter_group_id +} + +################################################################################ +# Subnet Group +################################################################################ + +output "subnet_group_name" { + description = "The ElastiCache subnet group name" + value = module.replication_group_with_cluster_replica.subnet_group_name +} + +################################################################################ +# Security Group +################################################################################ + +output "security_group_arn" { + description = "Amazon Resource Name (ARN) of the security group" + value = module.replication_group_with_cluster_replica.security_group_arn +} + +output "security_group_id" { + description = "ID of the security group" + value = module.replication_group_with_cluster_replica.security_group_id +} diff --git a/examples/redis-replication-group-with-cluster-replica/variables.tf b/examples/redis-replication-group-with-cluster-replica/variables.tf new file mode 100644 index 0000000..e69de29 diff --git a/examples/redis-replication-group-with-cluster-replica/versions.tf b/examples/redis-replication-group-with-cluster-replica/versions.tf new file mode 100644 index 0000000..407a955 --- /dev/null +++ b/examples/redis-replication-group-with-cluster-replica/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 5.47" + } + } +} diff --git a/main.tf b/main.tf index b91055f..a4f6c95 100644 --- a/main.tf +++ b/main.tf @@ -20,13 +20,13 @@ resource "aws_elasticache_cluster" "this" { availability_zone = var.availability_zone az_mode = local.in_replication_group ? null : var.az_mode cluster_id = var.cluster_id - engine = var.engine + engine = local.in_replication_group ? null : var.engine engine_version = local.in_replication_group ? null : var.engine_version final_snapshot_identifier = var.final_snapshot_identifier ip_discovery = var.ip_discovery dynamic "log_delivery_configuration" { - for_each = { for k, v in var.log_delivery_configuration : k => v if var.engine != "memcached" } + for_each = { for k, v in var.log_delivery_configuration : k => v if var.engine != "memcached" && !local.in_replication_group } content { destination = try(log_delivery_configuration.value.create_cloudwatch_log_group, true) && log_delivery_configuration.value.destination_type == "cloudwatch-logs" ? aws_cloudwatch_log_group.this[log_delivery_configuration.key].name : log_delivery_configuration.value.destination From 575c3125c7b9af352030dfc07599896332c308f9 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 4 Aug 2024 13:36:36 +0000 Subject: [PATCH 02/18] chore(release): version 1.2.2 [skip ci] ## [1.2.2](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.2.1...v1.2.2) (2024-08-04) ### Bug Fixes * Argument `replication_group_id` conflicts with `engine` and `log_delivery_configuration` ([#10](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/10)) ([97bc4b5](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/97bc4b5dbab8d2ea78ffd6aaf5716ab271f11f59)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cdca13..6c308cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## [1.2.2](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.2.1...v1.2.2) (2024-08-04) + + +### Bug Fixes + +* Argument `replication_group_id` conflicts with `engine` and `log_delivery_configuration` ([#10](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/10)) ([97bc4b5](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/97bc4b5dbab8d2ea78ffd6aaf5716ab271f11f59)) + ## [1.2.1](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.2.0...v1.2.1) (2024-08-03) From 2a02a2cf0fa4d62cee9a56f5be727b1bab7808cd Mon Sep 17 00:00:00 2001 From: dszlawski-chaos <150796481+dszlawski-chaos@users.noreply.github.com> Date: Mon, 9 Sep 2024 16:14:54 +0200 Subject: [PATCH 03/18] fix: Fix cache_usage_limits issue when empty map (default value) is provided. (#13) --- modules/serverless-cache/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/serverless-cache/main.tf b/modules/serverless-cache/main.tf index 9a08d92..729d103 100644 --- a/modules/serverless-cache/main.tf +++ b/modules/serverless-cache/main.tf @@ -5,7 +5,7 @@ resource "aws_elasticache_serverless_cache" "this" { name = var.cache_name dynamic "cache_usage_limits" { - for_each = try([var.cache_usage_limits], []) + for_each = length(var.cache_usage_limits) > 0 ? [var.cache_usage_limits] : [] content { dynamic "data_storage" { From 7e0ea954b99711fcfdd527e682dfca820748f185 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 9 Sep 2024 14:15:24 +0000 Subject: [PATCH 04/18] chore(release): version 1.2.3 [skip ci] ## [1.2.3](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.2.2...v1.2.3) (2024-09-09) ### Bug Fixes * Fix cache_usage_limits issue when empty map (default value) is provided. ([#13](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/13)) ([2a02a2c](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/2a02a2cf0fa4d62cee9a56f5be727b1bab7808cd)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c308cc..328d812 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## [1.2.3](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.2.2...v1.2.3) (2024-09-09) + + +### Bug Fixes + +* Fix cache_usage_limits issue when empty map (default value) is provided. ([#13](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/13)) ([2a02a2c](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/2a02a2cf0fa4d62cee9a56f5be727b1bab7808cd)) + ## [1.2.2](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.2.1...v1.2.2) (2024-08-04) From fc7dbf6f981f2cd59a3125888797015fd8bae13f Mon Sep 17 00:00:00 2001 From: Vitalii Morvaniuk Date: Tue, 1 Oct 2024 19:28:28 +0200 Subject: [PATCH 05/18] docs: Update README to use correct argument for security groups (#15) Co-authored-by: Vitalii Morvaniuk Co-authored-by: Bryant Biggs --- .github/workflows/pre-commit.yml | 4 ++-- .pre-commit-config.yaml | 4 ++-- README.md | 6 +++--- examples/memcached-cluster/README.md | 4 ++-- examples/redis-cluster-mode/README.md | 4 ++-- examples/redis-cluster/README.md | 4 ++-- examples/redis-global-replication-group/README.md | 4 ++-- .../redis-replication-group-with-cluster-replica/README.md | 4 ++-- examples/redis-replication-group/README.md | 4 ++-- modules/serverless-cache/README.md | 6 +++--- modules/user-group/README.md | 4 ++-- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index c2632d1..71878b4 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -7,8 +7,8 @@ on: - master env: - TERRAFORM_DOCS_VERSION: v0.16.0 - TFLINT_VERSION: v0.50.3 + TERRAFORM_DOCS_VERSION: v0.19.0 + TFLINT_VERSION: v0.53.0 jobs: collectInputs: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ade44ff..6c4c2e8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.88.2 + rev: v1.96.1 hooks: - id: terraform_fmt - id: terraform_docs @@ -24,7 +24,7 @@ repos: - '--args=--only=terraform_unused_required_providers' - id: terraform_validate - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-merge-conflict - id: end-of-file-fixer diff --git a/README.md b/README.md index 9444046..6b1a5e2 100644 --- a/README.md +++ b/README.md @@ -278,7 +278,7 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module - [Redis Global Replication Group](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/redis-global-replication-group) - [Redis Replication Group](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/redis-replication-group) - + ## Requirements | Name | Version | @@ -344,7 +344,7 @@ No modules. | [global\_replication\_group\_id](#input\_global\_replication\_group\_id) | The ID of the global replication group to which this replication group should belong | `string` | `null` | no | | [ip\_discovery](#input\_ip\_discovery) | The IP version to advertise in the discovery protocol. Valid values are `ipv4` or `ipv6` | `string` | `null` | no | | [kms\_key\_arn](#input\_kms\_key\_arn) | The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if `at_rest_encryption_enabled = true` | `string` | `null` | no | -| [log\_delivery\_configuration](#input\_log\_delivery\_configuration) | (Redis only) Specifies the destination and format of Redis SLOWLOG or Redis Engine Log | `any` |
{
"slow-log": {
"destination_type": "cloudwatch-logs",
"log_format": "json"
}
}
| no | +| [log\_delivery\_configuration](#input\_log\_delivery\_configuration) | (Redis only) Specifies the destination and format of Redis SLOWLOG or Redis Engine Log | `any` |
{
"slow-log": {
"destination_type": "cloudwatch-logs",
"log_format": "json"
}
}
| no | | [maintenance\_window](#input\_maintenance\_window) | Specifies the weekly time range for when maintenance on the cache cluster is performed. The format is `ddd:hh24:mi-ddd:hh24:mi` (24H Clock UTC) | `string` | `null` | no | | [multi\_az\_enabled](#input\_multi\_az\_enabled) | Specifies whether to enable Multi-AZ Support for the replication group. If true, `automatic_failover_enabled` must also be enabled. Defaults to `false` | `bool` | `false` | no | | [network\_type](#input\_network\_type) | The IP versions for cache cluster connections. Valid values are `ipv4`, `ipv6` or `dual_stack` | `string` | `null` | no | @@ -411,7 +411,7 @@ No modules. | [security\_group\_arn](#output\_security\_group\_arn) | Amazon Resource Name (ARN) of the security group | | [security\_group\_id](#output\_security\_group\_id) | ID of the security group | | [subnet\_group\_name](#output\_subnet\_group\_name) | The ElastiCache subnet group name | - + ## License diff --git a/examples/memcached-cluster/README.md b/examples/memcached-cluster/README.md index bdd38fb..7d84e7b 100644 --- a/examples/memcached-cluster/README.md +++ b/examples/memcached-cluster/README.md @@ -14,7 +14,7 @@ $ terraform apply Note that this example may create resources which will incur monetary charges on your AWS bill. Run `terraform destroy` when you no longer need these resources. - + ## Requirements | Name | Version | @@ -73,6 +73,6 @@ No inputs. | [security\_group\_arn](#output\_security\_group\_arn) | Amazon Resource Name (ARN) of the security group | | [security\_group\_id](#output\_security\_group\_id) | ID of the security group | | [subnet\_group\_name](#output\_subnet\_group\_name) | The ElastiCache subnet group name | - + Apache-2.0 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-elasticache/blob/master/LICENSE). diff --git a/examples/redis-cluster-mode/README.md b/examples/redis-cluster-mode/README.md index d6b4f87..4cf66fd 100644 --- a/examples/redis-cluster-mode/README.md +++ b/examples/redis-cluster-mode/README.md @@ -16,7 +16,7 @@ $ terraform apply Note that this example may create resources which will incur monetary charges on your AWS bill. Run `terraform destroy` when you no longer need these resources. - + ## Requirements | Name | Version | @@ -75,6 +75,6 @@ No inputs. | [security\_group\_arn](#output\_security\_group\_arn) | Amazon Resource Name (ARN) of the security group | | [security\_group\_id](#output\_security\_group\_id) | ID of the security group | | [subnet\_group\_name](#output\_subnet\_group\_name) | The ElastiCache subnet group name | - + Apache-2.0 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-elasticache/blob/master/LICENSE). diff --git a/examples/redis-cluster/README.md b/examples/redis-cluster/README.md index 4a01212..fd556ad 100644 --- a/examples/redis-cluster/README.md +++ b/examples/redis-cluster/README.md @@ -14,7 +14,7 @@ $ terraform apply Note that this example may create resources which will incur monetary charges on your AWS bill. Run `terraform destroy` when you no longer need these resources. - + ## Requirements | Name | Version | @@ -73,6 +73,6 @@ No inputs. | [security\_group\_arn](#output\_security\_group\_arn) | Amazon Resource Name (ARN) of the security group | | [security\_group\_id](#output\_security\_group\_id) | ID of the security group | | [subnet\_group\_name](#output\_subnet\_group\_name) | The ElastiCache subnet group name | - + Apache-2.0 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-elasticache/blob/master/LICENSE). diff --git a/examples/redis-global-replication-group/README.md b/examples/redis-global-replication-group/README.md index 118361a..33cb649 100644 --- a/examples/redis-global-replication-group/README.md +++ b/examples/redis-global-replication-group/README.md @@ -18,7 +18,7 @@ $ terraform apply Note that this example may create resources which will incur monetary charges on your AWS bill. Run `terraform destroy` when you no longer need these resources. - + ## Requirements | Name | Version | @@ -80,6 +80,6 @@ No inputs. | [security\_group\_arn](#output\_security\_group\_arn) | Amazon Resource Name (ARN) of the security group | | [security\_group\_id](#output\_security\_group\_id) | ID of the security group | | [subnet\_group\_name](#output\_subnet\_group\_name) | The ElastiCache subnet group name | - + Apache-2.0 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-elasticache/blob/master/LICENSE). diff --git a/examples/redis-replication-group-with-cluster-replica/README.md b/examples/redis-replication-group-with-cluster-replica/README.md index 58565af..43dd212 100644 --- a/examples/redis-replication-group-with-cluster-replica/README.md +++ b/examples/redis-replication-group-with-cluster-replica/README.md @@ -14,7 +14,7 @@ $ terraform apply Note that this example may create resources which will incur monetary charges on your AWS bill. Run `terraform destroy` when you no longer need these resources. - + ## Requirements | Name | Version | @@ -74,6 +74,6 @@ No inputs. | [security\_group\_arn](#output\_security\_group\_arn) | Amazon Resource Name (ARN) of the security group | | [security\_group\_id](#output\_security\_group\_id) | ID of the security group | | [subnet\_group\_name](#output\_subnet\_group\_name) | The ElastiCache subnet group name | - + Apache-2.0 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-elasticache/blob/master/LICENSE). diff --git a/examples/redis-replication-group/README.md b/examples/redis-replication-group/README.md index fa179db..6961ac7 100644 --- a/examples/redis-replication-group/README.md +++ b/examples/redis-replication-group/README.md @@ -14,7 +14,7 @@ $ terraform apply Note that this example may create resources which will incur monetary charges on your AWS bill. Run `terraform destroy` when you no longer need these resources. - + ## Requirements | Name | Version | @@ -72,6 +72,6 @@ No inputs. | [security\_group\_arn](#output\_security\_group\_arn) | Amazon Resource Name (ARN) of the security group | | [security\_group\_id](#output\_security\_group\_id) | ID of the security group | | [subnet\_group\_name](#output\_subnet\_group\_name) | The ElastiCache subnet group name | - + Apache-2.0 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-elasticache/blob/master/LICENSE). diff --git a/modules/serverless-cache/README.md b/modules/serverless-cache/README.md index 2e9a5c0..c4860b1 100644 --- a/modules/serverless-cache/README.md +++ b/modules/serverless-cache/README.md @@ -29,7 +29,7 @@ module "elasticache_serverless_cache" { kms_key_id = aws_kms_key.this.arn major_engine_version = "7" - security_group_rules = [module.sg.security_group_id] + security_group_ids = [module.sg.security_group_id] snapshot_retention_limit = 7 subnet_ids = module.vpc.private_subnets @@ -54,7 +54,7 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module - [Redis Replication Group](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/redis-replication-group) - [Serverless Cache](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/serverless-cache) - + ## Requirements | Name | Version | @@ -109,7 +109,7 @@ No modules. | [serverless\_cache\_major\_engine\_version](#output\_serverless\_cache\_major\_engine\_version) | The version number of the engine the serverless cache is compatible with | | [serverless\_cache\_reader\_endpoint](#output\_serverless\_cache\_reader\_endpoint) | Represents the information required for client programs to connect to a cache node | | [serverless\_cache\_status](#output\_serverless\_cache\_status) | The current status of the serverless cache. The allowed values are CREATING, AVAILABLE, DELETING, CREATE-FAILED and MODIFYING | - + ## License diff --git a/modules/user-group/README.md b/modules/user-group/README.md index e4be0de..743fd4e 100644 --- a/modules/user-group/README.md +++ b/modules/user-group/README.md @@ -60,7 +60,7 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module - [Redis Global Replication Group](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/redis-global-replication-group) - [Redis Replication Group](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/redis-replication-group) - + ## Requirements | Name | Version | @@ -108,7 +108,7 @@ No modules. | [group\_arn](#output\_group\_arn) | The ARN that identifies the user group | | [group\_id](#output\_group\_id) | The user group identifier | | [users](#output\_users) | A map of users created and their attributes | - + ## License From a4940aa5d8d3f6f9427c050c57b4cda90bf09856 Mon Sep 17 00:00:00 2001 From: Syed Imran Hassan <45480841+syedimranhassan@users.noreply.github.com> Date: Tue, 1 Oct 2024 22:30:29 +0500 Subject: [PATCH 06/18] fix: Correct output attribute mis-spelling (#18) Co-authored-by: Bryant Biggs --- README.md | 2 +- examples/memcached-cluster/README.md | 2 +- examples/memcached-cluster/outputs.tf | 4 ++-- examples/redis-cluster-mode/README.md | 2 +- examples/redis-cluster-mode/outputs.tf | 4 ++-- examples/redis-cluster/README.md | 2 +- examples/redis-cluster/outputs.tf | 4 ++-- examples/redis-global-replication-group/README.md | 2 +- examples/redis-global-replication-group/outputs.tf | 4 ++-- .../redis-replication-group-with-cluster-replica/README.md | 2 +- .../redis-replication-group-with-cluster-replica/outputs.tf | 4 ++-- examples/redis-replication-group/README.md | 2 +- examples/redis-replication-group/outputs.tf | 4 ++-- outputs.tf | 2 +- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 6b1a5e2..cc03bfb 100644 --- a/README.md +++ b/README.md @@ -402,7 +402,7 @@ No modules. | [parameter\_group\_arn](#output\_parameter\_group\_arn) | The AWS ARN associated with the parameter group | | [parameter\_group\_id](#output\_parameter\_group\_id) | The ElastiCache parameter group name | | [replication\_group\_arn](#output\_replication\_group\_arn) | ARN of the created ElastiCache Replication Group | -| [replication\_group\_coniguration\_endpoint\_address](#output\_replication\_group\_coniguration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | +| [replication\_group\_configuration\_endpoint\_address](#output\_replication\_group\_configuration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | | [replication\_group\_engine\_version\_actual](#output\_replication\_group\_engine\_version\_actual) | Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine | | [replication\_group\_id](#output\_replication\_group\_id) | ID of the ElastiCache Replication Group | | [replication\_group\_member\_clusters](#output\_replication\_group\_member\_clusters) | Identifiers of all the nodes that are part of this replication group | diff --git a/examples/memcached-cluster/README.md b/examples/memcached-cluster/README.md index 7d84e7b..142e439 100644 --- a/examples/memcached-cluster/README.md +++ b/examples/memcached-cluster/README.md @@ -64,7 +64,7 @@ No inputs. | [parameter\_group\_arn](#output\_parameter\_group\_arn) | The AWS ARN associated with the parameter group | | [parameter\_group\_id](#output\_parameter\_group\_id) | The ElastiCache parameter group name | | [replication\_group\_arn](#output\_replication\_group\_arn) | ARN of the created ElastiCache Replication Group | -| [replication\_group\_coniguration\_endpoint\_address](#output\_replication\_group\_coniguration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | +| [replication\_group\_configuration\_endpoint\_address](#output\_replication\_group\_configuration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | | [replication\_group\_engine\_version\_actual](#output\_replication\_group\_engine\_version\_actual) | Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine | | [replication\_group\_id](#output\_replication\_group\_id) | ID of the ElastiCache Replication Group | | [replication\_group\_member\_clusters](#output\_replication\_group\_member\_clusters) | Identifiers of all the nodes that are part of this replication group | diff --git a/examples/memcached-cluster/outputs.tf b/examples/memcached-cluster/outputs.tf index cd5faef..a3a563b 100644 --- a/examples/memcached-cluster/outputs.tf +++ b/examples/memcached-cluster/outputs.tf @@ -41,9 +41,9 @@ output "replication_group_engine_version_actual" { value = module.elasticache.replication_group_engine_version_actual } -output "replication_group_coniguration_endpoint_address" { +output "replication_group_configuration_endpoint_address" { description = "Address of the replication group configuration endpoint when cluster mode is enabled" - value = module.elasticache.replication_group_coniguration_endpoint_address + value = module.elasticache.replication_group_configuration_endpoint_address } output "replication_group_id" { diff --git a/examples/redis-cluster-mode/README.md b/examples/redis-cluster-mode/README.md index 4cf66fd..5a837ac 100644 --- a/examples/redis-cluster-mode/README.md +++ b/examples/redis-cluster-mode/README.md @@ -66,7 +66,7 @@ No inputs. | [parameter\_group\_arn](#output\_parameter\_group\_arn) | The AWS ARN associated with the parameter group | | [parameter\_group\_id](#output\_parameter\_group\_id) | The ElastiCache parameter group name | | [replication\_group\_arn](#output\_replication\_group\_arn) | ARN of the created ElastiCache Replication Group | -| [replication\_group\_coniguration\_endpoint\_address](#output\_replication\_group\_coniguration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | +| [replication\_group\_configuration\_endpoint\_address](#output\_replication\_group\_configuration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | | [replication\_group\_engine\_version\_actual](#output\_replication\_group\_engine\_version\_actual) | Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine | | [replication\_group\_id](#output\_replication\_group\_id) | ID of the ElastiCache Replication Group | | [replication\_group\_member\_clusters](#output\_replication\_group\_member\_clusters) | Identifiers of all the nodes that are part of this replication group | diff --git a/examples/redis-cluster-mode/outputs.tf b/examples/redis-cluster-mode/outputs.tf index cd5faef..a3a563b 100644 --- a/examples/redis-cluster-mode/outputs.tf +++ b/examples/redis-cluster-mode/outputs.tf @@ -41,9 +41,9 @@ output "replication_group_engine_version_actual" { value = module.elasticache.replication_group_engine_version_actual } -output "replication_group_coniguration_endpoint_address" { +output "replication_group_configuration_endpoint_address" { description = "Address of the replication group configuration endpoint when cluster mode is enabled" - value = module.elasticache.replication_group_coniguration_endpoint_address + value = module.elasticache.replication_group_configuration_endpoint_address } output "replication_group_id" { diff --git a/examples/redis-cluster/README.md b/examples/redis-cluster/README.md index fd556ad..e04cac3 100644 --- a/examples/redis-cluster/README.md +++ b/examples/redis-cluster/README.md @@ -64,7 +64,7 @@ No inputs. | [parameter\_group\_arn](#output\_parameter\_group\_arn) | The AWS ARN associated with the parameter group | | [parameter\_group\_id](#output\_parameter\_group\_id) | The ElastiCache parameter group name | | [replication\_group\_arn](#output\_replication\_group\_arn) | ARN of the created ElastiCache Replication Group | -| [replication\_group\_coniguration\_endpoint\_address](#output\_replication\_group\_coniguration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | +| [replication\_group\_configuration\_endpoint\_address](#output\_replication\_group\_configuration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | | [replication\_group\_engine\_version\_actual](#output\_replication\_group\_engine\_version\_actual) | Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine | | [replication\_group\_id](#output\_replication\_group\_id) | ID of the ElastiCache Replication Group | | [replication\_group\_member\_clusters](#output\_replication\_group\_member\_clusters) | Identifiers of all the nodes that are part of this replication group | diff --git a/examples/redis-cluster/outputs.tf b/examples/redis-cluster/outputs.tf index cd5faef..a3a563b 100644 --- a/examples/redis-cluster/outputs.tf +++ b/examples/redis-cluster/outputs.tf @@ -41,9 +41,9 @@ output "replication_group_engine_version_actual" { value = module.elasticache.replication_group_engine_version_actual } -output "replication_group_coniguration_endpoint_address" { +output "replication_group_configuration_endpoint_address" { description = "Address of the replication group configuration endpoint when cluster mode is enabled" - value = module.elasticache.replication_group_coniguration_endpoint_address + value = module.elasticache.replication_group_configuration_endpoint_address } output "replication_group_id" { diff --git a/examples/redis-global-replication-group/README.md b/examples/redis-global-replication-group/README.md index 33cb649..2a193ae 100644 --- a/examples/redis-global-replication-group/README.md +++ b/examples/redis-global-replication-group/README.md @@ -71,7 +71,7 @@ No inputs. | [parameter\_group\_arn](#output\_parameter\_group\_arn) | The AWS ARN associated with the parameter group | | [parameter\_group\_id](#output\_parameter\_group\_id) | The ElastiCache parameter group name | | [replication\_group\_arn](#output\_replication\_group\_arn) | ARN of the created ElastiCache Replication Group | -| [replication\_group\_coniguration\_endpoint\_address](#output\_replication\_group\_coniguration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | +| [replication\_group\_configuration\_endpoint\_address](#output\_replication\_group\_configuration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | | [replication\_group\_engine\_version\_actual](#output\_replication\_group\_engine\_version\_actual) | Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine | | [replication\_group\_id](#output\_replication\_group\_id) | ID of the ElastiCache Replication Group | | [replication\_group\_member\_clusters](#output\_replication\_group\_member\_clusters) | Identifiers of all the nodes that are part of this replication group | diff --git a/examples/redis-global-replication-group/outputs.tf b/examples/redis-global-replication-group/outputs.tf index bde8c9d..45505ae 100644 --- a/examples/redis-global-replication-group/outputs.tf +++ b/examples/redis-global-replication-group/outputs.tf @@ -41,9 +41,9 @@ output "replication_group_engine_version_actual" { value = module.elasticache_primary.replication_group_engine_version_actual } -output "replication_group_coniguration_endpoint_address" { +output "replication_group_configuration_endpoint_address" { description = "Address of the replication group configuration endpoint when cluster mode is enabled" - value = module.elasticache_primary.replication_group_coniguration_endpoint_address + value = module.elasticache_primary.replication_group_configuration_endpoint_address } output "replication_group_id" { diff --git a/examples/redis-replication-group-with-cluster-replica/README.md b/examples/redis-replication-group-with-cluster-replica/README.md index 43dd212..2f06f4c 100644 --- a/examples/redis-replication-group-with-cluster-replica/README.md +++ b/examples/redis-replication-group-with-cluster-replica/README.md @@ -65,7 +65,7 @@ No inputs. | [parameter\_group\_arn](#output\_parameter\_group\_arn) | The AWS ARN associated with the parameter group | | [parameter\_group\_id](#output\_parameter\_group\_id) | The ElastiCache parameter group name | | [replication\_group\_arn](#output\_replication\_group\_arn) | ARN of the created ElastiCache Replication Group | -| [replication\_group\_coniguration\_endpoint\_address](#output\_replication\_group\_coniguration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | +| [replication\_group\_configuration\_endpoint\_address](#output\_replication\_group\_configuration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | | [replication\_group\_engine\_version\_actual](#output\_replication\_group\_engine\_version\_actual) | Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine | | [replication\_group\_id](#output\_replication\_group\_id) | ID of the ElastiCache Replication Group | | [replication\_group\_member\_clusters](#output\_replication\_group\_member\_clusters) | Identifiers of all the nodes that are part of this replication group | diff --git a/examples/redis-replication-group-with-cluster-replica/outputs.tf b/examples/redis-replication-group-with-cluster-replica/outputs.tf index e15b230..b1e108b 100644 --- a/examples/redis-replication-group-with-cluster-replica/outputs.tf +++ b/examples/redis-replication-group-with-cluster-replica/outputs.tf @@ -41,9 +41,9 @@ output "replication_group_engine_version_actual" { value = module.replication_group_with_cluster_replica.replication_group_engine_version_actual } -output "replication_group_coniguration_endpoint_address" { +output "replication_group_configuration_endpoint_address" { description = "Address of the replication group configuration endpoint when cluster mode is enabled" - value = module.replication_group_with_cluster_replica.replication_group_coniguration_endpoint_address + value = module.replication_group_with_cluster_replica.replication_group_configuration_endpoint_address } output "replication_group_id" { diff --git a/examples/redis-replication-group/README.md b/examples/redis-replication-group/README.md index 6961ac7..7d3e3ad 100644 --- a/examples/redis-replication-group/README.md +++ b/examples/redis-replication-group/README.md @@ -63,7 +63,7 @@ No inputs. | [parameter\_group\_arn](#output\_parameter\_group\_arn) | The AWS ARN associated with the parameter group | | [parameter\_group\_id](#output\_parameter\_group\_id) | The ElastiCache parameter group name | | [replication\_group\_arn](#output\_replication\_group\_arn) | ARN of the created ElastiCache Replication Group | -| [replication\_group\_coniguration\_endpoint\_address](#output\_replication\_group\_coniguration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | +| [replication\_group\_configuration\_endpoint\_address](#output\_replication\_group\_configuration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | | [replication\_group\_engine\_version\_actual](#output\_replication\_group\_engine\_version\_actual) | Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine | | [replication\_group\_id](#output\_replication\_group\_id) | ID of the ElastiCache Replication Group | | [replication\_group\_member\_clusters](#output\_replication\_group\_member\_clusters) | Identifiers of all the nodes that are part of this replication group | diff --git a/examples/redis-replication-group/outputs.tf b/examples/redis-replication-group/outputs.tf index cd5faef..a3a563b 100644 --- a/examples/redis-replication-group/outputs.tf +++ b/examples/redis-replication-group/outputs.tf @@ -41,9 +41,9 @@ output "replication_group_engine_version_actual" { value = module.elasticache.replication_group_engine_version_actual } -output "replication_group_coniguration_endpoint_address" { +output "replication_group_configuration_endpoint_address" { description = "Address of the replication group configuration endpoint when cluster mode is enabled" - value = module.elasticache.replication_group_coniguration_endpoint_address + value = module.elasticache.replication_group_configuration_endpoint_address } output "replication_group_id" { diff --git a/outputs.tf b/outputs.tf index 17f7120..2b4cf6f 100644 --- a/outputs.tf +++ b/outputs.tf @@ -41,7 +41,7 @@ output "replication_group_engine_version_actual" { value = try(aws_elasticache_replication_group.this[0].engine_version_actual, aws_elasticache_replication_group.global[0].engine_version_actual, null) } -output "replication_group_coniguration_endpoint_address" { +output "replication_group_configuration_endpoint_address" { description = "Address of the replication group configuration endpoint when cluster mode is enabled" value = try(aws_elasticache_replication_group.this[0].configuration_endpoint_address, aws_elasticache_replication_group.global[0].configuration_endpoint_address, null) } From fa2f0060d71a2da41f7635633faa6e07e3620a68 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 1 Oct 2024 17:30:58 +0000 Subject: [PATCH 07/18] chore(release): version 1.2.4 [skip ci] ## [1.2.4](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.2.3...v1.2.4) (2024-10-01) ### Bug Fixes * Correct output attribute mis-spelling ([#18](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/18)) ([a4940aa](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/a4940aa5d8d3f6f9427c050c57b4cda90bf09856)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 328d812..a0f38db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## [1.2.4](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.2.3...v1.2.4) (2024-10-01) + + +### Bug Fixes + +* Correct output attribute mis-spelling ([#18](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/18)) ([a4940aa](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/a4940aa5d8d3f6f9427c050c57b4cda90bf09856)) + ## [1.2.3](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.2.2...v1.2.3) (2024-09-09) From 1bd81beec317d4b05fc847c4e3b41bbbcc8460ea Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Fri, 11 Oct 2024 16:04:01 +0000 Subject: [PATCH 08/18] fix: Update CI workflow versions to latest (#20) --- .github/workflows/pr-title.yml | 2 +- .github/workflows/pre-commit.yml | 10 +++++----- .pre-commit-config.yaml | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index 3973df4..1e50760 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -14,7 +14,7 @@ jobs: steps: # Please look up the latest version from # https://github.com/amannn/action-semantic-pull-request/releases - - uses: amannn/action-semantic-pull-request@v5.4.0 + - uses: amannn/action-semantic-pull-request@v5.5.3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 71878b4..a19ff83 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -45,14 +45,14 @@ jobs: - name: Terraform min/max versions id: minMax - uses: clowdhaus/terraform-min-max@v1.3.0 + uses: clowdhaus/terraform-min-max@v1.3.1 with: directory: ${{ matrix.directory }} - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} # Run only validate pre-commit check on min version supported if: ${{ matrix.directory != '.' }} - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0 + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.11.1 with: terraform-version: ${{ steps.minMax.outputs.minVersion }} tflint-version: ${{ env.TFLINT_VERSION }} @@ -61,7 +61,7 @@ jobs: - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} # Run only validate pre-commit check on min version supported if: ${{ matrix.directory == '.' }} - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0 + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.11.1 with: terraform-version: ${{ steps.minMax.outputs.minVersion }} tflint-version: ${{ env.TFLINT_VERSION }} @@ -88,10 +88,10 @@ jobs: - name: Terraform min/max versions id: minMax - uses: clowdhaus/terraform-min-max@v1.3.0 + uses: clowdhaus/terraform-min-max@v1.3.1 - name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }} - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0 + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.11.1 with: terraform-version: ${{ steps.minMax.outputs.maxVersion }} tflint-version: ${{ env.TFLINT_VERSION }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6c4c2e8..a6cd369 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,10 +21,9 @@ repos: - '--args=--only=terraform_required_providers' - '--args=--only=terraform_standard_module_structure' - '--args=--only=terraform_workspace_remote' - - '--args=--only=terraform_unused_required_providers' - id: terraform_validate - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-merge-conflict - id: end-of-file-fixer From 1135640455df0ee16ef76bb5b0c6c3f069483b98 Mon Sep 17 00:00:00 2001 From: Melissa Greenbaum <69476188+magreenbaum@users.noreply.github.com> Date: Thu, 17 Oct 2024 11:24:49 -0400 Subject: [PATCH 09/18] feat: Support `aws_elasticache_user_group_association.timeouts` and `aws_elasticache_replication_group.cluster_mode` (#21) --- README.md | 5 +++-- examples/memcached-cluster/README.md | 4 ++-- examples/memcached-cluster/versions.tf | 2 +- examples/redis-cluster-mode/README.md | 4 ++-- examples/redis-cluster-mode/versions.tf | 2 +- examples/redis-cluster/README.md | 4 ++-- examples/redis-cluster/versions.tf | 2 +- examples/redis-global-replication-group/README.md | 6 +++--- examples/redis-global-replication-group/versions.tf | 2 +- .../README.md | 4 ++-- .../versions.tf | 2 +- examples/redis-replication-group/README.md | 4 ++-- examples/redis-replication-group/versions.tf | 2 +- examples/serverless-cache/main.tf | 3 +++ examples/serverless-cache/versions.tf | 2 +- main.tf | 2 ++ modules/serverless-cache/README.md | 4 ++-- modules/serverless-cache/versions.tf | 2 +- modules/user-group/README.md | 4 ++-- modules/user-group/main.tf | 8 ++++++++ modules/user-group/versions.tf | 2 +- variables.tf | 6 ++++++ versions.tf | 2 +- 23 files changed, 49 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index cc03bfb..dcbc37b 100644 --- a/README.md +++ b/README.md @@ -284,14 +284,14 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.47 | +| [aws](#requirement\_aws) | >= 5.71 | | [random](#requirement\_random) | >= 3.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.47 | +| [aws](#provider\_aws) | >= 5.71 | | [random](#provider\_random) | >= 3.0 | ## Modules @@ -327,6 +327,7 @@ No modules. | [availability\_zone](#input\_availability\_zone) | Availability Zone for the cache cluster. If you want to create cache nodes in multi-az, use `preferred_availability_zones` instead | `string` | `null` | no | | [az\_mode](#input\_az\_mode) | Whether the nodes in this Memcached node group are created in a single Availability Zone or created across multiple Availability Zones in the cluster's region. Valid values for this parameter are `single-az` or `cross-az`, default is `single-az` | `string` | `null` | no | | [cluster\_id](#input\_cluster\_id) | Group identifier. ElastiCache converts this name to lowercase. Changing this value will re-create the resource | `string` | `""` | no | +| [cluster\_mode](#input\_cluster\_mode) | Specifies whether cluster mode is enabled or disabled. Valid values are enabled or disabled or compatible | `string` | `null` | no | | [cluster\_mode\_enabled](#input\_cluster\_mode\_enabled) | Whether to enable Redis [cluster mode https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Replication.Redis-RedisCluster.html] | `bool` | `false` | no | | [create](#input\_create) | Determines whether resources will be created (affects all resources) | `bool` | `true` | no | | [create\_cluster](#input\_create\_cluster) | Determines whether an ElastiCache cluster will be created or not | `bool` | `false` | no | diff --git a/examples/memcached-cluster/README.md b/examples/memcached-cluster/README.md index 142e439..71fe41a 100644 --- a/examples/memcached-cluster/README.md +++ b/examples/memcached-cluster/README.md @@ -20,13 +20,13 @@ Note that this example may create resources which will incur monetary charges on | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.47 | +| [aws](#requirement\_aws) | >= 5.71 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.47 | +| [aws](#provider\_aws) | >= 5.71 | ## Modules diff --git a/examples/memcached-cluster/versions.tf b/examples/memcached-cluster/versions.tf index 407a955..0615775 100644 --- a/examples/memcached-cluster/versions.tf +++ b/examples/memcached-cluster/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.47" + version = ">= 5.71" } } } diff --git a/examples/redis-cluster-mode/README.md b/examples/redis-cluster-mode/README.md index 5a837ac..9d1a578 100644 --- a/examples/redis-cluster-mode/README.md +++ b/examples/redis-cluster-mode/README.md @@ -22,13 +22,13 @@ Note that this example may create resources which will incur monetary charges on | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.47 | +| [aws](#requirement\_aws) | >= 5.71 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.47 | +| [aws](#provider\_aws) | >= 5.71 | ## Modules diff --git a/examples/redis-cluster-mode/versions.tf b/examples/redis-cluster-mode/versions.tf index 407a955..0615775 100644 --- a/examples/redis-cluster-mode/versions.tf +++ b/examples/redis-cluster-mode/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.47" + version = ">= 5.71" } } } diff --git a/examples/redis-cluster/README.md b/examples/redis-cluster/README.md index e04cac3..1d3d4f4 100644 --- a/examples/redis-cluster/README.md +++ b/examples/redis-cluster/README.md @@ -20,13 +20,13 @@ Note that this example may create resources which will incur monetary charges on | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.47 | +| [aws](#requirement\_aws) | >= 5.71 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.47 | +| [aws](#provider\_aws) | >= 5.71 | ## Modules diff --git a/examples/redis-cluster/versions.tf b/examples/redis-cluster/versions.tf index 407a955..0615775 100644 --- a/examples/redis-cluster/versions.tf +++ b/examples/redis-cluster/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.47" + version = ">= 5.71" } } } diff --git a/examples/redis-global-replication-group/README.md b/examples/redis-global-replication-group/README.md index 2a193ae..7ee97b6 100644 --- a/examples/redis-global-replication-group/README.md +++ b/examples/redis-global-replication-group/README.md @@ -24,14 +24,14 @@ Note that this example may create resources which will incur monetary charges on | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.47 | +| [aws](#requirement\_aws) | >= 5.71 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.47 | -| [aws.euwest1](#provider\_aws.euwest1) | >= 5.47 | +| [aws](#provider\_aws) | >= 5.71 | +| [aws.euwest1](#provider\_aws.euwest1) | >= 5.71 | ## Modules diff --git a/examples/redis-global-replication-group/versions.tf b/examples/redis-global-replication-group/versions.tf index 407a955..0615775 100644 --- a/examples/redis-global-replication-group/versions.tf +++ b/examples/redis-global-replication-group/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.47" + version = ">= 5.71" } } } diff --git a/examples/redis-replication-group-with-cluster-replica/README.md b/examples/redis-replication-group-with-cluster-replica/README.md index 2f06f4c..7c3b025 100644 --- a/examples/redis-replication-group-with-cluster-replica/README.md +++ b/examples/redis-replication-group-with-cluster-replica/README.md @@ -20,13 +20,13 @@ Note that this example may create resources which will incur monetary charges on | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.47 | +| [aws](#requirement\_aws) | >= 5.71 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.47 | +| [aws](#provider\_aws) | >= 5.71 | ## Modules diff --git a/examples/redis-replication-group-with-cluster-replica/versions.tf b/examples/redis-replication-group-with-cluster-replica/versions.tf index 407a955..0615775 100644 --- a/examples/redis-replication-group-with-cluster-replica/versions.tf +++ b/examples/redis-replication-group-with-cluster-replica/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.47" + version = ">= 5.71" } } } diff --git a/examples/redis-replication-group/README.md b/examples/redis-replication-group/README.md index 7d3e3ad..75d8720 100644 --- a/examples/redis-replication-group/README.md +++ b/examples/redis-replication-group/README.md @@ -20,13 +20,13 @@ Note that this example may create resources which will incur monetary charges on | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.47 | +| [aws](#requirement\_aws) | >= 5.71 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.47 | +| [aws](#provider\_aws) | >= 5.71 | ## Modules diff --git a/examples/redis-replication-group/versions.tf b/examples/redis-replication-group/versions.tf index 407a955..0615775 100644 --- a/examples/redis-replication-group/versions.tf +++ b/examples/redis-replication-group/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.47" + version = ">= 5.71" } } } diff --git a/examples/serverless-cache/main.tf b/examples/serverless-cache/main.tf index aa29dd4..6516453 100644 --- a/examples/serverless-cache/main.tf +++ b/examples/serverless-cache/main.tf @@ -63,6 +63,9 @@ module "cache_user_group" { authentication_mode = { type = "no-password-required" } + timeouts = { + create = "20m" + } } } diff --git a/examples/serverless-cache/versions.tf b/examples/serverless-cache/versions.tf index 407a955..0615775 100644 --- a/examples/serverless-cache/versions.tf +++ b/examples/serverless-cache/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.47" + version = ">= 5.71" } } } diff --git a/main.tf b/main.tf index a4f6c95..f78027c 100644 --- a/main.tf +++ b/main.tf @@ -75,6 +75,7 @@ resource "aws_elasticache_replication_group" "this" { auth_token_update_strategy = var.auth_token_update_strategy auto_minor_version_upgrade = var.auto_minor_version_upgrade automatic_failover_enabled = var.multi_az_enabled || var.cluster_mode_enabled ? true : var.automatic_failover_enabled + cluster_mode = var.cluster_mode data_tiering_enabled = var.data_tiering_enabled description = coalesce(var.description, "Replication group") engine = var.engine @@ -152,6 +153,7 @@ resource "aws_elasticache_replication_group" "global" { auth_token_update_strategy = var.auth_token_update_strategy auto_minor_version_upgrade = var.auto_minor_version_upgrade automatic_failover_enabled = var.multi_az_enabled || var.cluster_mode_enabled ? true : var.automatic_failover_enabled + cluster_mode = var.cluster_mode data_tiering_enabled = var.data_tiering_enabled description = coalesce(var.description, "Global replication group") engine = var.create_secondary_global_replication_group ? null : var.engine diff --git a/modules/serverless-cache/README.md b/modules/serverless-cache/README.md index c4860b1..e4605fb 100644 --- a/modules/serverless-cache/README.md +++ b/modules/serverless-cache/README.md @@ -60,13 +60,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.47 | +| [aws](#requirement\_aws) | >= 5.71 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.47 | +| [aws](#provider\_aws) | >= 5.71 | ## Modules diff --git a/modules/serverless-cache/versions.tf b/modules/serverless-cache/versions.tf index 407a955..0615775 100644 --- a/modules/serverless-cache/versions.tf +++ b/modules/serverless-cache/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.47" + version = ">= 5.71" } } } diff --git a/modules/user-group/README.md b/modules/user-group/README.md index 743fd4e..b1584fe 100644 --- a/modules/user-group/README.md +++ b/modules/user-group/README.md @@ -66,13 +66,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.47 | +| [aws](#requirement\_aws) | >= 5.71 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.47 | +| [aws](#provider\_aws) | >= 5.71 | ## Modules diff --git a/modules/user-group/main.tf b/modules/user-group/main.tf index 7919fb7..d21e509 100644 --- a/modules/user-group/main.tf +++ b/modules/user-group/main.tf @@ -74,4 +74,12 @@ resource "aws_elasticache_user_group_association" "this" { user_group_id = var.create && var.create_group ? aws_elasticache_user_group.this[0].user_group_id : each.value.user_group_id user_id = aws_elasticache_user.this[each.key].user_id + + dynamic "timeouts" { + for_each = try([each.value.timeouts], []) + content { + create = try(timeouts.value.create, null) + delete = try(timeouts.value.delete, null) + } + } } diff --git a/modules/user-group/versions.tf b/modules/user-group/versions.tf index 407a955..0615775 100644 --- a/modules/user-group/versions.tf +++ b/modules/user-group/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.47" + version = ">= 5.71" } } } diff --git a/variables.tf b/variables.tf index 2ff4aff..59649be 100644 --- a/variables.tf +++ b/variables.tf @@ -269,6 +269,12 @@ variable "replicas_per_node_group" { default = null } +variable "cluster_mode" { + description = "Specifies whether cluster mode is enabled or disabled. Valid values are enabled or disabled or compatible" + type = string + default = null +} + variable "replication_group_id" { description = "Replication group identifier. When `create_replication_group` is set to `true`, this is the ID assigned to the replication group created. When `create_replication_group` is set to `false`, this is the ID of an externally created replication group" type = string diff --git a/versions.tf b/versions.tf index 7cd9c04..0bf905c 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.47" + version = ">= 5.71" } random = { source = "hashicorp/random" From 347d65cb197405698dff5b1afaf9c63fc2d1acef Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 17 Oct 2024 15:25:19 +0000 Subject: [PATCH 10/18] chore(release): version 1.3.0 [skip ci] ## [1.3.0](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.2.4...v1.3.0) (2024-10-17) ### Features * Support `aws_elasticache_user_group_association.timeouts` and `aws_elasticache_replication_group.cluster_mode` ([#21](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/21)) ([1135640](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/1135640455df0ee16ef76bb5b0c6c3f069483b98)) ### Bug Fixes * Update CI workflow versions to latest ([#20](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/20)) ([1bd81be](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/1bd81beec317d4b05fc847c4e3b41bbbcc8460ea)) --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0f38db..18ce5ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. +## [1.3.0](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.2.4...v1.3.0) (2024-10-17) + + +### Features + +* Support `aws_elasticache_user_group_association.timeouts` and `aws_elasticache_replication_group.cluster_mode` ([#21](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/21)) ([1135640](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/1135640455df0ee16ef76bb5b0c6c3f069483b98)) + + +### Bug Fixes + +* Update CI workflow versions to latest ([#20](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/20)) ([1bd81be](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/1bd81beec317d4b05fc847c4e3b41bbbcc8460ea)) + ## [1.2.4](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.2.3...v1.2.4) (2024-10-01) From 6b1b5aa4576942bad13a6c8a8420e958a7327fad Mon Sep 17 00:00:00 2001 From: Melissa Greenbaum <69476188+magreenbaum@users.noreply.github.com> Date: Fri, 29 Nov 2024 12:46:21 -0500 Subject: [PATCH 11/18] feat: Support Valkey (#26) --- README.md | 92 +++++++++++- examples/memcached-cluster/README.md | 4 +- examples/memcached-cluster/versions.tf | 2 +- examples/redis-cluster-mode/README.md | 4 +- examples/redis-cluster-mode/versions.tf | 2 +- examples/redis-cluster/README.md | 4 +- examples/redis-cluster/versions.tf | 2 +- .../redis-global-replication-group/README.md | 6 +- .../versions.tf | 2 +- .../README.md | 4 +- .../versions.tf | 2 +- examples/redis-replication-group/README.md | 4 +- examples/redis-replication-group/versions.tf | 2 +- examples/serverless-cache/main.tf | 27 ++++ examples/serverless-cache/versions.tf | 2 +- examples/valkey-replication-group/README.md | 77 ++++++++++ examples/valkey-replication-group/main.tf | 86 +++++++++++ examples/valkey-replication-group/outputs.tf | 142 ++++++++++++++++++ .../valkey-replication-group/variables.tf | 0 examples/valkey-replication-group/versions.tf | 10 ++ main.tf | 9 +- modules/serverless-cache/README.md | 4 +- modules/serverless-cache/versions.tf | 2 +- modules/user-group/README.md | 4 +- modules/user-group/versions.tf | 2 +- variables.tf | 6 +- versions.tf | 2 +- 27 files changed, 466 insertions(+), 37 deletions(-) create mode 100644 examples/valkey-replication-group/README.md create mode 100644 examples/valkey-replication-group/main.tf create mode 100644 examples/valkey-replication-group/outputs.tf create mode 100644 examples/valkey-replication-group/variables.tf create mode 100644 examples/valkey-replication-group/versions.tf diff --git a/README.md b/README.md index dcbc37b..e422a35 100644 --- a/README.md +++ b/README.md @@ -268,6 +268,86 @@ module "elasticache" { } ``` +### Serverless Cache + +```hcl +module "elasticache" { + source = "terraform-aws-modules/elasticache/aws//modules/serverless-cache" + + engine = "redis" + cache_name = "example-serverless-cache" + + cache_usage_limits = { + data_storage = { + maximum = 2 + } + ecpu_per_second = { + maximum = 1000 + } + } + + daily_snapshot_time = "22:00" + description = "example-serverless-cache serverless cluster" + kms_key_id = aws_kms_key.this.arn + major_engine_version = "7" + security_group_ids = [module.sg.security_group_id] + + snapshot_retention_limit = 7 + subnet_ids = module.vpc.private_subnets + + user_group_id = module.cache_user_group.group_id +} +``` + +### Valkey Replication Group + +```hcl +module "elasticache" { + source = "terraform-aws-modules/elasticache/aws" + + replication_group_id = local.name + + engine = "valkey" + engine_version = "7.2" + node_type = "cache.t4g.small" + + transit_encryption_enabled = true + auth_token = "PickSomethingMoreSecure123!" + maintenance_window = "sun:05:00-sun:09:00" + apply_immediately = true + + # Security Group + vpc_id = module.vpc.vpc_id + security_group_rules = { + ingress_vpc = { + # Default type is `ingress` + # Default port is based on the default engine port + description = "VPC traffic" + cidr_ipv4 = module.vpc.vpc_cidr_block + } + } + + # Subnet Group + subnet_group_name = local.name + subnet_group_description = "Valkey replication group subnet group" + subnet_ids = module.vpc.private_subnets + + # Parameter Group + create_parameter_group = true + parameter_group_name = local.name + parameter_group_family = "valkey7" + parameter_group_description = "Valkey replication group parameter group" + parameters = [ + { + name = "latency-tracking" + value = "yes" + } + ] + + tags = local.tags +} +``` + ## Examples Examples codified under the [`examples`](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples) are intended to give users references for how to use the module(s) as well as testing/validating changes to the source code of the module. If contributing to the project, please be sure to make any appropriate updates to the relevant examples to allow maintainers to test your changes and to keep the examples up to date for users. Thank you! @@ -277,6 +357,8 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module - [Redis Cluster Mode](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/redis-cluster-mode) - [Redis Global Replication Group](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/redis-global-replication-group) - [Redis Replication Group](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/redis-replication-group) +- [Serverless Cache](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/serverless-cache) +- [Valkey Replication Group](https://github.com/terraform-aws-modules/terraform-aws-elasticache/tree/master/examples/valkey-replication-group) ## Requirements @@ -284,14 +366,14 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.71 | +| [aws](#requirement\_aws) | >= 5.73 | | [random](#requirement\_random) | >= 3.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.71 | +| [aws](#provider\_aws) | >= 5.73 | | [random](#provider\_random) | >= 3.0 | ## Modules @@ -322,7 +404,7 @@ No modules. | [at\_rest\_encryption\_enabled](#input\_at\_rest\_encryption\_enabled) | Whether to enable encryption at rest | `bool` | `true` | no | | [auth\_token](#input\_auth\_token) | The password used to access a password protected server. Can be specified only if `transit_encryption_enabled = true` | `string` | `null` | no | | [auth\_token\_update\_strategy](#input\_auth\_token\_update\_strategy) | Strategy to use when updating the `auth_token`. Valid values are `SET`, `ROTATE`, and `DELETE`. Defaults to `ROTATE` | `string` | `null` | no | -| [auto\_minor\_version\_upgrade](#input\_auto\_minor\_version\_upgrade) | Specifies whether minor version engine upgrades will be applied automatically to the underlying Cache Cluster instances during the maintenance window. Only supported for engine type `redis` and if the engine version is 6 or higher. Defaults to `true` | `bool` | `null` | no | +| [auto\_minor\_version\_upgrade](#input\_auto\_minor\_version\_upgrade) | Specifies whether minor version engine upgrades will be applied automatically to the underlying Cache Cluster instances during the maintenance window. Only supported for engine type `redis` and `valkey` and if the engine version is 6 or higher. Defaults to `true` | `bool` | `null` | no | | [automatic\_failover\_enabled](#input\_automatic\_failover\_enabled) | Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. If true, Multi-AZ is enabled for this replication group. If false, Multi-AZ is disabled for this replication group. Must be enabled for Redis (cluster mode enabled) replication groups | `bool` | `null` | no | | [availability\_zone](#input\_availability\_zone) | Availability Zone for the cache cluster. If you want to create cache nodes in multi-az, use `preferred_availability_zones` instead | `string` | `null` | no | | [az\_mode](#input\_az\_mode) | Whether the nodes in this Memcached node group are created in a single Availability Zone or created across multiple Availability Zones in the cluster's region. Valid values for this parameter are `single-az` or `cross-az`, default is `single-az` | `string` | `null` | no | @@ -339,13 +421,13 @@ No modules. | [create\_subnet\_group](#input\_create\_subnet\_group) | Determines whether the Elasticache subnet group will be created or not | `bool` | `true` | no | | [data\_tiering\_enabled](#input\_data\_tiering\_enabled) | Enables data tiering. Data tiering is only supported for replication groups using the `r6gd` node type. This parameter must be set to true when using `r6gd` nodes | `bool` | `null` | no | | [description](#input\_description) | User-created description for the replication group | `string` | `null` | no | -| [engine](#input\_engine) | Name of the cache engine to be used for this cache cluster. Valid values are `memcached` or `redis` | `string` | `"redis"` | no | +| [engine](#input\_engine) | Name of the cache engine to be used for this cache cluster. Valid values are `memcached`, `redis`, or `valkey` | `string` | `"redis"` | no | | [engine\_version](#input\_engine\_version) | Version number of the cache engine to be used. If not set, defaults to the latest version | `string` | `null` | no | | [final\_snapshot\_identifier](#input\_final\_snapshot\_identifier) | (Redis only) Name of your final cluster snapshot. If omitted, no final snapshot will be made | `string` | `null` | no | | [global\_replication\_group\_id](#input\_global\_replication\_group\_id) | The ID of the global replication group to which this replication group should belong | `string` | `null` | no | | [ip\_discovery](#input\_ip\_discovery) | The IP version to advertise in the discovery protocol. Valid values are `ipv4` or `ipv6` | `string` | `null` | no | | [kms\_key\_arn](#input\_kms\_key\_arn) | The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if `at_rest_encryption_enabled = true` | `string` | `null` | no | -| [log\_delivery\_configuration](#input\_log\_delivery\_configuration) | (Redis only) Specifies the destination and format of Redis SLOWLOG or Redis Engine Log | `any` |
{
"slow-log": {
"destination_type": "cloudwatch-logs",
"log_format": "json"
}
}
| no | +| [log\_delivery\_configuration](#input\_log\_delivery\_configuration) | (Redis OSS or Valkey) Specifies the destination and format of Redis OSS/Valkey SLOWLOG or Redis OSS/Valkey Engine Log | `any` |
{
"slow-log": {
"destination_type": "cloudwatch-logs",
"log_format": "json"
}
}
| no | | [maintenance\_window](#input\_maintenance\_window) | Specifies the weekly time range for when maintenance on the cache cluster is performed. The format is `ddd:hh24:mi-ddd:hh24:mi` (24H Clock UTC) | `string` | `null` | no | | [multi\_az\_enabled](#input\_multi\_az\_enabled) | Specifies whether to enable Multi-AZ Support for the replication group. If true, `automatic_failover_enabled` must also be enabled. Defaults to `false` | `bool` | `false` | no | | [network\_type](#input\_network\_type) | The IP versions for cache cluster connections. Valid values are `ipv4`, `ipv6` or `dual_stack` | `string` | `null` | no | diff --git a/examples/memcached-cluster/README.md b/examples/memcached-cluster/README.md index 71fe41a..16ced47 100644 --- a/examples/memcached-cluster/README.md +++ b/examples/memcached-cluster/README.md @@ -20,13 +20,13 @@ Note that this example may create resources which will incur monetary charges on | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.71 | +| [aws](#requirement\_aws) | >= 5.73 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.71 | +| [aws](#provider\_aws) | >= 5.73 | ## Modules diff --git a/examples/memcached-cluster/versions.tf b/examples/memcached-cluster/versions.tf index 0615775..0f48a6c 100644 --- a/examples/memcached-cluster/versions.tf +++ b/examples/memcached-cluster/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.71" + version = ">= 5.73" } } } diff --git a/examples/redis-cluster-mode/README.md b/examples/redis-cluster-mode/README.md index 9d1a578..9bc003f 100644 --- a/examples/redis-cluster-mode/README.md +++ b/examples/redis-cluster-mode/README.md @@ -22,13 +22,13 @@ Note that this example may create resources which will incur monetary charges on | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.71 | +| [aws](#requirement\_aws) | >= 5.73 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.71 | +| [aws](#provider\_aws) | >= 5.73 | ## Modules diff --git a/examples/redis-cluster-mode/versions.tf b/examples/redis-cluster-mode/versions.tf index 0615775..0f48a6c 100644 --- a/examples/redis-cluster-mode/versions.tf +++ b/examples/redis-cluster-mode/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.71" + version = ">= 5.73" } } } diff --git a/examples/redis-cluster/README.md b/examples/redis-cluster/README.md index 1d3d4f4..19b1c33 100644 --- a/examples/redis-cluster/README.md +++ b/examples/redis-cluster/README.md @@ -20,13 +20,13 @@ Note that this example may create resources which will incur monetary charges on | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.71 | +| [aws](#requirement\_aws) | >= 5.73 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.71 | +| [aws](#provider\_aws) | >= 5.73 | ## Modules diff --git a/examples/redis-cluster/versions.tf b/examples/redis-cluster/versions.tf index 0615775..0f48a6c 100644 --- a/examples/redis-cluster/versions.tf +++ b/examples/redis-cluster/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.71" + version = ">= 5.73" } } } diff --git a/examples/redis-global-replication-group/README.md b/examples/redis-global-replication-group/README.md index 7ee97b6..369e352 100644 --- a/examples/redis-global-replication-group/README.md +++ b/examples/redis-global-replication-group/README.md @@ -24,14 +24,14 @@ Note that this example may create resources which will incur monetary charges on | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.71 | +| [aws](#requirement\_aws) | >= 5.73 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.71 | -| [aws.euwest1](#provider\_aws.euwest1) | >= 5.71 | +| [aws](#provider\_aws) | >= 5.73 | +| [aws.euwest1](#provider\_aws.euwest1) | >= 5.73 | ## Modules diff --git a/examples/redis-global-replication-group/versions.tf b/examples/redis-global-replication-group/versions.tf index 0615775..0f48a6c 100644 --- a/examples/redis-global-replication-group/versions.tf +++ b/examples/redis-global-replication-group/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.71" + version = ">= 5.73" } } } diff --git a/examples/redis-replication-group-with-cluster-replica/README.md b/examples/redis-replication-group-with-cluster-replica/README.md index 7c3b025..7f62c8a 100644 --- a/examples/redis-replication-group-with-cluster-replica/README.md +++ b/examples/redis-replication-group-with-cluster-replica/README.md @@ -20,13 +20,13 @@ Note that this example may create resources which will incur monetary charges on | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.71 | +| [aws](#requirement\_aws) | >= 5.73 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.71 | +| [aws](#provider\_aws) | >= 5.73 | ## Modules diff --git a/examples/redis-replication-group-with-cluster-replica/versions.tf b/examples/redis-replication-group-with-cluster-replica/versions.tf index 0615775..0f48a6c 100644 --- a/examples/redis-replication-group-with-cluster-replica/versions.tf +++ b/examples/redis-replication-group-with-cluster-replica/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.71" + version = ">= 5.73" } } } diff --git a/examples/redis-replication-group/README.md b/examples/redis-replication-group/README.md index 75d8720..237289b 100644 --- a/examples/redis-replication-group/README.md +++ b/examples/redis-replication-group/README.md @@ -20,13 +20,13 @@ Note that this example may create resources which will incur monetary charges on | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.71 | +| [aws](#requirement\_aws) | >= 5.73 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.71 | +| [aws](#provider\_aws) | >= 5.73 | ## Modules diff --git a/examples/redis-replication-group/versions.tf b/examples/redis-replication-group/versions.tf index 0615775..0f48a6c 100644 --- a/examples/redis-replication-group/versions.tf +++ b/examples/redis-replication-group/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.71" + version = ">= 5.73" } } } diff --git a/examples/serverless-cache/main.tf b/examples/serverless-cache/main.tf index 6516453..6a0a9d7 100644 --- a/examples/serverless-cache/main.tf +++ b/examples/serverless-cache/main.tf @@ -45,6 +45,33 @@ module "serverless" { user_group_id = module.cache_user_group.group_id } +module "valkey_serverless" { + source = "../../modules/serverless-cache" + + engine = "valkey" + cache_name = "${local.name}-valkey" + + cache_usage_limits = { + data_storage = { + maximum = 2 + } + ecpu_per_second = { + maximum = 1000 + } + } + + daily_snapshot_time = "22:00" + description = "${local.name} valkey serverless cluster" + kms_key_id = aws_kms_key.this.arn + major_engine_version = "7" + security_group_ids = [module.sg.security_group_id] + + snapshot_retention_limit = 7 + subnet_ids = module.vpc.private_subnets + + user_group_id = module.cache_user_group.group_id +} + module "cache_user_group" { source = "../../modules/user-group" diff --git a/examples/serverless-cache/versions.tf b/examples/serverless-cache/versions.tf index 0615775..0f48a6c 100644 --- a/examples/serverless-cache/versions.tf +++ b/examples/serverless-cache/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.71" + version = ">= 5.73" } } } diff --git a/examples/valkey-replication-group/README.md b/examples/valkey-replication-group/README.md new file mode 100644 index 0000000..6e6a98a --- /dev/null +++ b/examples/valkey-replication-group/README.md @@ -0,0 +1,77 @@ +# ElastiCache example for Valkey Replication Group + +Configuration in this directory creates set of ElastiCaChe resources including replication group, subnet group and parameter group. + +## Usage + +To run this example you need to execute: + +```bash +$ terraform init +$ terraform plan +$ terraform apply +``` + +Note that this example may create resources which will incur monetary charges on your AWS bill. Run `terraform destroy` when you no longer need these resources. + + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.0 | +| [aws](#requirement\_aws) | >= 5.73 | + +## Providers + +| Name | Version | +|------|---------| +| [aws](#provider\_aws) | >= 5.73 | + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [elasticache](#module\_elasticache) | ../../ | n/a | +| [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 | + +## Resources + +| Name | Type | +|------|------| +| [aws_availability_zones.available](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zones) | data source | + +## Inputs + +No inputs. + +## Outputs + +| Name | Description | +|------|-------------| +| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | +| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | +| [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | +| [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | +| [cluster\_configuration\_endpoint](#output\_cluster\_configuration\_endpoint) | (Memcached only) Configuration endpoint to allow host discovery | +| [cluster\_engine\_version\_actual](#output\_cluster\_engine\_version\_actual) | Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine | +| [global\_replication\_group\_arn](#output\_global\_replication\_group\_arn) | ARN of the created ElastiCache Global Replication Group | +| [global\_replication\_group\_engine\_version\_actual](#output\_global\_replication\_group\_engine\_version\_actual) | The full version number of the cache engine running on the members of this global replication group | +| [global\_replication\_group\_id](#output\_global\_replication\_group\_id) | ID of the ElastiCache Global Replication Group | +| [global\_replication\_group\_node\_groups](#output\_global\_replication\_group\_node\_groups) | Set of node groups (shards) on the global replication group | +| [parameter\_group\_arn](#output\_parameter\_group\_arn) | The AWS ARN associated with the parameter group | +| [parameter\_group\_id](#output\_parameter\_group\_id) | The ElastiCache parameter group name | +| [replication\_group\_arn](#output\_replication\_group\_arn) | ARN of the created ElastiCache Replication Group | +| [replication\_group\_configuration\_endpoint\_address](#output\_replication\_group\_configuration\_endpoint\_address) | Address of the replication group configuration endpoint when cluster mode is enabled | +| [replication\_group\_engine\_version\_actual](#output\_replication\_group\_engine\_version\_actual) | Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine | +| [replication\_group\_id](#output\_replication\_group\_id) | ID of the ElastiCache Replication Group | +| [replication\_group\_member\_clusters](#output\_replication\_group\_member\_clusters) | Identifiers of all the nodes that are part of this replication group | +| [replication\_group\_primary\_endpoint\_address](#output\_replication\_group\_primary\_endpoint\_address) | Address of the endpoint for the primary node in the replication group, if the cluster mode is disabled | +| [replication\_group\_reader\_endpoint\_address](#output\_replication\_group\_reader\_endpoint\_address) | Address of the endpoint for the reader node in the replication group, if the cluster mode is disabled | +| [security\_group\_arn](#output\_security\_group\_arn) | Amazon Resource Name (ARN) of the security group | +| [security\_group\_id](#output\_security\_group\_id) | ID of the security group | +| [subnet\_group\_name](#output\_subnet\_group\_name) | The ElastiCache subnet group name | + + +Apache-2.0 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-elasticache/blob/master/LICENSE). diff --git a/examples/valkey-replication-group/main.tf b/examples/valkey-replication-group/main.tf new file mode 100644 index 0000000..0cba188 --- /dev/null +++ b/examples/valkey-replication-group/main.tf @@ -0,0 +1,86 @@ +provider "aws" { + region = local.region +} + +data "aws_availability_zones" "available" {} + +locals { + region = "eu-west-1" + name = "ex-${basename(path.cwd)}" + + vpc_cidr = "10.0.0.0/16" + azs = slice(data.aws_availability_zones.available.names, 0, 3) + + tags = { + Name = local.name + Example = local.name + Repository = "https://github.com/terraform-aws-modules/terraform-aws-elasticache" + } +} + +################################################################################ +# ElastiCache Module +################################################################################ + +module "elasticache" { + source = "../../" + + replication_group_id = local.name + + engine = "valkey" + engine_version = "7.2" + node_type = "cache.t4g.small" + + transit_encryption_enabled = true + auth_token = "PickSomethingMoreSecure123!" + maintenance_window = "sun:05:00-sun:09:00" + apply_immediately = true + + # Security Group + vpc_id = module.vpc.vpc_id + security_group_rules = { + ingress_vpc = { + # Default type is `ingress` + # Default port is based on the default engine port + description = "VPC traffic" + cidr_ipv4 = module.vpc.vpc_cidr_block + } + } + + # Subnet Group + subnet_group_name = local.name + subnet_group_description = "${title(local.name)} subnet group" + subnet_ids = module.vpc.private_subnets + + # Parameter Group + create_parameter_group = true + parameter_group_name = local.name + parameter_group_family = "valkey7" + parameter_group_description = "${title(local.name)} parameter group" + parameters = [ + { + name = "latency-tracking" + value = "yes" + } + ] + + tags = local.tags +} + +################################################################################ +# Supporting Resources +################################################################################ + +module "vpc" { + source = "terraform-aws-modules/vpc/aws" + version = "~> 5.0" + + name = local.name + cidr = local.vpc_cidr + + azs = local.azs + public_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 8, k)] + private_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 8, k + 10)] + + tags = local.tags +} diff --git a/examples/valkey-replication-group/outputs.tf b/examples/valkey-replication-group/outputs.tf new file mode 100644 index 0000000..a3a563b --- /dev/null +++ b/examples/valkey-replication-group/outputs.tf @@ -0,0 +1,142 @@ +################################################################################ +# Cluster +################################################################################ + +output "cluster_arn" { + description = "The ARN of the ElastiCache Cluster" + value = module.elasticache.cluster_arn +} + +output "cluster_engine_version_actual" { + description = "Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine" + value = module.elasticache.cluster_engine_version_actual +} + +output "cluster_cache_nodes" { + description = "List of node objects including `id`, `address`, `port` and `availability_zone`" + value = module.elasticache.cluster_cache_nodes +} + +output "cluster_address" { + description = "(Memcached only) DNS name of the cache cluster without the port appended" + value = module.elasticache.cluster_address +} + +output "cluster_configuration_endpoint" { + description = "(Memcached only) Configuration endpoint to allow host discovery" + value = module.elasticache.cluster_configuration_endpoint +} + +################################################################################ +# Replication Group +################################################################################ + +output "replication_group_arn" { + description = "ARN of the created ElastiCache Replication Group" + value = module.elasticache.replication_group_arn +} + +output "replication_group_engine_version_actual" { + description = "Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine" + value = module.elasticache.replication_group_engine_version_actual +} + +output "replication_group_configuration_endpoint_address" { + description = "Address of the replication group configuration endpoint when cluster mode is enabled" + value = module.elasticache.replication_group_configuration_endpoint_address +} + +output "replication_group_id" { + description = "ID of the ElastiCache Replication Group" + value = module.elasticache.replication_group_id +} + +output "replication_group_member_clusters" { + description = "Identifiers of all the nodes that are part of this replication group" + value = module.elasticache.replication_group_member_clusters +} + +output "replication_group_primary_endpoint_address" { + description = "Address of the endpoint for the primary node in the replication group, if the cluster mode is disabled" + value = module.elasticache.replication_group_primary_endpoint_address +} + +output "replication_group_reader_endpoint_address" { + description = "Address of the endpoint for the reader node in the replication group, if the cluster mode is disabled" + value = module.elasticache.replication_group_reader_endpoint_address +} + +################################################################################ +# Global Replication Group +################################################################################ + +output "global_replication_group_id" { + description = "ID of the ElastiCache Global Replication Group" + value = module.elasticache.global_replication_group_id +} + +output "global_replication_group_arn" { + description = "ARN of the created ElastiCache Global Replication Group" + value = module.elasticache.global_replication_group_arn +} + +output "global_replication_group_engine_version_actual" { + description = "The full version number of the cache engine running on the members of this global replication group" + value = module.elasticache.global_replication_group_engine_version_actual +} + +output "global_replication_group_node_groups" { + description = "Set of node groups (shards) on the global replication group" + value = module.elasticache.global_replication_group_node_groups +} + +################################################################################ +# CloudWatch Log Group +################################################################################ + +output "cloudwatch_log_group_name" { + description = "Name of cloudwatch log group created" + value = module.elasticache.cloudwatch_log_group_name +} + +output "cloudwatch_log_group_arn" { + description = "Arn of cloudwatch log group created" + value = module.elasticache.cloudwatch_log_group_arn +} + +################################################################################ +# Parameter Group +################################################################################ + +output "parameter_group_arn" { + description = "The AWS ARN associated with the parameter group" + value = module.elasticache.parameter_group_arn +} + +output "parameter_group_id" { + description = "The ElastiCache parameter group name" + value = module.elasticache.parameter_group_id +} + +################################################################################ +# Subnet Group +################################################################################ + +output "subnet_group_name" { + description = "The ElastiCache subnet group name" + value = module.elasticache.subnet_group_name +} + +################################################################################ +# Security Group +################################################################################ + +output "security_group_arn" { + description = "Amazon Resource Name (ARN) of the security group" + value = module.elasticache.security_group_arn +} + +output "security_group_id" { + description = "ID of the security group" + value = module.elasticache.security_group_id +} diff --git a/examples/valkey-replication-group/variables.tf b/examples/valkey-replication-group/variables.tf new file mode 100644 index 0000000..e69de29 diff --git a/examples/valkey-replication-group/versions.tf b/examples/valkey-replication-group/versions.tf new file mode 100644 index 0000000..0f48a6c --- /dev/null +++ b/examples/valkey-replication-group/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 5.73" + } + } +} diff --git a/main.tf b/main.tf index f78027c..69a3b9b 100644 --- a/main.tf +++ b/main.tf @@ -2,6 +2,11 @@ locals { # https://github.com/hashicorp/terraform-provider-aws/blob/3c4cb52c5dc2c09e10e5a717f73d1d8bc4186e87/internal/service/elasticache/cluster.go#L271 in_replication_group = var.replication_group_id != null + # elasticache clusters currently do not support engine type valkey + # TODO: remove this local `create_cluster` conditional once this bug is addressed: + # https://github.com/hashicorp/terraform-provider-aws/issues/39905 + create_cluster = var.create_cluster && var.engine != "valkey" ? true : false + security_group_ids = local.create_security_group ? concat(var.security_group_ids, [aws_security_group.this[0].id]) : var.security_group_ids port = var.engine == "memcached" ? 11211 : 6379 @@ -13,7 +18,7 @@ locals { ################################################################################ resource "aws_elasticache_cluster" "this" { - count = var.create && var.create_cluster ? 1 : 0 + count = var.create && local.create_cluster ? 1 : 0 apply_immediately = var.apply_immediately auto_minor_version_upgrade = var.auto_minor_version_upgrade @@ -86,7 +91,7 @@ resource "aws_elasticache_replication_group" "this" { kms_key_id = var.at_rest_encryption_enabled ? var.kms_key_arn : null dynamic "log_delivery_configuration" { - for_each = { for k, v in var.log_delivery_configuration : k => v if var.engine == "redis" } + for_each = { for k, v in var.log_delivery_configuration : k => v if var.engine != "memcached" } content { destination = try(log_delivery_configuration.value.create_cloudwatch_log_group, true) && log_delivery_configuration.value.destination_type == "cloudwatch-logs" ? aws_cloudwatch_log_group.this[log_delivery_configuration.key].name : log_delivery_configuration.value.destination diff --git a/modules/serverless-cache/README.md b/modules/serverless-cache/README.md index e4605fb..fb644c2 100644 --- a/modules/serverless-cache/README.md +++ b/modules/serverless-cache/README.md @@ -60,13 +60,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.71 | +| [aws](#requirement\_aws) | >= 5.73 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.71 | +| [aws](#provider\_aws) | >= 5.73 | ## Modules diff --git a/modules/serverless-cache/versions.tf b/modules/serverless-cache/versions.tf index 0615775..0f48a6c 100644 --- a/modules/serverless-cache/versions.tf +++ b/modules/serverless-cache/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.71" + version = ">= 5.73" } } } diff --git a/modules/user-group/README.md b/modules/user-group/README.md index b1584fe..6e4305e 100644 --- a/modules/user-group/README.md +++ b/modules/user-group/README.md @@ -66,13 +66,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.71 | +| [aws](#requirement\_aws) | >= 5.73 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.71 | +| [aws](#provider\_aws) | >= 5.73 | ## Modules diff --git a/modules/user-group/versions.tf b/modules/user-group/versions.tf index 0615775..0f48a6c 100644 --- a/modules/user-group/versions.tf +++ b/modules/user-group/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.71" + version = ">= 5.73" } } } diff --git a/variables.tf b/variables.tf index 59649be..55b36ba 100644 --- a/variables.tf +++ b/variables.tf @@ -27,7 +27,7 @@ variable "apply_immediately" { } variable "auto_minor_version_upgrade" { - description = "Specifies whether minor version engine upgrades will be applied automatically to the underlying Cache Cluster instances during the maintenance window. Only supported for engine type `redis` and if the engine version is 6 or higher. Defaults to `true`" + description = "Specifies whether minor version engine upgrades will be applied automatically to the underlying Cache Cluster instances during the maintenance window. Only supported for engine type `redis` and `valkey` and if the engine version is 6 or higher. Defaults to `true`" type = bool default = null } @@ -57,7 +57,7 @@ variable "cluster_id" { } variable "engine" { - description = "Name of the cache engine to be used for this cache cluster. Valid values are `memcached` or `redis`" + description = "Name of the cache engine to be used for this cache cluster. Valid values are `memcached`, `redis`, or `valkey`" type = string default = "redis" } @@ -81,7 +81,7 @@ variable "ip_discovery" { } variable "log_delivery_configuration" { - description = "(Redis only) Specifies the destination and format of Redis SLOWLOG or Redis Engine Log" + description = "(Redis OSS or Valkey) Specifies the destination and format of Redis OSS/Valkey SLOWLOG or Redis OSS/Valkey Engine Log" type = any default = { slow-log = { diff --git a/versions.tf b/versions.tf index 0bf905c..648b57a 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.71" + version = ">= 5.73" } random = { source = "hashicorp/random" From aaf38372b2b05ff6a094fd462730c486807c2634 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 29 Nov 2024 17:46:47 +0000 Subject: [PATCH 12/18] chore(release): version 1.4.0 [skip ci] ## [1.4.0](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.3.0...v1.4.0) (2024-11-29) ### Features * Support Valkey ([#26](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/26)) ([6b1b5aa](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/6b1b5aa4576942bad13a6c8a8420e958a7327fad)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18ce5ea..8f4710f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## [1.4.0](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.3.0...v1.4.0) (2024-11-29) + + +### Features + +* Support Valkey ([#26](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/26)) ([6b1b5aa](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/6b1b5aa4576942bad13a6c8a8420e958a7327fad)) + ## [1.3.0](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.2.4...v1.3.0) (2024-10-17) From cdc870e425fd34a93f3e38adccf8eb4c8fd1ef1a Mon Sep 17 00:00:00 2001 From: ottramst Date: Mon, 2 Dec 2024 16:55:45 +0200 Subject: [PATCH 13/18] fix: Change cloudwatch log group output to include all created log groups (#19) --- README.md | 1 + examples/memcached-cluster/README.md | 3 +-- examples/memcached-cluster/outputs.tf | 11 +++-------- examples/redis-cluster-mode/README.md | 3 +-- examples/redis-cluster-mode/outputs.tf | 11 +++-------- examples/redis-cluster/README.md | 3 +-- examples/redis-cluster/outputs.tf | 11 +++-------- examples/redis-global-replication-group/README.md | 3 +-- examples/redis-global-replication-group/outputs.tf | 11 +++-------- .../README.md | 3 +-- .../outputs.tf | 11 +++-------- examples/redis-replication-group/README.md | 3 +-- examples/redis-replication-group/outputs.tf | 11 +++-------- outputs.tf | 7 +++++++ 14 files changed, 32 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index e422a35..9cea7db 100644 --- a/README.md +++ b/README.md @@ -473,6 +473,7 @@ No modules. |------|-------------| | [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | | [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | | [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | diff --git a/examples/memcached-cluster/README.md b/examples/memcached-cluster/README.md index 16ced47..7c93f16 100644 --- a/examples/memcached-cluster/README.md +++ b/examples/memcached-cluster/README.md @@ -50,8 +50,7 @@ No inputs. | Name | Description | |------|-------------| -| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | -| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | | [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | diff --git a/examples/memcached-cluster/outputs.tf b/examples/memcached-cluster/outputs.tf index a3a563b..ccf51c7 100644 --- a/examples/memcached-cluster/outputs.tf +++ b/examples/memcached-cluster/outputs.tf @@ -94,14 +94,9 @@ output "global_replication_group_node_groups" { # CloudWatch Log Group ################################################################################ -output "cloudwatch_log_group_name" { - description = "Name of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_name -} - -output "cloudwatch_log_group_arn" { - description = "Arn of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_arn +output "cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = module.elasticache.cloudwatch_log_groups } ################################################################################ diff --git a/examples/redis-cluster-mode/README.md b/examples/redis-cluster-mode/README.md index 9bc003f..8453466 100644 --- a/examples/redis-cluster-mode/README.md +++ b/examples/redis-cluster-mode/README.md @@ -52,8 +52,7 @@ No inputs. | Name | Description | |------|-------------| -| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | -| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | | [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | diff --git a/examples/redis-cluster-mode/outputs.tf b/examples/redis-cluster-mode/outputs.tf index a3a563b..ccf51c7 100644 --- a/examples/redis-cluster-mode/outputs.tf +++ b/examples/redis-cluster-mode/outputs.tf @@ -94,14 +94,9 @@ output "global_replication_group_node_groups" { # CloudWatch Log Group ################################################################################ -output "cloudwatch_log_group_name" { - description = "Name of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_name -} - -output "cloudwatch_log_group_arn" { - description = "Arn of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_arn +output "cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = module.elasticache.cloudwatch_log_groups } ################################################################################ diff --git a/examples/redis-cluster/README.md b/examples/redis-cluster/README.md index 19b1c33..7afc24d 100644 --- a/examples/redis-cluster/README.md +++ b/examples/redis-cluster/README.md @@ -50,8 +50,7 @@ No inputs. | Name | Description | |------|-------------| -| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | -| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | | [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | diff --git a/examples/redis-cluster/outputs.tf b/examples/redis-cluster/outputs.tf index a3a563b..ccf51c7 100644 --- a/examples/redis-cluster/outputs.tf +++ b/examples/redis-cluster/outputs.tf @@ -94,14 +94,9 @@ output "global_replication_group_node_groups" { # CloudWatch Log Group ################################################################################ -output "cloudwatch_log_group_name" { - description = "Name of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_name -} - -output "cloudwatch_log_group_arn" { - description = "Arn of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_arn +output "cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = module.elasticache.cloudwatch_log_groups } ################################################################################ diff --git a/examples/redis-global-replication-group/README.md b/examples/redis-global-replication-group/README.md index 369e352..f512f47 100644 --- a/examples/redis-global-replication-group/README.md +++ b/examples/redis-global-replication-group/README.md @@ -57,8 +57,7 @@ No inputs. | Name | Description | |------|-------------| -| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | -| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | | [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | diff --git a/examples/redis-global-replication-group/outputs.tf b/examples/redis-global-replication-group/outputs.tf index 45505ae..85300ce 100644 --- a/examples/redis-global-replication-group/outputs.tf +++ b/examples/redis-global-replication-group/outputs.tf @@ -94,14 +94,9 @@ output "global_replication_group_node_groups" { # CloudWatch Log Group ################################################################################ -output "cloudwatch_log_group_name" { - description = "Name of cloudwatch log group created" - value = module.elasticache_primary.cloudwatch_log_group_name -} - -output "cloudwatch_log_group_arn" { - description = "Arn of cloudwatch log group created" - value = module.elasticache_primary.cloudwatch_log_group_arn +output "cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = module.elasticache_primary.cloudwatch_log_groups } ################################################################################ diff --git a/examples/redis-replication-group-with-cluster-replica/README.md b/examples/redis-replication-group-with-cluster-replica/README.md index 7f62c8a..48f8674 100644 --- a/examples/redis-replication-group-with-cluster-replica/README.md +++ b/examples/redis-replication-group-with-cluster-replica/README.md @@ -51,8 +51,7 @@ No inputs. | Name | Description | |------|-------------| -| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | -| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | | [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | diff --git a/examples/redis-replication-group-with-cluster-replica/outputs.tf b/examples/redis-replication-group-with-cluster-replica/outputs.tf index b1e108b..c649115 100644 --- a/examples/redis-replication-group-with-cluster-replica/outputs.tf +++ b/examples/redis-replication-group-with-cluster-replica/outputs.tf @@ -94,14 +94,9 @@ output "global_replication_group_node_groups" { # CloudWatch Log Group ################################################################################ -output "cloudwatch_log_group_name" { - description = "Name of cloudwatch log group created" - value = module.replication_group_with_cluster_replica.cloudwatch_log_group_name -} - -output "cloudwatch_log_group_arn" { - description = "Arn of cloudwatch log group created" - value = module.replication_group_with_cluster_replica.cloudwatch_log_group_arn +output "cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = module.replication_group_with_cluster_replica.cloudwatch_log_groups } ################################################################################ diff --git a/examples/redis-replication-group/README.md b/examples/redis-replication-group/README.md index 237289b..e4e2312 100644 --- a/examples/redis-replication-group/README.md +++ b/examples/redis-replication-group/README.md @@ -49,8 +49,7 @@ No inputs. | Name | Description | |------|-------------| -| [cloudwatch\_log\_group\_arn](#output\_cloudwatch\_log\_group\_arn) | Arn of cloudwatch log group created | -| [cloudwatch\_log\_group\_name](#output\_cloudwatch\_log\_group\_name) | Name of cloudwatch log group created | +| [cloudwatch\_log\_groups](#output\_cloudwatch\_log\_groups) | Map of CloudWatch log groups created and their attributes | | [cluster\_address](#output\_cluster\_address) | (Memcached only) DNS name of the cache cluster without the port appended | | [cluster\_arn](#output\_cluster\_arn) | The ARN of the ElastiCache Cluster | | [cluster\_cache\_nodes](#output\_cluster\_cache\_nodes) | List of node objects including `id`, `address`, `port` and `availability_zone` | diff --git a/examples/redis-replication-group/outputs.tf b/examples/redis-replication-group/outputs.tf index a3a563b..ccf51c7 100644 --- a/examples/redis-replication-group/outputs.tf +++ b/examples/redis-replication-group/outputs.tf @@ -94,14 +94,9 @@ output "global_replication_group_node_groups" { # CloudWatch Log Group ################################################################################ -output "cloudwatch_log_group_name" { - description = "Name of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_name -} - -output "cloudwatch_log_group_arn" { - description = "Arn of cloudwatch log group created" - value = module.elasticache.cloudwatch_log_group_arn +output "cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = module.elasticache.cloudwatch_log_groups } ################################################################################ diff --git a/outputs.tf b/outputs.tf index 2b4cf6f..e015a78 100644 --- a/outputs.tf +++ b/outputs.tf @@ -94,11 +94,18 @@ output "global_replication_group_node_groups" { # CloudWatch Log Group ################################################################################ +output "cloudwatch_log_groups" { + description = "Map of CloudWatch log groups created and their attributes" + value = aws_cloudwatch_log_group.this +} + +# TODO - remove at next breaking change output "cloudwatch_log_group_name" { description = "Name of cloudwatch log group created" value = try(aws_cloudwatch_log_group.this[0].name, null) } +# TODO - remove at next breaking change output "cloudwatch_log_group_arn" { description = "Arn of cloudwatch log group created" value = try(aws_cloudwatch_log_group.this[0].arn, null) From 7d8b70b6c1cf4f4e1bd635caf413ce8623c98706 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 2 Dec 2024 14:56:11 +0000 Subject: [PATCH 14/18] chore(release): version 1.4.1 [skip ci] ## [1.4.1](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.4.0...v1.4.1) (2024-12-02) ### Bug Fixes * Change cloudwatch log group output to include all created log groups ([#19](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/19)) ([cdc870e](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/cdc870e425fd34a93f3e38adccf8eb4c8fd1ef1a)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f4710f..7e4b3bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## [1.4.1](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.4.0...v1.4.1) (2024-12-02) + + +### Bug Fixes + +* Change cloudwatch log group output to include all created log groups ([#19](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/19)) ([cdc870e](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/cdc870e425fd34a93f3e38adccf8eb4c8fd1ef1a)) + ## [1.4.0](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.3.0...v1.4.0) (2024-11-29) From 41e5c75b2ea15a8631f8bb9f7f73ad5d868eeddf Mon Sep 17 00:00:00 2001 From: Melissa Greenbaum <69476188+magreenbaum@users.noreply.github.com> Date: Sat, 29 Mar 2025 09:49:21 -0400 Subject: [PATCH 15/18] feat: Add elasticache cluster timeouts (#33) --- README.md | 5 +++-- examples/redis-cluster/main.tf | 6 ++++++ main.tf | 6 ++++++ variables.tf | 6 ++++++ versions.tf | 2 +- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9cea7db..e437ed6 100644 --- a/README.md +++ b/README.md @@ -366,14 +366,14 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.73 | +| [aws](#requirement\_aws) | >= 5.93 | | [random](#requirement\_random) | >= 3.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.73 | +| [aws](#provider\_aws) | >= 5.93 | | [random](#provider\_random) | >= 3.0 | ## Modules @@ -462,6 +462,7 @@ No modules. | [subnet\_group\_name](#input\_subnet\_group\_name) | The name of the subnet group. If `create_subnet_group` is `true`, this is the name assigned to the subnet group created. Otherwise, this is the name of an existing subnet group | `string` | `null` | no | | [subnet\_ids](#input\_subnet\_ids) | List of VPC Subnet IDs for the Elasticache subnet group | `list(string)` | `[]` | no | | [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no | +| [timeouts](#input\_timeouts) | Define maximum timeout for creating, updating, and deleting cluster resource | `map(string)` | `{}` | no | | [transit\_encryption\_enabled](#input\_transit\_encryption\_enabled) | Enable encryption in-transit. Supported only with Memcached versions `1.6.12` and later, running in a VPC | `bool` | `true` | no | | [transit\_encryption\_mode](#input\_transit\_encryption\_mode) | A setting that enables clients to migrate to in-transit encryption with no downtime. Valid values are preferred and required | `string` | `null` | no | | [user\_group\_ids](#input\_user\_group\_ids) | User Group ID to associate with the replication group. Only a maximum of one (1) user group ID is valid | `list(string)` | `null` | no | diff --git a/examples/redis-cluster/main.tf b/examples/redis-cluster/main.tf index d2fa6fc..9e1e504 100644 --- a/examples/redis-cluster/main.tf +++ b/examples/redis-cluster/main.tf @@ -64,6 +64,12 @@ module "elasticache" { ] tags = local.tags + + timeouts = { + create = "1h" + update = "2h" + delete = "1h" + } } module "elasticache_disabled" { diff --git a/main.tf b/main.tf index 69a3b9b..4097459 100644 --- a/main.tf +++ b/main.tf @@ -61,6 +61,12 @@ resource "aws_elasticache_cluster" "this" { transit_encryption_enabled = var.engine == "memcached" ? var.transit_encryption_enabled : null tags = local.tags + + timeouts { + create = try(var.timeouts.create, null) + update = try(var.timeouts.update, null) + delete = try(var.timeouts.delete, null) + } } ################################################################################ diff --git a/variables.tf b/variables.tf index 55b36ba..f4049d6 100644 --- a/variables.tf +++ b/variables.tf @@ -187,6 +187,12 @@ variable "transit_encryption_mode" { default = null } +variable "timeouts" { + description = "Define maximum timeout for creating, updating, and deleting cluster resource" + type = map(string) + default = {} +} + ################################################################################ # Replication Group ################################################################################ diff --git a/versions.tf b/versions.tf index 648b57a..6dda813 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.73" + version = ">= 5.93" } random = { source = "hashicorp/random" From 5ebac98382eabce381e84cc478235f81005c11d7 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sat, 29 Mar 2025 13:49:45 +0000 Subject: [PATCH 16/18] chore(release): version 1.5.0 [skip ci] ## [1.5.0](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.4.1...v1.5.0) (2025-03-29) ### Features * Add elasticache cluster timeouts ([#33](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/33)) ([41e5c75](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/41e5c75b2ea15a8631f8bb9f7f73ad5d868eeddf)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e4b3bc..1b71d98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## [1.5.0](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.4.1...v1.5.0) (2025-03-29) + + +### Features + +* Add elasticache cluster timeouts ([#33](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/33)) ([41e5c75](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/41e5c75b2ea15a8631f8bb9f7f73ad5d868eeddf)) + ## [1.4.1](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.4.0...v1.4.1) (2024-12-02) From 9133f1ec80c4cefef8dd5a763f6f6d9e4526276e Mon Sep 17 00:00:00 2001 From: Alisson Ramos de Oliveira <13340485+alisson276@users.noreply.github.com> Date: Sun, 30 Mar 2025 15:10:13 +0100 Subject: [PATCH 17/18] feat: Set `create_before_destroy` on subnet group (#29) Co-authored-by: Bryant Biggs --- main.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.tf b/main.tf index 4097459..98cbbb0 100644 --- a/main.tf +++ b/main.tf @@ -292,6 +292,10 @@ resource "aws_elasticache_subnet_group" "this" { subnet_ids = var.subnet_ids tags = local.tags + + lifecycle { + create_before_destroy = true + } } ################################################################################ From d10bc362c93de62971a78d243aa4d00f66cf59c2 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 30 Mar 2025 14:10:34 +0000 Subject: [PATCH 18/18] chore(release): version 1.6.0 [skip ci] ## [1.6.0](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.5.0...v1.6.0) (2025-03-30) ### Features * Set `create_before_destroy` on subnet group ([#29](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/29)) ([9133f1e](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/9133f1ec80c4cefef8dd5a763f6f6d9e4526276e)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b71d98..afcc12d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## [1.6.0](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.5.0...v1.6.0) (2025-03-30) + + +### Features + +* Set `create_before_destroy` on subnet group ([#29](https://github.com/terraform-aws-modules/terraform-aws-elasticache/issues/29)) ([9133f1e](https://github.com/terraform-aws-modules/terraform-aws-elasticache/commit/9133f1ec80c4cefef8dd5a763f6f6d9e4526276e)) + ## [1.5.0](https://github.com/terraform-aws-modules/terraform-aws-elasticache/compare/v1.4.1...v1.5.0) (2025-03-29)