diff --git a/README.md b/README.md index 22a8e370..5abd2909 100644 --- a/README.md +++ b/README.md @@ -424,7 +424,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow. ## Copyright -Copyright © 2017-2022 [Cloud Posse, LLC](https://cpco.io/copyright) +Copyright © 2017-2023 [Cloud Posse, LLC](https://cpco.io/copyright) diff --git a/examples/complete/variables.tf b/examples/complete/variables.tf index 26874e76..d5e2aa59 100644 --- a/examples/complete/variables.tf +++ b/examples/complete/variables.tf @@ -38,11 +38,6 @@ variable "transit_encryption_enabled" { description = "Enable TLS" } -variable "zone_id" { - type = string - description = "Route53 DNS Zone ID" -} - variable "cloudwatch_metric_alarms_enabled" { type = bool description = "Boolean flag to enable/disable CloudWatch metrics alarms" diff --git a/main.tf b/main.tf index eddfdcce..33010e3a 100644 --- a/main.tf +++ b/main.tf @@ -66,7 +66,7 @@ module "aws_security_group" { } locals { - elasticache_subnet_group_name = var.elasticache_subnet_group_name != "" ? var.elasticache_subnet_group_name : join("", aws_elasticache_subnet_group.default.*.name) + elasticache_subnet_group_name = var.elasticache_subnet_group_name != "" ? var.elasticache_subnet_group_name : join("", aws_elasticache_subnet_group.default[*].name) # if !cluster, then node_count = replica cluster_size, if cluster then node_count = shard*(replica + 1) # Why doing this 'The "count" value depends on resource attributes that cannot be determined until apply'. So pre-calculating @@ -77,7 +77,7 @@ locals { var.cluster_size ) - elasticache_member_clusters = module.this.enabled ? tolist(aws_elasticache_replication_group.default.0.member_clusters) : [] + elasticache_member_clusters = module.this.enabled ? tolist(aws_elasticache_replication_group.default[0].member_clusters) : [] } resource "aws_elasticache_subnet_group" "default" { @@ -121,7 +121,7 @@ resource "aws_elasticache_replication_group" "default" { node_type = var.instance_type num_cache_clusters = var.cluster_mode_enabled ? null : var.cluster_size port = var.port - parameter_group_name = join("", aws_elasticache_parameter_group.default.*.name) + parameter_group_name = join("", aws_elasticache_parameter_group.default[*].name) availability_zones = length(var.availability_zones) == 0 ? null : [for n in range(0, var.cluster_size) : element(var.availability_zones, n)] automatic_failover_enabled = var.cluster_mode_enabled ? true : var.automatic_failover_enabled multi_az_enabled = var.multi_az_enabled @@ -222,7 +222,7 @@ module "dns" { dns_name = var.dns_subdomain != "" ? var.dns_subdomain : module.this.id ttl = 60 zone_id = try(var.zone_id[0], tostring(var.zone_id), "") - records = var.cluster_mode_enabled ? [join("", aws_elasticache_replication_group.default.*.configuration_endpoint_address)] : [join("", aws_elasticache_replication_group.default.*.primary_endpoint_address)] + records = var.cluster_mode_enabled ? [join("", aws_elasticache_replication_group.default[*].configuration_endpoint_address)] : [join("", aws_elasticache_replication_group.default[*].primary_endpoint_address)] context = module.this.context } diff --git a/outputs.tf b/outputs.tf index 016308a8..3830fb91 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,5 +1,5 @@ output "id" { - value = join("", aws_elasticache_replication_group.default.*.id) + value = join("", aws_elasticache_replication_group.default[*].id) description = "Redis cluster ID" } @@ -19,17 +19,17 @@ output "port" { } output "endpoint" { - value = var.cluster_mode_enabled ? join("", aws_elasticache_replication_group.default.*.configuration_endpoint_address) : join("", aws_elasticache_replication_group.default.*.primary_endpoint_address) + value = var.cluster_mode_enabled ? join("", aws_elasticache_replication_group.default[*].configuration_endpoint_address) : join("", aws_elasticache_replication_group.default[*].primary_endpoint_address) description = "Redis primary or configuration endpoint, whichever is appropriate for the given cluster mode" } output "reader_endpoint_address" { - value = join("", compact(aws_elasticache_replication_group.default.*.reader_endpoint_address)) + value = join("", compact(aws_elasticache_replication_group.default[*].reader_endpoint_address)) description = "The address of the endpoint for the reader node in the replication group, if the cluster mode is disabled." } output "member_clusters" { - value = aws_elasticache_replication_group.default.*.member_clusters + value = aws_elasticache_replication_group.default[*].member_clusters description = "Redis cluster members" } @@ -39,16 +39,16 @@ output "host" { } output "arn" { - value = join("", aws_elasticache_replication_group.default.*.arn) + value = join("", aws_elasticache_replication_group.default[*].arn) description = "Elasticache Replication Group ARN" } output "engine_version_actual" { - value = join("", aws_elasticache_replication_group.default.*.engine_version_actual) + value = join("", aws_elasticache_replication_group.default[*].engine_version_actual) description = "The running version of the cache engine" } output "cluster_enabled" { - value = join("", aws_elasticache_replication_group.default.*.cluster_enabled) + value = join("", aws_elasticache_replication_group.default[*].cluster_enabled) description = "Indicates if cluster mode is enabled" }