Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 20, 2024

Conversation

ShiChangkuo
Copy link
Collaborator

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

  • add a new resource: flexibleengine_identity_group_role_assignment
  • deprecate resource: flexibleengine_identity_role_assignment_v3

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

  • Tests added/passed.
  • Documentation updated.
  • Schema updated.

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

@ShiChangkuo ShiChangkuo merged commit 282185e into FlexibleEngineCloud:master Mar 20, 2024
6 checks passed
@NuaRol
Copy link

NuaRol commented Apr 17, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[IAM] Add all project capability to flexibleengine_identity_role_assignment_v3
2 participants