Skip to content

Commit

Permalink
fix: Set either name or name_prefix for fargate_fluentbit log group, …
Browse files Browse the repository at this point in the history
…not both (#219)

Co-authored-by: Artem Gorbatiuk <[email protected]>
Co-authored-by: Bryant Biggs <[email protected]>
  • Loading branch information
3 people authored Aug 1, 2023
1 parent a60accd commit b8b7a4f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2181,14 +2181,15 @@ module "external_secrets" {
################################################################################

locals {
fargate_fluentbit_policy_name = try(var.fargate_fluentbit_cw_log_group.create, true) ? try(var.fargate_fluentbit.policy_name, "${var.cluster_name}-fargate-fluentbit-logs") : null
fargate_fluentbit_policy_name = try(var.fargate_fluentbit_cw_log_group.create, true) ? try(var.fargate_fluentbit.policy_name, "${var.cluster_name}-fargate-fluentbit-logs") : null
fargate_fluentbit_cw_log_group_name = try(var.fargate_fluentbit_cw_log_group.name, "/${var.cluster_name}/fargate-fluentbit-logs")
}

resource "aws_cloudwatch_log_group" "fargate_fluentbit" {
count = try(var.fargate_fluentbit_cw_log_group.create, true) && var.enable_fargate_fluentbit ? 1 : 0

name = try(var.fargate_fluentbit_cw_log_group.name, null)
name_prefix = try(var.fargate_fluentbit_cw_log_group.name_prefix, "/${var.cluster_name}/fargate-fluentbit-logs")
name = try(var.fargate_fluentbit_cw_log_group.use_name_prefix, true) ? null : local.fargate_fluentbit_cw_log_group_name
name_prefix = try(var.fargate_fluentbit_cw_log_group.use_name_prefix, true) ? local.fargate_fluentbit_cw_log_group_name : null
retention_in_days = try(var.fargate_fluentbit_cw_log_group.retention, 90)
kms_key_id = try(var.fargate_fluentbit_cw_log_group.kms_key_arn, null)
skip_destroy = try(var.fargate_fluentbit_cw_log_group.skip_destroy, false)
Expand Down

0 comments on commit b8b7a4f

Please sign in to comment.