Skip to content

Commit

Permalink
* 2.12.3 -- 2025-08-27
Browse files Browse the repository at this point in the history
  - terraform-state
    - remove role creation for application_mode
  • Loading branch information
badra001 committed Aug 27, 2025
1 parent b9def42 commit ca0a2fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,7 @@
* 2.12.2 -- 2025-08-25
- terraform-state
- add output: tfstate_dynamodb_table_name

* 2.12.3 -- 2025-08-27
- terraform-state
- remove role creation for application_mode
2 changes: 1 addition & 1 deletion common/version.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
locals {
_module_version = "2.12.2"
_module_version = "2.12.3"
}
5 changes: 3 additions & 2 deletions terraform-state/role.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ data "aws_iam_policy" "role_managed_policies" {
}

resource "aws_iam_role" "role" {
count = var.application_mode ? 0 : 1
name = local.role_name
description = local.role_description
force_detach_policies = local._defaults["force_detach_policies"]
Expand All @@ -38,13 +39,13 @@ resource "aws_iam_role" "role" {
local.base_tags,
var.tags,
lookup(var.component_tags, "role", {}),
tomap({ Name = local.role_name })
{ Name = local.role_name },
)
}

resource "aws_iam_role_policy_attachment" "role" {
for_each = !var.application_mode ? { for p in local.role_managed_policies : p => p } : {}
role = aws_iam_role.role.name
role = !var.application_mode ? aws_iam_role.role[0].name : null
policy_arn = each.value
}

Expand Down

0 comments on commit ca0a2fd

Please sign in to comment.