-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from enthought/add-team-resource
Add organization team and robot resources
- Loading branch information
Showing
24 changed files
with
1,824 additions
and
249 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 |
---|---|---|
@@ -1,52 +1,210 @@ | ||
{ | ||
"provider": { | ||
"name": "quay" | ||
}, | ||
"resources": [ | ||
{ | ||
"name": "organization", | ||
"schema": { | ||
"attributes": [ | ||
{ | ||
"name": "email", | ||
"string": { | ||
"computed_optional_required": "required", | ||
"description": "Organization contact email" | ||
} | ||
}, | ||
{ | ||
"name": "name", | ||
"string": { | ||
"computed_optional_required": "required", | ||
"description": "Organization name" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"datasources": [ | ||
{ | ||
"name": "organization", | ||
"schema": { | ||
"attributes": [ | ||
{ | ||
"name": "email", | ||
"string": { | ||
"computed_optional_required": "computed", | ||
"description": "Organization contact email" | ||
} | ||
}, | ||
{ | ||
"name": "name", | ||
"string": { | ||
"computed_optional_required": "required", | ||
"description": "Organization name" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"version": "0.1" | ||
"provider": { | ||
"name": "quay" | ||
}, | ||
"resources": [ | ||
{ | ||
"name": "organization", | ||
"schema": { | ||
"attributes": [ | ||
{ | ||
"name": "email", | ||
"string": { | ||
"computed_optional_required": "required", | ||
"description": "Organization contact email" | ||
} | ||
}, | ||
{ | ||
"name": "name", | ||
"string": { | ||
"computed_optional_required": "required", | ||
"description": "Organization name" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "organization_robot", | ||
"schema": { | ||
"attributes": [ | ||
{ | ||
"name": "description", | ||
"string": { | ||
"computed_optional_required": "computed_optional", | ||
"default" : { | ||
"static": "" | ||
}, | ||
"description": "Text description", | ||
"plan_modifiers": [ | ||
{ | ||
"custom": { | ||
"imports": [ | ||
{ | ||
"path": "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" | ||
} | ||
], | ||
"schema_definition": "stringplanmodifier.RequiresReplace()" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "fullname", | ||
"string": { | ||
"computed_optional_required": "computed", | ||
"description": "Robot full name" | ||
} | ||
}, | ||
{ | ||
"name": "name", | ||
"string": { | ||
"computed_optional_required": "required", | ||
"description": "Robot short name", | ||
"plan_modifiers": [ | ||
{ | ||
"custom": { | ||
"imports": [ | ||
{ | ||
"path": "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" | ||
} | ||
], | ||
"schema_definition": "stringplanmodifier.RequiresReplace()" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "orgname", | ||
"string": { | ||
"computed_optional_required": "required", | ||
"description": "Organization name", | ||
"plan_modifiers": [ | ||
{ | ||
"custom": { | ||
"imports": [ | ||
{ | ||
"path": "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" | ||
} | ||
], | ||
"schema_definition": "stringplanmodifier.RequiresReplace()" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "organization_team", | ||
"schema": { | ||
"attributes": [ | ||
{ | ||
"name": "description", | ||
"string": { | ||
"computed_optional_required": "computed_optional", | ||
"default" : { | ||
"static": "" | ||
}, | ||
"description": "Markdown description" | ||
} | ||
}, | ||
{ | ||
"name": "members", | ||
"list": { | ||
"computed_optional_required": "optional", | ||
"description": "List of team members", | ||
"element_type": { | ||
"string": {} | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "name", | ||
"string": { | ||
"computed_optional_required": "required", | ||
"description": "Team name", | ||
"plan_modifiers": [ | ||
{ | ||
"custom": { | ||
"imports": [ | ||
{ | ||
"path": "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" | ||
} | ||
], | ||
"schema_definition": "stringplanmodifier.RequiresReplace()" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "orgname", | ||
"string": { | ||
"computed_optional_required": "required", | ||
"description": "Organization name", | ||
"plan_modifiers": [ | ||
{ | ||
"custom": { | ||
"imports": [ | ||
{ | ||
"path": "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" | ||
} | ||
], | ||
"schema_definition": "stringplanmodifier.RequiresReplace()" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "role", | ||
"string": { | ||
"computed_optional_required": "required", | ||
"description": "Team permission. Should be admin, creator, or member.", | ||
"validators": [ | ||
{ | ||
"custom": { | ||
"imports": [ | ||
{ | ||
"path": "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" | ||
} | ||
], | ||
"schema_definition": "stringvalidator.OneOf([]string{\"admin\", \"creator\", \"member\"}...)" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"datasources": [ | ||
{ | ||
"name": "organization", | ||
"schema": { | ||
"attributes": [ | ||
{ | ||
"name": "email", | ||
"string": { | ||
"computed_optional_required": "computed", | ||
"description": "Organization contact email" | ||
} | ||
}, | ||
{ | ||
"name": "name", | ||
"string": { | ||
"computed_optional_required": "required", | ||
"description": "Organization name" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"version": "0.1" | ||
} |
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,50 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "quay_organization_robot Resource - quay" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# quay_organization_robot (Resource) | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "quay_organization" "main" { | ||
name = "main" | ||
email = "[email protected]" | ||
} | ||
resource "quay_organization_robot" "test" { | ||
name = "test" | ||
orgname = quay_organization.main.name | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `name` (String) Robot short name | ||
- `orgname` (String) Organization name | ||
|
||
### Optional | ||
|
||
- `description` (String) Text description | ||
|
||
### Read-Only | ||
|
||
- `fullname` (String) Robot full name | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
# An organization robot can be imported using its short name. | ||
terraform import quay_organization_robot.test test | ||
``` |
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,57 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "quay_organization_team Resource - quay" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# quay_organization_team (Resource) | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "quay_organization" "main" { | ||
name = "main" | ||
email = "[email protected]" | ||
} | ||
resource "quay_organization_robot" "test" { | ||
name = "test" | ||
orgname = quay_organization.main.name | ||
} | ||
resource "quay_organization_team" "admin" { | ||
name = "admin" | ||
orgname = quay_organization.main.name | ||
role = "admin" | ||
members = [ | ||
quay_organization_robot.test.fullname | ||
] | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `name` (String) Team name | ||
- `orgname` (String) Organization name | ||
- `role` (String) Team permission. Should be admin, creator, or member. | ||
|
||
### Optional | ||
|
||
- `description` (String) Markdown description | ||
- `members` (List of String) List of team members | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
# An organization team can be imported using its name. | ||
terraform import quay_organization_team.admin admin | ||
``` |
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 |
---|---|---|
|
@@ -14,3 +14,17 @@ resource "quay_organization" "main" { | |
name = "main" | ||
email = "[email protected]" | ||
} | ||
|
||
resource "quay_organization_robot" "test" { | ||
name = "test" | ||
orgname = quay_organization.main.name | ||
} | ||
|
||
resource "quay_organization_team" "admin" { | ||
name = "admin" | ||
orgname = quay_organization.main.name | ||
role = "admin" | ||
members = [ | ||
quay_organization_robot.test.fullname | ||
] | ||
} |
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,2 @@ | ||
# An organization robot can be imported using its short name. | ||
terraform import quay_organization_robot.test test |
Oops, something went wrong.