-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ac0db7
commit c60c514
Showing
4 changed files
with
103 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
resource "ibm_iam_access_group" "ag-vmware-lab" { | ||
name = "ag-vmware-lab" | ||
tags = var.tags | ||
} | ||
|
||
# Add visibility to the Resource Group | ||
resource "ibm_iam_access_group_policy" "rg-vmware-lab-visibility" { | ||
access_group_id = ibm_iam_access_group.ag-vmware-lab.id | ||
roles = ["Viewer"] | ||
resources { | ||
resource_type = "resource-group" | ||
resource = ibm_resource_group.rg-vmware-lab.id | ||
} | ||
} | ||
|
||
# Service: VCF as a Service | ||
# | ||
# Platform Roles: Viewer | ||
# Service Roles: Reader, Viewer, VCFaaS Director Console User, | ||
# VCFaaS Director Backup User, VCFaaS Director Security Admin, | ||
# VCFaaS Director Network Admin, VCFaaS Director Catalog Author, | ||
# VCFaaS Director vApp User, VCFaaS Director vApp Author, | ||
# VCFaaS Director Full Viewer | ||
resource "ibm_iam_access_group_policy" "policy-vcf-vmware-all" { | ||
access_group_id = ibm_iam_access_group.ag-vmware-lab.id | ||
resource_attributes { | ||
name = "serviceName" | ||
operator = "stringEquals" | ||
value = "vmware" | ||
} | ||
roles = ["Reader", "Viewer", "VCFaaS Director Console User", "VCFaaS Director Backup User", "VCFaaS Director Security Admin", "VCFaaS Director Network Admin", "VCFaaS Director Catalog Author", "VCFaaS Director vApp User", "VCFaaS Director vApp Author", "VCFaaS Director Full Viewer"] | ||
} | ||
|
||
# Service: VCF as a Service | ||
resource "ibm_iam_access_group_policy" "policy-vcf-vmware-rg" { | ||
access_group_id = ibm_iam_access_group.ag-vmware-lab.id | ||
resource_attributes { | ||
name = "serviceName" | ||
operator = "stringEquals" | ||
value = "vmware" | ||
} | ||
resource_attributes { | ||
name = "resourceGroupId" | ||
operator = "stringEquals" | ||
value = ibm_resource_group.rg-vmware-lab.id | ||
} | ||
roles = ["Viewer", "Administrator", "Editor", "Operator", "Service Configuration Reader", "Key Manager"] | ||
} | ||
|
||
# Service: VMware Solutions | ||
# | ||
# Platform Roles: Viewer | ||
# Service Roles: Reader | ||
resource "ibm_iam_access_group_policy" "policy-vmware-solutions" { | ||
access_group_id = ibm_iam_access_group.ag-vmware-lab.id | ||
resource_attributes { | ||
name = "serviceName" | ||
operator = "stringEquals" | ||
value = "vmware-solutions" | ||
} | ||
resource_attributes { | ||
name = "resourceGroupId" | ||
operator = "stringEquals" | ||
value = ibm_resource_group.rg-vmware-lab.id | ||
} | ||
roles = ["Viewer", "Reader"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,31 @@ | ||
|
||
# invite the users in the account and attach them to their access group | ||
# resource "ibm_iam_user_invite" "invite_user" { | ||
# users = ["[email protected]"] | ||
# access_groups = [ibm_iam_access_group.ag-test.id] | ||
resource "ibm_iam_user_invite" "invite_user" { | ||
users = ["[email protected]"] | ||
access_groups = [ibm_iam_access_group.ag-vmware-lab.id] | ||
} | ||
|
||
|
||
# Update the policies of existing users | ||
# Assign Access Group to an existing user | ||
resource "ibm_iam_access_group_members" "assign-vmware-ag-to-user" { | ||
access_group_id = ibm_iam_access_group.ag-vmware-lab.id | ||
ibm_ids = ["[email protected]"] | ||
} | ||
|
||
resource "ibm_iam_user_invite" "assign-existing-user-to-classic-infra" { | ||
users = ["[email protected]"] | ||
classic_infra_roles { | ||
# permission_set = "superuser" | ||
permission_set = "noacess" | ||
} | ||
} | ||
|
||
# Not supported by Terraform yet | ||
# resource "ibm_iam_user_policy" "policy" { | ||
# ibm_ids = ["[email protected]"] | ||
# classic_infra_roles { | ||
# # permission_set = "superuser" | ||
# permission_set = "noacess" | ||
# } | ||
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters