Skip to content
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

add transit encryption variable for elasticache cluster resource #64

Closed
Closed
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
19 changes: 10 additions & 9 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,16 @@ resource "aws_elasticache_parameter_group" "default" {
}

resource "aws_elasticache_cluster" "default" {
count = local.enabled ? 1 : 0
apply_immediately = var.apply_immediately
cluster_id = module.this.id
engine = "memcached"
engine_version = var.engine_version
node_type = var.instance_type
num_cache_nodes = var.cluster_size
parameter_group_name = join("", aws_elasticache_parameter_group.default[*].name)
subnet_group_name = local.elasticache_subnet_group_name
count = local.enabled ? 1 : 0
apply_immediately = var.apply_immediately
cluster_id = module.this.id
engine = "memcached"
engine_version = var.engine_version
node_type = var.instance_type
num_cache_nodes = var.cluster_size
parameter_group_name = join("", aws_elasticache_parameter_group.default[*].name)
transit_encryption_enabled = var.transit_encryption_enabled
subnet_group_name = local.elasticache_subnet_group_name
# It would be nice to remove null or duplicate security group IDs, if there are any, using `compact`,
# but that causes problems, and having duplicates does not seem to cause problems.
# See https://github.com/hashicorp/terraform/issues/29799
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,9 @@ variable "cloudwatch_metric_alarms_enabled" {
description = "Boolean flag to enable/disable CloudWatch metrics alarms"
default = false
}

variable "transit_encryption_enabled" {
type = bool
description = "Boolean flag to enable transit encryption (requires Memcached version 1.6.12+)"
default = false
}