-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
application_role_membership
and `organization_role_member…
…ship` resources (#12)
- Loading branch information
Showing
9 changed files
with
812 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "sonatypeiq_application_role_membership Resource - terraform-provider-sonatypeiq" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# sonatypeiq_application_role_membership (Resource) | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "sonatypeiq_application" "sandbox" { | ||
public_id = "sandbox-application" | ||
} | ||
data "sonatypeiq_role" "developer" { | ||
name = "Developer" | ||
} | ||
resource "sonatypeiq_user" "example_user" { | ||
username = "example2" | ||
password = "randomthing" | ||
first_name = "Example" | ||
last_name = "User" | ||
email = "[email protected]" | ||
} | ||
# Create and manage application role memberships for Sonatype IQ Server | ||
resource "sonatypeiq_application_role_membership" "application_role_membership" { | ||
application_id = data.sonatypeiq_application.sandbox.id | ||
role_id = data.sonatypeiq_role.developer.id | ||
user_name = sonatypeiq_user.example_user.username | ||
# user_name and group_name are mutually exclusive. | ||
# group_name = "developers" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `application_id` (String) The application ID | ||
- `role_id` (String) The role ID | ||
|
||
### Optional | ||
|
||
- `group_name` (String) The group name of the group (mutually exclusive with user_name) | ||
- `user_name` (String) The username of the user (mutually exclusive with group_name) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "sonatypeiq_organization_role_membership Resource - terraform-provider-sonatypeiq" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# sonatypeiq_organization_role_membership (Resource) | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "sonatypeiq_organization" "sandbox" { | ||
name = "Sandbox Organization" | ||
} | ||
data "sonatypeiq_role" "developer" { | ||
name = "Developer" | ||
} | ||
resource "sonatypeiq_user" "example" { | ||
username = "example" | ||
password = "randomthing" | ||
first_name = "Example" | ||
last_name = "User" | ||
email = "[email protected]" | ||
} | ||
# Create and manage application role memberships for Sonatype IQ Server | ||
resource "sonatypeiq_organization_role_membership" "organization_role_membership" { | ||
organization_id = data.sonatypeiq_organization.sandbox.id | ||
role_id = data.sonatypeiq_role.developer.id | ||
username = sonatypeiq_user.example.username | ||
# group_name can also be used but it is mutually exclusive with the user_name attribute. | ||
# group_name = "developers" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `organization_id` (String) The organization ID | ||
- `role_id` (String) The role ID | ||
|
||
### Optional | ||
|
||
- `group_name` (String) The group name of the group (mutually exclusive with user_name) | ||
- `user_name` (String) The username of the user (mutually exclusive with group_name) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. |
26 changes: 26 additions & 0 deletions
26
examples/resources/sonatypeiq_application_role_membership/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
data "sonatypeiq_application" "sandbox" { | ||
public_id = "sandbox-application" | ||
} | ||
|
||
data "sonatypeiq_role" "developer" { | ||
name = "Developer" | ||
} | ||
|
||
resource "sonatypeiq_user" "example_user" { | ||
username = "example2" | ||
password = "randomthing" | ||
first_name = "Example" | ||
last_name = "User" | ||
email = "[email protected]" | ||
} | ||
|
||
# Create and manage application role memberships for Sonatype IQ Server | ||
resource "sonatypeiq_application_role_membership" "application_role_membership" { | ||
application_id = data.sonatypeiq_application.sandbox.id | ||
role_id = data.sonatypeiq_role.developer.id | ||
user_name = sonatypeiq_user.example_user.username | ||
|
||
# user_name and group_name are mutually exclusive. | ||
# group_name = "developers" | ||
} | ||
|
26 changes: 26 additions & 0 deletions
26
examples/resources/sonatypeiq_organization_role_membership/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
data "sonatypeiq_organization" "sandbox" { | ||
name = "Sandbox Organization" | ||
} | ||
|
||
data "sonatypeiq_role" "developer" { | ||
name = "Developer" | ||
} | ||
|
||
resource "sonatypeiq_user" "example" { | ||
username = "example" | ||
password = "randomthing" | ||
first_name = "Example" | ||
last_name = "User" | ||
email = "[email protected]" | ||
} | ||
|
||
# Create and manage application role memberships for Sonatype IQ Server | ||
resource "sonatypeiq_organization_role_membership" "organization_role_membership" { | ||
organization_id = data.sonatypeiq_organization.sandbox.id | ||
role_id = data.sonatypeiq_role.developer.id | ||
username = sonatypeiq_user.example.username | ||
|
||
# group_name can also be used but it is mutually exclusive with the user_name attribute. | ||
# group_name = "developers" | ||
} | ||
|
Oops, something went wrong.