FlexibleEngineCloud / terraform-provider-flexibleengine

Terraform flexibleengine provider
https://www.terraform.io/docs/providers/flexibleengine/
Mozilla Public License 2.0
30 stars 53 forks source link

feat(iam): add group role assignment resource #1116

Closed ShiChangkuo closed 5 months ago

ShiChangkuo commented 5 months ago

What this PR does / why we need it:

Which issue this PR fixes: (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged) fixes #1110

Special notes for your reviewer:

Release note:

NOTE

If we want to assign a role with all projects, please open a service ticket to obtain the access of Granting Permissions to a User Group for All Projects. Otherwise, we will get the following error:

{
  "error": {
    "code": 401,
    "message": "The request you have made requires authentication.",
    "title": "Unauthorized"
  }
}

PR Checklist

Acceptance Steps Performed

$ make testacc TEST="./flexibleengine/acceptance" TESTARGS="-run TestAccIdentityGroupRoleAssignment_basic"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./flexibleengine/acceptance -v -run TestAccIdentityGroupRoleAssignment_basic -timeout 720m
=== RUN   TestAccIdentityGroupRoleAssignment_basic
=== PAUSE TestAccIdentityGroupRoleAssignment_basic
=== CONT  TestAccIdentityGroupRoleAssignment_basic
--- PASS: TestAccIdentityGroupRoleAssignment_basic (47.96s)
PASS
ok      github.com/FlexibleEngineCloud/terraform-provider-flexibleengine/flexibleengine/acceptance      48.000s

$ make testacc TEST="./flexibleengine/acceptance" TESTARGS="-run TestAccIdentityGroupRoleAssignment_project"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./flexibleengine/acceptance -v -run TestAccIdentityGroupRoleAssignment_project -timeout 720m
=== RUN   TestAccIdentityGroupRoleAssignment_project
=== PAUSE TestAccIdentityGroupRoleAssignment_project
=== CONT  TestAccIdentityGroupRoleAssignment_project
--- PASS: TestAccIdentityGroupRoleAssignment_project (44.10s)
PASS
ok      github.com/FlexibleEngineCloud/terraform-provider-flexibleengine/flexibleengine/acceptance      44.152s

$ make testacc TEST="./flexibleengine/acceptance" TESTARGS="-run TestAccIdentityGroupRoleAssignment_epsID"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./flexibleengine/acceptance -v -run TestAccIdentityGroupRoleAssignment_epsID -timeout 720m
=== RUN   TestAccIdentityGroupRoleAssignment_epsID
=== PAUSE TestAccIdentityGroupRoleAssignment_epsID
=== CONT  TestAccIdentityGroupRoleAssignment_epsID
--- PASS: TestAccIdentityGroupRoleAssignment_epsID (54.33s)
PASS
ok      github.com/FlexibleEngineCloud/terraform-provider-flexibleengine/flexibleengine/acceptance      54.386s
NuaRol commented 4 months ago

Hello,

I got this error when trying to assign a role with all projects : "error assigning role: Authentication failed".

I am using AK/SK provider authentication.

The user already have the access of Granting Permissions to a User Group for All Projects. I tried to assign a role with all projects via API (using token authentication) and it works. But it doesn't work when I do it from the Terraform resource flexibleengine_identity_group_role_assignment (using AK/SK authentication).

Thank you!