Skip to content

Commit 003c89c

Browse files
author
Benjamin Ritter
committed
feat: add folder role assignment acceptance tests
Signed-off-by: Benjamin Ritter <benjamin.ritter@stackit.cloud>
1 parent 94fbcf6 commit 003c89c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

stackit/internal/services/authorization/authorization_acc_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ var invalidRole string
3333
//go:embed testfiles/organization-role.tf
3434
var organizationRole string
3535

36+
//go:embed testfiles/folder-role.tf
37+
var folderRole string
38+
3639
var 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,
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
resource "stackit_authorization_folder_role_assignment" "serviceaccount" {
3+
resource_id = var.organization_id
4+
role = "owner"
5+
subject = var.test_service_account
6+
}

0 commit comments

Comments
 (0)