Skip to content

Commit

Permalink
feat(aws_instance): conditional IAM instance profile
Browse files Browse the repository at this point in the history
  • Loading branch information
haidargit committed Jan 22, 2024
1 parent 81a869f commit 8543394
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ output "security_group_ids" {

output "role" {
description = "Name of AWS IAM Role associated with the instance"
value = local.instance_profile_count > 0 ? one(aws_iam_role.default[*].name) : (var.instance_profile_enabled ? (data.aws_iam_instance_profile.given[*].role_name) : "")
value = local.instance_profile_count > 0 ? one(aws_iam_role.default[*].name) : (var.instance_profile_enabled ? one(data.aws_iam_instance_profile.given[*].role_name) : one([""]))
}

output "role_arn" {
description = "ARN of AWS IAM Role associated with the instance"
value = local.instance_profile_count > 0 ? one(aws_iam_role.default[*].arn) : (var.instance_profile_enabled ? (data.aws_iam_instance_profile.given[*].role_arn) : "")
value = local.instance_profile_count > 0 ? one(aws_iam_role.default[*].arn) : (var.instance_profile_enabled ? one(data.aws_iam_instance_profile.given[*].role_arn) : one([""]))
}

output "alarm" {
Expand Down

0 comments on commit 8543394

Please sign in to comment.