-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add Team Resource #118
Add Team Resource #118
Conversation
internal/provider/models/team.go
Outdated
if orgRole != "" && orgRole != string(iam.ORGANIZATIONMEMBER) { | ||
data.OrganizationRole = types.StringValue(orgRole) | ||
} else { | ||
data.OrganizationRole = types.StringNull() | ||
} |
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.
wrote it this way because i kept hitting Provider produced inconsistent result after apply
and because the API sets org role to org member automatically if org role is not provided
@vandyliu do we want to support update team roles in create and update? |
internal/provider/schemas/team.go
Outdated
Computed: true, | ||
MarkdownDescription: "The roles assigned to the workspaces", | ||
}, | ||
"deployment_roles": resourceSchema.SetNestedAttribute{ | ||
NestedObject: resourceSchema.NestedAttributeObject{ | ||
Attributes: ResourceDeploymentRoleSchemaAttributes(), | ||
}, | ||
Computed: 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.
should prob be optional or maybe even required but can be empty
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.
changed to optional - should not be required as teams don't have to have deployment_roles
internal/provider/schemas/team.go
Outdated
MarkdownDescription: "The IDs of the users to add to the Team", | ||
Optional: true, | ||
Validators: []validator.Set{ | ||
setvalidator.SizeAtLeast(1), |
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.
does it have to be 1, can we have empty team?
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.
yes we can have empty team - will change
@@ -0,0 +1,70 @@ | |||
package common |
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.
added this file for shared role functions
needed to create a new directory because if i had it in utils i would hit an import cycle
error since models, resources and utils reference each other in a cycle
@@ -47,11 +47,14 @@ func TestAccPreCheck(t *testing.T) { | |||
} | |||
} | |||
|
|||
func ProviderConfig(t *testing.T, isHosted bool) string { | |||
func ProviderConfig(t *testing.T, isHosted bool, isScim bool) string { |
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.
added this param to the signature and had to update all the files accordingly (which is why all the test files were affected)
}, | ||
}, | ||
}), | ||
ExpectError: regexp.MustCompile("Invalid Configuration: Cannot create, update or delete a Team resource when SCIM is enabled"), |
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.
Thank you!
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.
one last comment but looks good
Description
Add support for team resource on terraform.
Supports:
🎟 Issue(s)
#112
🧪 Functional Testing
Create
Update
Delete
📸 Screenshots
📋 Checklist
examples/
directory