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

[resource_monitor_json] Avoid restricted role diffs with restriction_policy #2638

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

phillip-dd
Copy link
Contributor

@phillip-dd phillip-dd commented Oct 31, 2024

This hacks around this (already hacky) resource having conflicts with the restricted_roles attribute when the restriction_policy resource is used to manage permissions on monitors. The general strategy is to ignore roles sent back from the API if roles are not explicitly defined in the monitor. Note: This resource should be converted to a framework provider resource, that should provide much easier access to what the user configured and make this handling consistent and esaier to reason about.

Scenarios tested:

  • create monitor and restriction_policy (with and without roles), there should be no diff when running subsequent plans
  • modify the monitor and restricton policy, e.g. add/remove a role, there should be no diffs when running subsequent plans

Open questions:

  • what does this do to existing monitor_json resources when a user updates?

…olicy

This hacks around this (already hacky) resource having conflicts with the restricted_roles attribute when the restriction_policy resource is used to manage permissions on monitors. The general strategy is to ignore roles sent back from the API if roles are not explicitly defined in the monitor. Note: This resource should be convered to a framework provider resource, that should provide much easier access to what the user configured and make this handling consistent and esaier to reason about.

Scenarios tested:
* create monitor and restriction_policy (with and without roles), there should be no diff when running subsequent plans
* modify the monitor and restricton policy, e.g. add/remove a role, there should be no diffs when running subsequent plans

Open questions:
* what does this do to existing monitor_json resources when a user updates?
@phillip-dd phillip-dd force-pushed the pb/monitor-json-restricted-roles branch from 25774b7 to 86fac30 Compare November 1, 2024 13:45
@phillip-dd phillip-dd changed the title [resource_monitor_json] Avoid restricted role diffs with restricton_policy [resource_monitor_json] Avoid restricted role diffs with restriction_policy Nov 1, 2024
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.

2 participants