Skip to content

Conversation

@jaym
Copy link
Contributor

@jaym jaym commented Mar 16, 2025

  • A scope mrn can be provided for the custom policies
  • Added and organization resource
resource "mondoo_organization" "myorg" {
  name        = "My New Organization"
  description = "My New Organization Description 1"
}

@jaym jaym changed the title Jdm/p scope orgs Scope mrn for custom policies and org new resource Mar 16, 2025
@jaym jaym changed the title Scope mrn for custom policies and org new resource Scope mrn for custom policies and new org resource Mar 16, 2025
@jaym jaym force-pushed the jdm/p-scope-orgs branch from 0de2c1b to 37661e6 Compare March 16, 2025 20:37
@github-actions

This comment has been minimized.

@jaym jaym force-pushed the jdm/p-scope-orgs branch from 37661e6 to 84a8415 Compare March 17, 2025 14:08
@github-actions

This comment has been minimized.

@jaym jaym marked this pull request as ready for review March 31, 2025 16:23
@jaym jaym force-pushed the jdm/p-scope-orgs branch from 1544fd7 to 8a128ad Compare March 31, 2025 16:24
MarkdownDescription: "Mondoo space identifier. If there is no space ID, the provider space is used.",
Optional: true,
},
"scope_mrn": schema.StringAttribute{
Copy link
Contributor

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)

space, err := r.client.ComputeSpace(data.SpaceID)
if err != nil {
// resp.Diagnostics.AddError("Invalid Configuration", err.Error())
// return
Copy link
Contributor

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.

Copy link
Contributor Author

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

resp.Diagnostics.AddError("Invalid Configuration", err.Error())
return
// resp.Diagnostics.AddError("Invalid Configuration", err.Error())
// return
Copy link
Contributor

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,
Copy link
Contributor

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?

Copy link
Contributor Author

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

@vjeffrey vjeffrey requested a review from afiune May 12, 2025 15:17
@afiune afiune merged commit 0aeec97 into main May 12, 2025
19 checks passed
@afiune afiune deleted the jdm/p-scope-orgs branch May 12, 2025 16:38
@github-actions github-actions bot locked and limited conversation to collaborators May 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants