diff --git a/README.md b/README.md index 77a3b80..a6f3760 100644 --- a/README.md +++ b/README.md @@ -292,6 +292,7 @@ Available targets: | [notification\_topic\_arn](#input\_notification\_topic\_arn) | Notification topic arn | `string` | `""` | no | | [ok\_actions](#input\_ok\_actions) | The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN) | `list(string)` | `[]` | no | | [parameter](#input\_parameter) | A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another |
list(object({
name = string
value = string
}))
| `[]` | no | +| [parameter\_group\_description](#input\_parameter\_group\_description) | Managed by Terraform | `string` | `null` | no | | [port](#input\_port) | Redis port | `number` | `6379` | no | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | | [replication\_group\_id](#input\_replication\_group\_id) | Replication group ID with the following constraints:
A name must contain from 1 to 20 alphanumeric characters or hyphens.
The first character must be a letter.
A name cannot end with a hyphen or contain two consecutive hyphens. | `string` | `""` | no | diff --git a/docs/terraform.md b/docs/terraform.md index d82e2ed..077a2f3 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -82,6 +82,7 @@ | [notification\_topic\_arn](#input\_notification\_topic\_arn) | Notification topic arn | `string` | `""` | no | | [ok\_actions](#input\_ok\_actions) | The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN) | `list(string)` | `[]` | no | | [parameter](#input\_parameter) | A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another |
list(object({
name = string
value = string
}))
| `[]` | no | +| [parameter\_group\_description](#input\_parameter\_group\_description) | Managed by Terraform | `string` | `null` | no | | [port](#input\_port) | Redis port | `number` | `6379` | no | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | | [replication\_group\_id](#input\_replication\_group\_id) | Replication group ID with the following constraints:
A name must contain from 1 to 20 alphanumeric characters or hyphens.
The first character must be a letter.
A name cannot end with a hyphen or contain two consecutive hyphens. | `string` | `""` | no | diff --git a/main.tf b/main.tf index 2fcae48..bc67d4e 100644 --- a/main.tf +++ b/main.tf @@ -62,7 +62,6 @@ module "aws_security_group" { security_group_create_timeout = var.security_group_create_timeout security_group_delete_timeout = var.security_group_delete_timeout - context = module.this.context } @@ -91,7 +90,7 @@ resource "aws_elasticache_subnet_group" "default" { resource "aws_elasticache_parameter_group" "default" { count = module.this.enabled ? 1 : 0 name = module.this.id - description = "Elasticache parameter group for ${module.this.id}" + description = var.parameter_group_description != null ? var.parameter_group_description : "Elasticache parameter group for ${module.this.id}" family = var.family dynamic "parameter" { @@ -101,6 +100,13 @@ resource "aws_elasticache_parameter_group" "default" { value = tostring(parameter.value.value) } } + + # Ignore changes to the description since it will try to recreate the resource + lifecycle { + ignore_changes = [ + description, + ] + } } resource "aws_elasticache_replication_group" "default" { diff --git a/variables.tf b/variables.tf index 53c5036..f5ae0ed 100644 --- a/variables.tf +++ b/variables.tf @@ -221,3 +221,8 @@ variable "cloudwatch_metric_alarms_enabled" { default = false } +variable "parameter_group_description" { + type = string + default = null + description = "Managed by Terraform" +} \ No newline at end of file