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

Add provider_type OAUTH to vdc_org_group #1013

Merged
merged 5 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changes/v3.9.0/1013-improvements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* `vcd_org_group` adds `OAUTH` as an option to argument `provider_type` [GH-1013]
2 changes: 1 addition & 1 deletion .changes/v3.9.0/984-improvements.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
* `vcd_external_network_v2` allows setting DNS fields `dns1`, `dns2` and `dns_suffix` for NSX-T
backed entities so that it can be inherited by direct Org VDC networks [GH-984]
backed entities so that it can be inherited by direct Org VDC networks [GH-984]
2 changes: 1 addition & 1 deletion vcd/datasource_vcd_org_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func datasourceVcdOrgGroup() *schema.Resource {
"provider_type": {
Type: schema.TypeString,
Computed: true,
Description: "Identity provider type - 'SAML' or 'INTEGRATED' for local or LDAP",
Description: "Identity provider type for this this group. One of: 'INTEGRATED', 'SAML', 'OAUTH'.",
},
"description": {
Type: schema.TypeString,
Expand Down
4 changes: 2 additions & 2 deletions vcd/resource_vcd_org_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ func resourceVcdOrgGroup() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true, // VCD does not allow to change provider type
Description: "Identity provider type - 'SAML' or 'INTEGRATED' for LDAP",
ValidateFunc: validation.StringInSlice([]string{"SAML", "INTEGRATED"}, false),
Description: "Identity provider type for this this group. One of: 'INTEGRATED', 'SAML', 'OAUTH'.",
ValidateFunc: validation.StringInSlice([]string{"INTEGRATED", "SAML", "OAUTH"}, false),
},
"description": {
Type: schema.TypeString,
Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/org_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: |-

# vcd\_org\_group

Provides a data source for VMware Cloud Director Organization Groups. This can be used to fetch organization groups already defined in `SAML` or `LDAP`.
Provides a data source for VMware Cloud Director Organization Groups. This can be used to fetch organization groups already defined in `SAML`, `OAUTH` or `LDAP`.

Supported in provider *v3.6+*

Expand Down
18 changes: 15 additions & 3 deletions website/docs/r/org_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ description: |-
# vcd\_org\_group

Provides a VMware Cloud Director Organization group. This can be used to create, update, and delete
organization groups defined in `SAML` or `LDAP`.
organization groups defined in `SAML`, `OAUTH` or `LDAP`.

Supported in provider *v2.9+*

~> **Note:** This operation requires the rights included in the predefined `Organization
Administrator` role or an equivalent set of rights. `SAML` or `LDAP` must be configured as vCD
Administrator` role or an equivalent set of rights. `SAML`, `OAUTH` or `LDAP` must be configured as vCD
does not support local groups and will return HTTP error 403 "This operation is denied." if selected
`provider_type` is not configured.

Expand All @@ -30,6 +30,18 @@ resource "vcd_org_group" "org1" {
}
```

## Example Usage to add OAUTH group

```hcl
resource "vcd_org_group" "org1" {
org = "org1"

provider_type = "OAUTH"
name = "Org1-AdminGroup"
role = "Organization Administrator"
}
```

## Example Usage to add LDAP group

```hcl
Expand All @@ -50,7 +62,7 @@ The following arguments are supported:
* `org` - (Optional) The name of organization to which the VDC belongs. Optional if defined at provider level.
* `name` - (Required) A unique name for the group.
* `description` - (Optional) The description of Organization group
* `provider_type` - (Required) Identity provider type for this this group. One of `SAML` or
* `provider_type` - (Required) Identity provider type for this this group. One of `SAML`, `OAUTH` or
`INTEGRATED`. **Note** `LDAP` must be configured to create `INTEGRATED` groups and names must
match `LDAP` group names. If LDAP is not configured - it will return 403 errors.
* `role` - (Required) The role of the group. Role names can be retrieved from the organization. Both built-in roles and
Expand Down