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

IAM: permissions groups #521

Merged
merged 2 commits into from
Jan 12, 2024
Merged

IAM: permissions groups #521

merged 2 commits into from
Jan 12, 2024

Conversation

fehrnah
Copy link
Contributor

@fehrnah fehrnah commented Jan 2, 2024

Description

Add support for the now available permissions_groups for the IAM.
This means supporting them in the policies and adding them as datasource and resource.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (improve existing resource(s) or datasource(s))
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • make testacc TESTARGS="-run TestAccIamPerm.*"

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or issues
  • I have added acceptance tests that prove my fix is effective or that my feature works
  • New and existing acceptance tests pass locally with my changes
  • I ran succesfully go mod vendor if I added or modify go.mod file

@@ -28,7 +28,6 @@ resource "ovh_iam_policy" "manager" {
"account:apiovh:me/certificates/get",
"account:apiovh:me/tag/get",
"account:apiovh:services/get",
"account:apiovh:*",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found it was a good thing to have at least one example with a wildcard.

That illustrated that this field could take several values.

Thus I would keep at least a mention of wildcard (and thus either change the policy name or add a second one in example)

@@ -42,6 +41,7 @@ resource "ovh_iam_policy" "manager" {
* `allow` - List of actions allowed on resources by identities
* `except` - List of overrides of action that must not be allowed even if they are caught by allow. Only makes sens if allow contains wildcards.
* `deny` - List of actions that will be denied no matter what policy exists.
* `permissions_group` - Set of permissions group that apply to the policy.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `permissions_group` - Set of permissions group that apply to the policy.
* `permissions_group` - Set of permissions included in the policy. (They are overriden by allow, except & deny fields)

I would also detail how the permission group behaves compared to the allow, except & deny fields in the policy (suggestion between parenthesis above)

* `description` - Group description.
* `allow` - Set of actions allowed by the permissions group.
* `except` - Set of actions that will be subtracted from the `allow` list.
* `deny` - Set of actions that will be denied no matter what permissions group exists.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the wording surprising. Especially because a permission group doesn't reference a permission group

What about

Suggested change
* `deny` - Set of actions that will be denied no matter what permissions group exists.
* `deny` - Set of actions that will be denied no matter what permissions are defined in the permission group or policies using it.

* `owner` - Owner of the permissions group.
* `created_at` - Creation date of this group.
* `updated_at` - Date of the last update of this group.
* `read_only` - Indicates that the permissions group is a default one.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `read_only` - Indicates that the permissions group is a default one.
* `read_only` - Indicates that this is a default permission group, managed by OVHcloud.

@fehrnah fehrnah changed the title Dev/nfournie/perm group IAM: permissions groups Jan 2, 2024
@fehrnah fehrnah requested review from rbeuque74 and yomovh January 3, 2024 09:57
ovh/data_iam_permissions_group.go Outdated Show resolved Hide resolved
ovh/data_iam_permissions_group.go Show resolved Hide resolved
ovh/data_iam_permissions_group_test.go Outdated Show resolved Hide resolved
ovh/resource_iam_permission_group.go Outdated Show resolved Hide resolved
ovh/resource_iam_permissions_group_test.go Outdated Show resolved Hide resolved
ovh/resource_iam_permissions_group_test.go Show resolved Hide resolved
ovh/resource_iam_permissions_group_test.go Outdated Show resolved Hide resolved
website/docs/d/iam_permissions_groups.markdown Outdated Show resolved Hide resolved
website/docs/d/iam_policy.html.markdown Outdated Show resolved Hide resolved
website/docs/r/iam_policy.html.markdown Outdated Show resolved Hide resolved
@fehrnah fehrnah force-pushed the dev/nfournie/perm_group branch from 3b827b3 to 4ed9942 Compare January 11, 2024 17:02
@amstuta amstuta merged commit 242364a into master Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants