From 029e0cfe0dbe166c41e37c3185e83e846e37302c Mon Sep 17 00:00:00 2001 From: Maxim Mironenko Date: Thu, 20 May 2021 21:07:30 +0600 Subject: [PATCH] some resources names build logic fix (#38) --- main.tf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.tf b/main.tf index 82a9290..680e1b6 100644 --- a/main.tf +++ b/main.tf @@ -18,7 +18,7 @@ resource "aws_appautoscaling_target" "read_target_index" { resource "aws_appautoscaling_policy" "read_policy" { count = module.this.enabled ? 1 : 0 - name = "DynamoDBReadCapacityUtilization:${join("", aws_appautoscaling_target.read_target.*.resource_id)}" + name = "DynamoDBReadCapacityUtilization:${join("", aws_appautoscaling_target.read_target.*.id)}" policy_type = "TargetTrackingScaling" resource_id = join("", aws_appautoscaling_target.read_target.*.resource_id) @@ -37,7 +37,7 @@ resource "aws_appautoscaling_policy" "read_policy" { resource "aws_appautoscaling_policy" "read_policy_index" { for_each = toset(var.dynamodb_indexes) - name = "DynamoDBReadCapacityUtilization:${each.key}" + name = "DynamoDBReadCapacityUtilization:${aws_appautoscaling_target.read_target_index[each.key].id}" policy_type = "TargetTrackingScaling" resource_id = aws_appautoscaling_target.read_target_index[each.key].resource_id @@ -73,7 +73,7 @@ resource "aws_appautoscaling_target" "write_target_index" { resource "aws_appautoscaling_policy" "write_policy" { count = module.this.enabled ? 1 : 0 - name = "DynamoDBWriteCapacityUtilization:${join("", aws_appautoscaling_target.write_target.*.resource_id)}" + name = "DynamoDBWriteCapacityUtilization:${join("", aws_appautoscaling_target.write_target.*.id)}" policy_type = "TargetTrackingScaling" resource_id = join("", aws_appautoscaling_target.write_target.*.resource_id) @@ -92,7 +92,7 @@ resource "aws_appautoscaling_policy" "write_policy" { resource "aws_appautoscaling_policy" "write_policy_index" { for_each = toset(var.dynamodb_indexes) - name = "DynamoDBWriteCapacityUtilization:${each.key}" + name = "DynamoDBWriteCapacityUtilization:${aws_appautoscaling_target.write_target_index[each.key].id}" policy_type = "TargetTrackingScaling" resource_id = aws_appautoscaling_target.write_target_index[each.key].resource_id