output "id" {
  description = "IAM role name (ID)"
  value       = aws_iam_role.this.id
}

output "arn" {
  description = "IAM role ARN"
  value       = aws_iam_role.this.arn
}

output "name" {
  description = "IAM role name"
  value       = aws_iam_role.this.name
}

output "unique_id" {
  description = "IAM role stable unique ID"
  value       = aws_iam_role.this.unique_id
}

output "instance_profile_arn" {
  description = "ARN of the EC2 instance profile (null if not created)"
  value       = var.instance_profile ? aws_iam_instance_profile.this["profile"].arn : null
}

output "instance_profile_name" {
  description = "Name of the EC2 instance profile (null if not created)"
  value       = var.instance_profile ? aws_iam_instance_profile.this["profile"].name : null
}
