aws / eks-charts

Amazon EKS Helm chart repository
Apache License 2.0
1.17k stars 922 forks source link

aws-for-fluent-bit does not update cloudwatch retention log. #1084

Open fonteslucas opened 3 months ago

fonteslucas commented 3 months ago

Describe the bug aws-for-fluent-bit does not update cloudwatch retention log in existing cloudwatch log groups

Steps to reproduce 1 - Deploy helm chart of aws-for-fluent-bit 2 - Deploy an example application 3 - Check the CloudWatch log group retention of application 4 - Change Helm Value cloudWatchLogs.logRetentionDays 5 - Observe the CloudWatch log group retention of application

Expected outcome Change the retention of CloudWatch Log group created by fluent-bit

Environment DEV/TEST (For now)

Additional Context:

HELM VALUES:

cloudWatchLogs:
 enabled:true
  region: ${aws_region}
  logGroupName: ${log_group_name}
  logRetentionDays: ${log_retention_days}
  logGroupTemplate: /aws/eks/fluentbit-cloudwatch/workload/$kubernetes['namespace_name']
  logFormat: JSON

IAM POLICY USED BY IRSA:

  data "aws_iam_policy_document" "irsa" {
  statement {
    sid       = "PutLogEvents"
    effect    = "Allow"
    resources = ["arn:${var.addon_context.aws_partition_id}:logs:${var.addon_context.aws_region_name}:${var.addon_context.aws_caller_identity_account_id}:log-group:*:log-stream:*"]
    actions   = ["logs:PutLogEvents"]
  }

  statement {
    sid       = "CreateCWLogs"
    effect    = "Allow"
    resources = ["arn:${var.addon_context.aws_partition_id}:logs:${var.addon_context.aws_region_name}:${var.addon_context.aws_caller_identity_account_id}:log-group:*"]
    actions = [
      "logs:CreateLogGroup",
      "logs:CreateLogStream",
      "logs:DescribeLogGroups",
      "logs:DescribeLogStreams",
      "logs:PutRetentionPolicy",
      "logs:DeleteLogGroup",
      "logs:DeleteRetentionPolicy"
    ]
  }
}