From 6e6c487c5aa658f4c5c5027f2b4c65c9ba612910 Mon Sep 17 00:00:00 2001 From: Nikolay Date: Mon, 4 Oct 2021 19:16:55 -0700 Subject: [PATCH] Fixed teams creation/deletion. --- .gitignore | 3 +++ spectro-teams.tf | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 7a3e2fd..4230fcd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # Local .terraform directories **/.terraform/* +# data files +**/config/* + # .tfstate files *.tfstate *.tfstate.* diff --git a/spectro-teams.tf b/spectro-teams.tf index b41ef57..261f456 100644 --- a/spectro-teams.tf +++ b/spectro-teams.tf @@ -1,4 +1,3 @@ -/* data "spectrocloud_role" "projectadmin" { name = "Project Admin" } @@ -7,8 +6,8 @@ data "spectrocloud_role" "projectviewer" { name = "Project Viewer" } -resource "spectrocloud_team" "projectadmin" { - for_each = module.replacer_projects.all_objects +resource "spectrocloud_team" "admin_team" { + for_each = var.projects name = format("%s_admin", each.value.name) project_role_mapping { @@ -17,12 +16,12 @@ resource "spectrocloud_team" "projectadmin" { } } -resource "spectrocloud_team" "projectview" { - for_each = module.replacer_projects.all_objects +resource "spectrocloud_team" "view_team" { + for_each = var.projects name = format("%s_view", each.value.name) project_role_mapping { id = local.project_ids[each.value.name] roles = [data.spectrocloud_role.projectviewer.id] } -}*/ +}