diff --git a/README.md b/README.md index 0ba3fc1..c9b0ecf 100644 --- a/README.md +++ b/README.md @@ -217,10 +217,10 @@ Available targets: | [label\_value\_case](#input\_label\_value\_case) | Controls the letter case of ID elements (labels) as included in `id`,
set as tag values, and output by this module individually.
Does not affect values of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper` and `none` (no transformation).
Set this to `title` and set `delimiter` to `""` to yield Pascal Case IDs.
Default value: `lower`. | `string` | `null` | no | | [labels\_as\_tags](#input\_labels\_as\_tags) | Set of labels (ID elements) to include as tags in the `tags` output.
Default is to include all labels.
Tags with empty values will not be included in the `tags` output.
Set to `[]` to suppress all generated tags.
**Notes:**
The value of the `name` tag, if included, will be the `id`, not the `name`.
Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be
changed in later chained modules. Attempts to change it will be silently ignored. | `set(string)` |
[
"default"
]
| no | | [maintenance\_window](#input\_maintenance\_window) | Maintenance window | `string` | `"wed:03:00-wed:04:00"` | no | -| [max\_item\_size](#input\_max\_item\_size) | Max item size | `number` | `10485760` | no | | [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.
This is the only ID element not also included as a `tag`.
The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no | | [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no | | [notification\_topic\_arn](#input\_notification\_topic\_arn) | Notification topic arn | `string` | `""` | no | +| [parameter](#input\_parameter) | A list of Memcached parameters to apply. Note that parameters may differ from one Memcached family to another |
list(object({
name = string
value = string
}))
|
[
{
"name": "max_item_size",
"value": 10485760
}
]
| no | | [port](#input\_port) | Memcached port | `number` | `11211` | 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 | | [security\_group\_create\_before\_destroy](#input\_security\_group\_create\_before\_destroy) | Set `true` to enable Terraform `create_before_destroy` behavior on the created security group.
We only recommend setting this `false` if you are upgrading this module and need to keep
the existing security group from being replaced.
Note that changing this value will always cause the security group to be replaced. | `bool` | `true` | no | diff --git a/docs/terraform.md b/docs/terraform.md index e63d993..ad8c286 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -74,10 +74,10 @@ | [label\_value\_case](#input\_label\_value\_case) | Controls the letter case of ID elements (labels) as included in `id`,
set as tag values, and output by this module individually.
Does not affect values of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper` and `none` (no transformation).
Set this to `title` and set `delimiter` to `""` to yield Pascal Case IDs.
Default value: `lower`. | `string` | `null` | no | | [labels\_as\_tags](#input\_labels\_as\_tags) | Set of labels (ID elements) to include as tags in the `tags` output.
Default is to include all labels.
Tags with empty values will not be included in the `tags` output.
Set to `[]` to suppress all generated tags.
**Notes:**
The value of the `name` tag, if included, will be the `id`, not the `name`.
Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be
changed in later chained modules. Attempts to change it will be silently ignored. | `set(string)` |
[
"default"
]
| no | | [maintenance\_window](#input\_maintenance\_window) | Maintenance window | `string` | `"wed:03:00-wed:04:00"` | no | -| [max\_item\_size](#input\_max\_item\_size) | Max item size | `number` | `10485760` | no | | [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.
This is the only ID element not also included as a `tag`.
The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no | | [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no | | [notification\_topic\_arn](#input\_notification\_topic\_arn) | Notification topic arn | `string` | `""` | no | +| [parameter](#input\_parameter) | A list of Memcached parameters to apply. Note that parameters may differ from one Memcached family to another |
list(object({
name = string
value = string
}))
|
[
{
"name": "max_item_size",
"value": 10485760
}
]
| no | | [port](#input\_port) | Memcached port | `number` | `11211` | 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 | | [security\_group\_create\_before\_destroy](#input\_security\_group\_create\_before\_destroy) | Set `true` to enable Terraform `create_before_destroy` behavior on the created security group.
We only recommend setting this `false` if you are upgrading this module and need to keep
the existing security group from being replaced.
Note that changing this value will always cause the security group to be replaced. | `bool` | `true` | no | diff --git a/main.tf b/main.tf index f45c60b..e43302f 100644 --- a/main.tf +++ b/main.tf @@ -94,9 +94,12 @@ resource "aws_elasticache_parameter_group" "default" { name = module.this.id family = var.elasticache_parameter_group_family - parameter { - name = "max_item_size" - value = var.max_item_size + dynamic "parameter" { + for_each = var.elasticache_parameters + content { + name = parameter.value.name + value = tostring(parameter.value.value) + } } } diff --git a/variables.tf b/variables.tf index 105193d..77322d6 100644 --- a/variables.tf +++ b/variables.tf @@ -4,12 +4,6 @@ variable "vpc_id" { description = "VPC ID" } -variable "max_item_size" { - type = number - default = 10485760 - description = "Max item size" -} - variable "subnets" { type = list(string) default = [] @@ -118,6 +112,20 @@ variable "elasticache_parameter_group_family" { default = "memcached1.5" } +variable "elasticache_parameters" { + type = list(object({ + name = string + value = string + })) + default = [ + { + name = "max_item_size" + value = 10485760 + }, + ] + description = "A list of ElastiCache parameters to apply. Note that parameters may differ from one ElastiCache family to another" +} + variable "cloudwatch_metric_alarms_enabled" { type = bool description = "Boolean flag to enable/disable CloudWatch metrics alarms"