From db8c3511aef379f0fafdc79a54c7488d171a4ecd Mon Sep 17 00:00:00 2001 From: karthikeyannhs <174426205+Karthikeyannhs@users.noreply.github.com> Date: Thu, 2 Oct 2025 15:41:26 +0100 Subject: [PATCH 1/3] infra: add firehose resource dependency for firehose cloudwatch logs --- infrastructure/modules/kinesis_firehose/outputs.tf | 3 +++ infrastructure/stacks/api-layer/cloudwatch.tf | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/infrastructure/modules/kinesis_firehose/outputs.tf b/infrastructure/modules/kinesis_firehose/outputs.tf index d457b669a..d44705070 100644 --- a/infrastructure/modules/kinesis_firehose/outputs.tf +++ b/infrastructure/modules/kinesis_firehose/outputs.tf @@ -2,6 +2,9 @@ output "firehose_stream_name" { value = aws_kinesis_firehose_delivery_stream.eligibility_audit_firehose_delivery_stream.name } +output "firehose_stream" { + value = aws_kinesis_firehose_delivery_stream.eligibility_audit_firehose_delivery_stream} + output "kinesis_firehose_cmk_arn" { value = aws_kms_key.firehose_cmk.arn } diff --git a/infrastructure/stacks/api-layer/cloudwatch.tf b/infrastructure/stacks/api-layer/cloudwatch.tf index fb1af396b..d2c3f7b0c 100644 --- a/infrastructure/stacks/api-layer/cloudwatch.tf +++ b/infrastructure/stacks/api-layer/cloudwatch.tf @@ -19,9 +19,18 @@ resource "aws_cloudwatch_log_group" "firehose_audit" { Name = "kinesis-firehose-logs" Stack = local.stack_name } + + depends_on = [ + module.eligibility_audit_firehose_delivery_stream + ] } resource "aws_cloudwatch_log_stream" "firehose_audit_stream" { name = "audit_stream_log" log_group_name = aws_cloudwatch_log_group.firehose_audit.name + + depends_on = [ + aws_cloudwatch_log_group.firehose_audit, + module.eligibility_audit_firehose_delivery_stream + ] } From eb47600032dff29d630e5c74431e6e7cc9f6b728 Mon Sep 17 00:00:00 2001 From: karthikeyannhs <174426205+Karthikeyannhs@users.noreply.github.com> Date: Thu, 2 Oct 2025 16:48:13 +0100 Subject: [PATCH 2/3] infra: add firehose resource dependency for firehose cloudwatch logs --- infrastructure/modules/kinesis_firehose/outputs.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infrastructure/modules/kinesis_firehose/outputs.tf b/infrastructure/modules/kinesis_firehose/outputs.tf index d44705070..7411e92ed 100644 --- a/infrastructure/modules/kinesis_firehose/outputs.tf +++ b/infrastructure/modules/kinesis_firehose/outputs.tf @@ -3,7 +3,8 @@ output "firehose_stream_name" { } output "firehose_stream" { - value = aws_kinesis_firehose_delivery_stream.eligibility_audit_firehose_delivery_stream} + value = aws_kinesis_firehose_delivery_stream.eligibility_audit_firehose_delivery_stream +} output "kinesis_firehose_cmk_arn" { value = aws_kms_key.firehose_cmk.arn From e27f5998639b9d8488efa9faabd56e15a782754b Mon Sep 17 00:00:00 2001 From: karthikeyannhs <174426205+Karthikeyannhs@users.noreply.github.com> Date: Thu, 2 Oct 2025 17:22:30 +0100 Subject: [PATCH 3/3] fix cycle dependency --- infrastructure/modules/kinesis_firehose/outputs.tf | 4 ---- infrastructure/stacks/api-layer/cloudwatch.tf | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/infrastructure/modules/kinesis_firehose/outputs.tf b/infrastructure/modules/kinesis_firehose/outputs.tf index 7411e92ed..d457b669a 100644 --- a/infrastructure/modules/kinesis_firehose/outputs.tf +++ b/infrastructure/modules/kinesis_firehose/outputs.tf @@ -2,10 +2,6 @@ output "firehose_stream_name" { value = aws_kinesis_firehose_delivery_stream.eligibility_audit_firehose_delivery_stream.name } -output "firehose_stream" { - value = aws_kinesis_firehose_delivery_stream.eligibility_audit_firehose_delivery_stream -} - output "kinesis_firehose_cmk_arn" { value = aws_kms_key.firehose_cmk.arn } diff --git a/infrastructure/stacks/api-layer/cloudwatch.tf b/infrastructure/stacks/api-layer/cloudwatch.tf index d2c3f7b0c..babe1753f 100644 --- a/infrastructure/stacks/api-layer/cloudwatch.tf +++ b/infrastructure/stacks/api-layer/cloudwatch.tf @@ -21,7 +21,7 @@ resource "aws_cloudwatch_log_group" "firehose_audit" { } depends_on = [ - module.eligibility_audit_firehose_delivery_stream + module.eligibility_audit_firehose_delivery_stream.kinesis_firehose_cmk_arn ] } @@ -30,7 +30,6 @@ resource "aws_cloudwatch_log_stream" "firehose_audit_stream" { log_group_name = aws_cloudwatch_log_group.firehose_audit.name depends_on = [ - aws_cloudwatch_log_group.firehose_audit, - module.eligibility_audit_firehose_delivery_stream + aws_cloudwatch_log_group.firehose_audit ] }