Skip to content

Commit

Permalink
replace aws_iam_role.role with [0]
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Aug 27, 2025
1 parent ca0a2fd commit 1c6f390
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion terraform-state/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ output "tfstate_region" {

output "role_arn" {
description = "Role ARN for Terraform"
value = aws_iam_role.role.arn
value = !var.application_mode ? aws_iam_role.role[0].arn : null
}
2 changes: 1 addition & 1 deletion terraform-state/policy.tf
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,6 @@ data "aws_iam_policy_document" "allow_assume_role" {
sid = "AllowSTSAssumeTerraformRole"
effect = "Allow"
actions = ["sts:AssumeRole"]
resources = [aws_iam_role.role.arn]
resources = !var.application_mode ? [aws_iam_role.role[0].arn] : []
}
}

0 comments on commit 1c6f390

Please sign in to comment.