-
Notifications
You must be signed in to change notification settings - Fork 2
Scope mrn for custom policies and new org resource #227
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
Conversation
jaym
commented
Mar 16, 2025
- A scope mrn can be provided for the custom policies
- Added and organization resource
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| MarkdownDescription: "Mondoo space identifier. If there is no space ID, the provider space is used.", | ||
| Optional: true, | ||
| }, | ||
| "scope_mrn": schema.StringAttribute{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we have now both, Space ID and Scope MRN, we should add a ConflictsWith entry to prevent users to provide both. (docs https://developer.hashicorp.com/terraform/plugin/sdkv2/schemas/schema-methods)
internal/provider/custom_policy.go
Outdated
| space, err := r.client.ComputeSpace(data.SpaceID) | ||
| if err != nil { | ||
| // resp.Diagnostics.AddError("Invalid Configuration", err.Error()) | ||
| // return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did we comment this out? I think we still want to error is we don't have a scope Mrn 🤔
if not, we should at least display a log saying what's happening here and remove this comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i made scope mrn optional. But ill get this cleaned up
internal/provider/custom_policy.go
Outdated
| resp.Diagnostics.AddError("Invalid Configuration", err.Error()) | ||
| return | ||
| // resp.Diagnostics.AddError("Invalid Configuration", err.Error()) | ||
| // return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
| }, | ||
| "id": schema.StringAttribute{ | ||
| MarkdownDescription: "ID of the space. Must be globally unique. If the provider has a space configured and this field is empty, the provider space is used.", | ||
| Optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this id be specified by the user? or shy is this optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should try to use it if its specified and available