Skip to content

fix: Enable transit mode encryption var as it is now available in redis #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ No modules.
| <a name="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids) | List of VPC Subnet IDs for the Elasticache subnet group | `list(string)` | `[]` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | Define maximum timeout for creating, updating, and deleting cluster resource | `map(string)` | `{}` | no |
| <a name="input_transit_encryption_enabled"></a> [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 |
| <a name="input_transit_encryption_enabled"></a> [transit\_encryption\_enabled](#input\_transit\_encryption\_enabled) | Enable encryption in-transit. | `bool` | `null` | no |
| <a name="input_transit_encryption_mode"></a> [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 |
| <a name="input_user_group_ids"></a> [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 |
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | Identifier of the VPC where the security group will be created | `string` | `null` | no |
Expand Down
11 changes: 7 additions & 4 deletions examples/redis-replication-group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ module "elasticache" {
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
auth_token = "PickSomethingMoreSecure123!"
maintenance_window = "sun:05:00-sun:09:00"
apply_immediately = true

# Security Group
vpc_id = module.vpc.vpc_id
Expand Down Expand Up @@ -63,6 +62,10 @@ module "elasticache" {
}
]

# enable encryption in-transit
transit_encryption_enabled = true
transit_encryption_mode = "required"

tags = local.tags
}

Expand Down
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ resource "aws_elasticache_cluster" "this" {
snapshot_retention_limit = local.in_replication_group ? null : var.snapshot_retention_limit
snapshot_window = local.in_replication_group ? null : var.snapshot_window
subnet_group_name = local.in_replication_group ? null : local.subnet_group_name
transit_encryption_enabled = var.engine == "memcached" ? var.transit_encryption_enabled : null
# this makes it so that the transit encryption is enabled by default for memcached, which prevents a backwards incompatible change
transit_encryption_enabled = var.engine == "memcached" ? true : var.transit_encryption_enabled

tags = local.tags

Expand Down
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ variable "snapshot_window" {
}

variable "transit_encryption_enabled" {
description = "Enable encryption in-transit. Supported only with Memcached versions `1.6.12` and later, running in a VPC"
description = "Enable encryption in-transit."
type = bool
default = true
default = null
}

variable "transit_encryption_mode" {
Expand Down
Loading