From edd6be1da562eef55d333bd3c4f5398810e04ab6 Mon Sep 17 00:00:00 2001 From: Miguel Elhaiek Date: Wed, 10 Apr 2024 16:32:44 -0300 Subject: [PATCH] Adding depends_on to alb on bucket policy --- terraform/alb.tf | 2 +- terraform/modules/alb_logging/outputs.tf | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/terraform/alb.tf b/terraform/alb.tf index 702e922..2bdd246 100644 --- a/terraform/alb.tf +++ b/terraform/alb.tf @@ -25,7 +25,7 @@ resource "aws_lb" "vectorstore_nlb" { } depends_on = [ - aws_s3_bucket_policy.bucket_policy + module.alb_logging.s3_bucket_policy_arn ] } diff --git a/terraform/modules/alb_logging/outputs.tf b/terraform/modules/alb_logging/outputs.tf index 8851d74..89d9be7 100644 --- a/terraform/modules/alb_logging/outputs.tf +++ b/terraform/modules/alb_logging/outputs.tf @@ -2,3 +2,8 @@ output "bucket_name_output" { description = "The name of the S3 bucket for ALB logs" value = aws_s3_bucket.logging_bucket.bucket } + + +output "s3_bucket_policy_arn" { + value = aws_s3_bucket_policy.bucket_policy.policy +}