Skip to content

Commit

Permalink
Toggle all account-based terraform role and profile outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuru committed Jun 4, 2023
1 parent b57bf1b commit 42cc73c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions modules/account-map/modules/iam-roles/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ output "current_account_account_name" {
}

output "dns_terraform_role_arn" {
value = module.account_map.outputs.terraform_roles[module.account_map.outputs.dns_account_account_name]
value = local.profiles_enabled ? null : module.account_map.outputs.terraform_roles[module.account_map.outputs.dns_account_account_name]
description = "The AWS Role ARN for Terraform to use to provision DNS Zone delegations, when Role ARNs are in use"
}

output "dns_terraform_profile_name" {
value = module.account_map.outputs.terraform_profiles[module.account_map.outputs.dns_account_account_name]
value = local.profiles_enabled ? module.account_map.outputs.terraform_profiles[module.account_map.outputs.dns_account_account_name] : null
description = "The AWS config profile name for Terraform to use to provision DNS Zone delegations, when profiles are in use"
}

output "audit_terraform_role_arn" {
value = module.account_map.outputs.terraform_roles[module.account_map.outputs.audit_account_account_name]
value = local.profiles_enabled ? null : module.account_map.outputs.terraform_roles[module.account_map.outputs.audit_account_account_name]
description = "The AWS Role ARN for Terraform to use to provision resources in the \"audit\" role account, when Role ARNs are in use"
}

output "audit_terraform_profile_name" {
value = module.account_map.outputs.terraform_profiles[module.account_map.outputs.audit_account_account_name]
value = local.profiles_enabled ? module.account_map.outputs.terraform_profiles[module.account_map.outputs.audit_account_account_name] : null
description = "The AWS config profile name for Terraform to use to provision resources in the \"audit\" role account, when profiles are in use"
}

Expand All @@ -75,7 +75,7 @@ output "identity_account_account_name" {
}

output "identity_terraform_role_arn" {
value = module.account_map.outputs.terraform_roles[module.account_map.outputs.identity_account_account_name]
value = local.profiles_enabled ? null : module.account_map.outputs.terraform_roles[module.account_map.outputs.identity_account_account_name]
description = "The AWS Role ARN for Terraform to use to provision resources in the \"identity\" role account, when Role ARNs are in use"
}

Expand All @@ -85,12 +85,12 @@ output "identity_terraform_profile_name" {
}

output "identity_cicd_role_arn" {
value = module.account_map.outputs.cicd_roles[module.account_map.outputs.identity_account_account_name]
value = local.profiles_enabled ? null : module.account_map.outputs.cicd_roles[module.account_map.outputs.identity_account_account_name]
description = "(Deprecated) The AWS Role ARN for CI/CD tools to assume to gain access to other accounts, when Role ARNs are in use"
}

output "identity_cicd_profile_name" {
value = module.account_map.outputs.cicd_profiles[module.account_map.outputs.identity_account_account_name]
value = local.profiles_enabled ? module.account_map.outputs.cicd_profiles[module.account_map.outputs.identity_account_account_name] : null
description = "(Deprecated) The AWS config profile name for CI/CD tools to assume to gain access to other accounts, when profiles are in use"
}

Expand Down
2 changes: 1 addition & 1 deletion modules/dns-delegated/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ provider "aws" {
profile = module.iam_roles.profiles_enabled ? coalesce(var.import_profile_name, module.iam_roles.terraform_profile_name) : null

dynamic "assume_role" {
for_each = var.import_role_arn == null ? (module.iam_roles.terraform_role_arn != null ? [true] : []) : ["import"]
for_each = module.iam_roles.profiles_enabled ? [] : ["role"]
content {
role_arn = coalesce(var.import_role_arn, module.iam_roles.terraform_role_arn)
}
Expand Down

0 comments on commit 42cc73c

Please sign in to comment.