File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
stackit/internal/services/authorization Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ var invalidRole string
3333//go:embed testfiles/organization-role.tf
3434var organizationRole string
3535
36+ //go:embed testfiles/folder-role.tf
37+ var folderRole string
38+
3639var testConfigVars = config.Variables {
3740 "project_id" : config .StringVariable (testutil .ProjectId ),
3841 "test_service_account" : config .StringVariable (testutil .TestProjectServiceAccountEmail ),
@@ -73,6 +76,11 @@ func TestAccProjectRoleAssignmentResource(t *testing.T) {
7376 ConfigVariables : testConfigVars ,
7477 Config : testutil .AuthorizationProviderConfig () + prerequisites + organizationRole ,
7578 },
79+ {
80+ // Assign a resource to a folder
81+ ConfigVariables : testConfigVars ,
82+ Config : testutil .AuthorizationProviderConfig () + prerequisites + folderRole ,
83+ },
7684 {
7785 // The Service Account inherits owner permissions for the project from the organization. Check if you can still assign owner permissions on the project explicitly
7886 ConfigVariables : testConfigVars ,
Original file line number Diff line number Diff line change 1+
2+ resource "stackit_authorization_folder_role_assignment" "serviceaccount" {
3+ resource_id = stackit_resourcemanager_folder. test . folder_id
4+ role = " owner"
5+ subject = var. test_service_account
6+ }
Original file line number Diff line number Diff line change @@ -8,3 +8,9 @@ resource "stackit_authorization_project_role_assignment" "serviceaccount" {
88 role = " reader"
99 subject = var. test_service_account
1010}
11+
12+ resource "stackit_resourcemanager_folder" "test" {
13+ name = " test"
14+ owner_email = " foo.bar@stackit.cloud"
15+ parent_container_id = var. organization_id
16+ }
You can’t perform that action at this time.
0 commit comments