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: add workspace_role resource #70

Merged
merged 4 commits into from
Oct 25, 2023

Conversation

parkedwards
Copy link
Contributor

resolves #40

@parkedwards parkedwards requested a review from a team as a code owner October 25, 2023 03:28
@@ -19,7 +19,6 @@ type WorkspaceRole struct {
BaseModel
Name string `json:"name"`
Description *string `json:"description"`
Permissions []string `json:"permissions"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

permissions are a deprecated version of scopes, and can be removed here

model.AccountID = customtypes.NewUUIDPointerValue(role.AccountID)
model.InheritedRoleID = customtypes.NewUUIDPointerValue(role.InheritedRoleID)

// NOTE: here, we'll omit updating the TF state with the scopes returned from the API
Copy link
Contributor Author

@parkedwards parkedwards Oct 25, 2023

Choose a reason for hiding this comment

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

let's say a practitioner configures a manage_work_pools scope in terraform. Prefect Cloud will create the role + automatically add subordinate scopes, like see_work_pools and write_work_pools. This will always cause a conflict on apply, as the practitioner will only have defined manage_work_pools

in this case, it's ok to hold onto the user-defined parameters only, as they'll more like request inputs vs. a full declarative reflection of the scopes assigned to this role

@@ -0,0 +1,63 @@
package resources_test
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just noting that these tests are not yet configured to run in GHA, as there's some extra setup we'll need to do around configuring the test provider to properly inherit env vars. we'll also want to define a precheck function, which testcases can hook into to ensure all the necessary parameters exist

#30

Copy link
Contributor

@jimid27 jimid27 left a comment

Choose a reason for hiding this comment

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

plz teach me Go one day

@parkedwards parkedwards merged commit 6822a11 into main Oct 25, 2023
4 checks passed
@parkedwards parkedwards deleted the feat/add-workspace-roles-resource branch October 25, 2023 18:58
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.

Resource and Data Source: prefect_workspace_role
2 participants