outputs.tf
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Outputs ====================================================================

output "account_ids" {
  description = "Map of logical account key to AWS account ID"
  value       = { for account_key, account in aws_organizations_account.this : account_key => account.id }
}

output "account_arns" {
  description = "Map of logical account key to account ARN"
  value       = { for account_key, account in aws_organizations_account.this : account_key => account.arn }
}

output "account_access_role_arns" {
  description = "Map of logical account key to cross-account access role ARN — used by the calling stack to assume into each vended account"
  value = {
    for account_key, account in aws_organizations_account.this :
    account_key => "arn:aws:iam::${account.id}:role/${var.accounts[account_key].account_access_role_name}"
  }
}