Skip to content

Commit

Permalink
fix: tflint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocode authored Nov 22, 2024
1 parent 3ccc327 commit 24b1ac9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ resource "aws_iam_role_policy" "default" {
count = module.this.enabled && var.policy_document_count > 0 && var.inline_policy_enabled ? 1 : 0

name = var.policy_name != "" && var.policy_name != null ? var.policy_name : module.this.id
role = join("", aws_iam_role.default.*.name)
role = join("", aws_iam_role.default[*].name)

policy = join("", data.aws_iam_policy_document.default.*.json)
policy = join("", data.aws_iam_policy_document.default[*].json)
}

data "aws_iam_policy_document" "default" {
Expand All @@ -62,25 +62,25 @@ resource "aws_iam_policy" "default" {
count = module.this.enabled && var.policy_document_count > 0 && !var.inline_policy_enabled ? 1 : 0
name = var.policy_name != "" && var.policy_name != null ? var.policy_name : module.this.id
description = var.policy_description
policy = join("", data.aws_iam_policy_document.default.*.json)
policy = join("", data.aws_iam_policy_document.default[*].json)
path = var.path
tags = var.tags_enabled ? module.this.tags : null
}

resource "aws_iam_role_policy_attachment" "default" {
count = module.this.enabled && var.policy_document_count > 0 && !var.inline_policy_enabled ? 1 : 0
role = join("", aws_iam_role.default.*.name)
policy_arn = join("", aws_iam_policy.default.*.arn)
role = join("", aws_iam_role.default[*].name)
policy_arn = join("", aws_iam_policy.default[*].arn)
}

resource "aws_iam_role_policy_attachment" "managed" {
for_each = module.this.enabled ? var.managed_policy_arns : []
role = join("", aws_iam_role.default.*.name)
role = join("", aws_iam_role.default[*].name)
policy_arn = each.key
}

resource "aws_iam_instance_profile" "default" {
count = module.this.enabled && var.instance_profile_enabled ? 1 : 0
name = module.this.id
role = join("", aws_iam_role.default.*.name)
role = join("", aws_iam_role.default[*].name)
}

0 comments on commit 24b1ac9

Please sign in to comment.