user-resources.tf 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # ==================
  2. # YC Users resources
  3. # ==================
  4. # resource "yandex_resourcemanager_cloud" "cloud" {
  5. # organization_id = "bpfou6cmuk9cse6vqu2j"
  6. # name = "cloud-003"
  7. # }
  8. # data "yandex_organizationmanager_saml_federation_user_account" fed_user {
  9. # count = length(local.users)
  10. # federation_id = "${yandex_organizationmanager_saml_federation.federation.id}"
  11. # name_id = local.users[count.index]
  12. # }
  13. # resource "yandex_resourcemanager_cloud_iam_member" "cloud_member" {
  14. # count = length(local.users)
  15. # cloud_id = var.cloud_id
  16. # role = "resource-manager.clouds.member"
  17. # member = "federatedUser:${data.yandex_organizationmanager_saml_federation_user_account.fed_user[count.index].id}"
  18. # depends_on = [
  19. # yandex_organizationmanager_saml_federation.federation
  20. # ]
  21. # }
  22. # resource "yandex_resourcemanager_folder" "folder" {
  23. # count = length(local.users)
  24. # cloud_id = var.cloud_id
  25. # name = local.users[count.index]
  26. # depends_on = [
  27. # yandex_organizationmanager_saml_federation.federation
  28. # ]
  29. # }
  30. # resource "yandex_resourcemanager_folder_iam_member" "folder_admin" {
  31. # count = length(local.users)
  32. # folder_id = "${yandex_resourcemanager_folder.folder[count.index].id}"
  33. # role = "admin"
  34. # member = "federatedUser:${data.yandex_organizationmanager_saml_federation_user_account.fed_user[count.index].id}"
  35. # depends_on = [
  36. # yandex_organizationmanager_saml_federation.federation
  37. # ]
  38. # }
  39. # locals {
  40. # users = flatten([for s in split("\n",("${file("${path.module}/kc-users.lst")}")) : regex("(.*):",s) if s != ""])
  41. # }
  42. /*
  43. output "kc_users" {
  44. value = local.users
  45. }
  46. */