Skip to content

Commit

Permalink
Update network_type variable and add network_type to aws_elasticache_…
Browse files Browse the repository at this point in the history
…replication_group resource (#68)
  • Loading branch information
soumik-avoma authored Mar 13, 2024
1 parent 6e9c57e commit c7422b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
13 changes: 8 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,13 @@ resource "aws_elasticache_replication_group" "cluster" {
at_rest_encryption_enabled = lookup(var.replication_group, "at_rest_encryption_enabled", true)
transit_encryption_enabled = lookup(var.replication_group, "transit_encryption_enabled", true)
multi_az_enabled = lookup(var.replication_group, "multi_az_enabled", false)
auth_token = var.auth_token_enable ? (var.auth_token == null ? random_password.auth_token[0].result : var.auth_token) : ""
kms_key_id = var.kms_key_id == "" ? join("", aws_kms_key.default[*].arn) : var.kms_key_id
tags = module.labels.tags
num_cache_clusters = lookup(var.replication_group, "num_cache_clusters", 1)
user_group_ids = var.user_group_ids
network_type = var.network_type

auth_token = var.auth_token_enable ? (var.auth_token == null ? random_password.auth_token[0].result : var.auth_token) : ""
kms_key_id = var.kms_key_id == "" ? join("", aws_kms_key.default[*].arn) : var.kms_key_id
tags = module.labels.tags
num_cache_clusters = lookup(var.replication_group, "num_cache_clusters", 1)
user_group_ids = var.user_group_ids

dynamic "log_delivery_configuration" {
for_each = var.log_delivery_configuration
Expand Down Expand Up @@ -217,6 +219,7 @@ resource "aws_elasticache_cluster" "default" {
apply_immediately = lookup(var.replication_group, "apply_immediately", false)
preferred_availability_zones = slice(var.availability_zones, 0, var.num_cache_nodes)
maintenance_window = lookup(var.replication_group, "maintenance_window", "sun:05:00-sun:06:00")
network_type = var.network_type
tags = module.labels.tags

}
Expand Down
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ variable "key_usage" {
description = "Specifies the intended use of the key. Defaults to ENCRYPT_DECRYPT, and only symmetric encryption and decryption are supported."
}

variable "network_type" {
type = string
default = "ipv4"
description = "value of the network type. Valid values are ipv4, ipv6 or dual_stack."
}


variable "deletion_window_in_days" {
type = number
default = 7
Expand Down

0 comments on commit c7422b5

Please sign in to comment.