Skip to content

Commit

Permalink
Access list items using square brackets on
Browse files Browse the repository at this point in the history
elasticace-redis/replication-group
  • Loading branch information
clarissalimab committed Dec 12, 2024
1 parent eefc03a commit 029a7d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions elasticache-redis/replication-group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module "server_security_group" {

allowed_security_group_ids = concat(
var.allowed_security_group_ids,
module.client_security_group.*.id
module.client_security_group[*].id
)

name = coalesce(
Expand Down Expand Up @@ -128,8 +128,8 @@ resource "aws_cloudwatch_metric_alarm" "cpu" {
CacheClusterId = local.instances[count.index]
}

alarm_actions = var.alarm_actions.*.arn
ok_actions = var.alarm_actions.*.arn
alarm_actions = var.alarm_actions[*].arn
ok_actions = var.alarm_actions[*].arn
}

resource "aws_cloudwatch_metric_alarm" "memory" {
Expand All @@ -150,8 +150,8 @@ resource "aws_cloudwatch_metric_alarm" "memory" {
CacheClusterId = local.instances[count.index]
}

alarm_actions = var.alarm_actions.*.arn
ok_actions = var.alarm_actions.*.arn
alarm_actions = var.alarm_actions[*].arn
ok_actions = var.alarm_actions[*].arn
}

resource "aws_cloudwatch_metric_alarm" "check_cpu_balance" {
Expand All @@ -164,8 +164,8 @@ resource "aws_cloudwatch_metric_alarm" "check_cpu_balance" {
threshold = "0"
treat_missing_data = "notBreaching"

alarm_actions = var.alarm_actions.*.arn
ok_actions = var.alarm_actions.*.arn
alarm_actions = var.alarm_actions[*].arn
ok_actions = var.alarm_actions[*].arn

metric_query {
id = "e1"
Expand Down Expand Up @@ -231,7 +231,7 @@ locals {
instance_count = var.replica_count + 1
instance_size = split(".", var.node_type)[2]
instances = sort(aws_elasticache_replication_group.this.member_clusters)
owned_security_group_ids = module.server_security_group.*.id
owned_security_group_ids = module.server_security_group[*].id
replica_enabled = var.replica_count > 0
shared_security_group_ids = var.server_security_group_ids

Expand Down
4 changes: 2 additions & 2 deletions elasticache-redis/replication-group/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
output "client_security_group_id" {
description = "Name of the security group created for clients"
value = join("", module.client_security_group.*.id)
value = join("", module.client_security_group[*].id)
}

output "initial_auth_token" {
Expand All @@ -20,5 +20,5 @@ output "id" {

output "server_security_group_id" {
description = "Name of the security group created for the server"
value = join("", module.server_security_group.*.id)
value = join("", module.server_security_group[*].id)
}

0 comments on commit 029a7d3

Please sign in to comment.