Skip to content

Commit

Permalink
Simplified expression a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbabenko committed Jan 26, 2021
1 parent 8c13a6e commit e9ef635
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ data "aws_iam_policy_document" "logs" {
statement {
effect = "Allow"

actions = concat([
actions = compact([
!var.use_existing_cloudwatch_log_group ? "logs:CreateLogGroup" : "",
"logs:CreateLogStream",
"logs:PutLogEvents",
], compact([!var.use_existing_cloudwatch_log_group ? "logs:CreateLogGroup" : ""]))
"logs:PutLogEvents"
])

resources = flatten([for _, v in ["%v:*", "%v:*:*"] : format(v, local.log_group_arn)])
}
Expand Down

0 comments on commit e9ef635

Please sign in to comment.