Skip to content

Commit

Permalink
removed loop on iks workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
scotttyso committed Jul 25, 2021
1 parent 38516e1 commit c1c8cf6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions modules/tfe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ No providers.
| <a name="module_app_hello_variables"></a> [app\_hello\_variables](#module\_app\_hello\_variables) | terraform-cisco-modules/modules/tfe//modules/tfc_variables | n/a |
| <a name="module_app_hello_workspaces"></a> [app\_hello\_workspaces](#module\_app\_hello\_workspaces) | terraform-cisco-modules/modules/tfe//modules/tfc_workspace | n/a |
| <a name="module_iks_variables"></a> [iks\_variables](#module\_iks\_variables) | terraform-cisco-modules/modules/tfe//modules/tfc_variables | n/a |
| <a name="module_iks_workspaces"></a> [iks\_workspaces](#module\_iks\_workspaces) | terraform-cisco-modules/modules/tfe//modules/tfc_workspace | n/a |
| <a name="module_iks_workspace"></a> [iks\_workspace](#module\_iks\_workspace) | terraform-cisco-modules/modules/tfe//modules/tfc_workspace | n/a |
| <a name="module_iwo_variables"></a> [iwo\_variables](#module\_iwo\_variables) | terraform-cisco-modules/modules/tfe//modules/tfc_variables | n/a |
| <a name="module_iwo_workspaces"></a> [iwo\_workspaces](#module\_iwo\_workspaces) | terraform-cisco-modules/modules/tfe//modules/tfc_workspace | n/a |
| <a name="module_kube_variables"></a> [kube\_variables](#module\_kube\_variables) | terraform-cisco-modules/modules/tfe//modules/tfc_variables | n/a |
Expand Down Expand Up @@ -274,7 +274,7 @@ No resources.
| Name | Description |
|------|-------------|
| <a name="output_app_hello_workspaces"></a> [app\_hello\_workspaces](#output\_app\_hello\_workspaces) | Terraform Cloud App Hello Workspace ID(s). |
| <a name="output_iks_workspaces"></a> [iks\_workspaces](#output\_iks\_workspaces) | Terraform Cloud IKS Workspace ID(s). |
| <a name="output_iks_workspace"></a> [iks\_workspace](#output\_iks\_workspace) | Terraform Cloud IKS Workspace ID(s). |
| <a name="output_iwo_workspaces"></a> [iwo\_workspaces](#output\_iwo\_workspaces) | Terraform Cloud IWO Workspace ID(s). |
| <a name="output_kube_workspaces"></a> [kube\_workspaces](#output\_kube\_workspaces) | Terraform Cloud Kube Workspace ID(s). |
| <a name="output_tfc_agent_pool"></a> [tfc\_agent\_pool](#output\_tfc\_agent\_pool) | Terraform Cloud Agent Pool ID. |
Expand Down
14 changes: 6 additions & 8 deletions modules/tfe/ws_iks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -589,22 +589,21 @@ variable "ssh_key_5" {
# Terraform Cloud Workspaces
#__________________________________________________________

module "iks_workspaces" {
module "iks_workspace" {
source = "terraform-cisco-modules/modules/tfe//modules/tfc_workspace"
for_each = var.iks_cluster
auto_apply = true
description = "Intersight Kubernetes Service Workspace."
name = "${var.tenant_name}_${each.key}"
name = var.tenant_name
terraform_version = var.terraform_version
tfc_oath_token = var.tfc_oath_token
tfc_org_name = var.tfc_organization
vcs_repo = var.vcs_repo
working_directory = "iks"
}

output "iks_workspaces" {
output "iks_workspace" {
description = "Terraform Cloud IKS Workspace ID(s)."
value = { for v in sort(keys(module.iks_workspaces)) : v => module.iks_workspaces[v] }
value = module.iks_workspace.workspace.id
}

#__________________________________________________________
Expand All @@ -615,11 +614,10 @@ output "iks_workspaces" {
module "iks_variables" {
source = "terraform-cisco-modules/modules/tfe//modules/tfc_variables"
depends_on = [
module.iks_workspaces
module.iks_workspace
]
for_each = var.iks_cluster
category = "terraform"
workspace_id = module.iks_workspaces["${each.key}"].workspace.id
workspace_id = module.iks_workspace.workspace.id
variable_list = {
#---------------------------
# Terraform Cloud Variables
Expand Down

0 comments on commit c1c8cf6

Please sign in to comment.