Skip to content

Commit 0640af2

Browse files
authored
Merge pull request #6 from enthought/add-team-resource
Add organization team and robot resources
2 parents ecdaff1 + 5c995d8 commit 0640af2

24 files changed

+1824
-249
lines changed
Lines changed: 208 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,210 @@
11
{
2-
"provider": {
3-
"name": "quay"
4-
},
5-
"resources": [
6-
{
7-
"name": "organization",
8-
"schema": {
9-
"attributes": [
10-
{
11-
"name": "email",
12-
"string": {
13-
"computed_optional_required": "required",
14-
"description": "Organization contact email"
15-
}
16-
},
17-
{
18-
"name": "name",
19-
"string": {
20-
"computed_optional_required": "required",
21-
"description": "Organization name"
22-
}
23-
}
24-
]
25-
}
26-
}
27-
],
28-
"datasources": [
29-
{
30-
"name": "organization",
31-
"schema": {
32-
"attributes": [
33-
{
34-
"name": "email",
35-
"string": {
36-
"computed_optional_required": "computed",
37-
"description": "Organization contact email"
38-
}
39-
},
40-
{
41-
"name": "name",
42-
"string": {
43-
"computed_optional_required": "required",
44-
"description": "Organization name"
45-
}
46-
}
47-
]
48-
}
49-
}
50-
],
51-
"version": "0.1"
2+
"provider": {
3+
"name": "quay"
4+
},
5+
"resources": [
6+
{
7+
"name": "organization",
8+
"schema": {
9+
"attributes": [
10+
{
11+
"name": "email",
12+
"string": {
13+
"computed_optional_required": "required",
14+
"description": "Organization contact email"
15+
}
16+
},
17+
{
18+
"name": "name",
19+
"string": {
20+
"computed_optional_required": "required",
21+
"description": "Organization name"
22+
}
23+
}
24+
]
25+
}
26+
},
27+
{
28+
"name": "organization_robot",
29+
"schema": {
30+
"attributes": [
31+
{
32+
"name": "description",
33+
"string": {
34+
"computed_optional_required": "computed_optional",
35+
"default" : {
36+
"static": ""
37+
},
38+
"description": "Text description",
39+
"plan_modifiers": [
40+
{
41+
"custom": {
42+
"imports": [
43+
{
44+
"path": "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
45+
}
46+
],
47+
"schema_definition": "stringplanmodifier.RequiresReplace()"
48+
}
49+
}
50+
]
51+
}
52+
},
53+
{
54+
"name": "fullname",
55+
"string": {
56+
"computed_optional_required": "computed",
57+
"description": "Robot full name"
58+
}
59+
},
60+
{
61+
"name": "name",
62+
"string": {
63+
"computed_optional_required": "required",
64+
"description": "Robot short name",
65+
"plan_modifiers": [
66+
{
67+
"custom": {
68+
"imports": [
69+
{
70+
"path": "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
71+
}
72+
],
73+
"schema_definition": "stringplanmodifier.RequiresReplace()"
74+
}
75+
}
76+
]
77+
}
78+
},
79+
{
80+
"name": "orgname",
81+
"string": {
82+
"computed_optional_required": "required",
83+
"description": "Organization name",
84+
"plan_modifiers": [
85+
{
86+
"custom": {
87+
"imports": [
88+
{
89+
"path": "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
90+
}
91+
],
92+
"schema_definition": "stringplanmodifier.RequiresReplace()"
93+
}
94+
}
95+
]
96+
}
97+
}
98+
]
99+
}
100+
},
101+
{
102+
"name": "organization_team",
103+
"schema": {
104+
"attributes": [
105+
{
106+
"name": "description",
107+
"string": {
108+
"computed_optional_required": "computed_optional",
109+
"default" : {
110+
"static": ""
111+
},
112+
"description": "Markdown description"
113+
}
114+
},
115+
{
116+
"name": "members",
117+
"list": {
118+
"computed_optional_required": "optional",
119+
"description": "List of team members",
120+
"element_type": {
121+
"string": {}
122+
}
123+
}
124+
},
125+
{
126+
"name": "name",
127+
"string": {
128+
"computed_optional_required": "required",
129+
"description": "Team name",
130+
"plan_modifiers": [
131+
{
132+
"custom": {
133+
"imports": [
134+
{
135+
"path": "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
136+
}
137+
],
138+
"schema_definition": "stringplanmodifier.RequiresReplace()"
139+
}
140+
}
141+
]
142+
}
143+
},
144+
{
145+
"name": "orgname",
146+
"string": {
147+
"computed_optional_required": "required",
148+
"description": "Organization name",
149+
"plan_modifiers": [
150+
{
151+
"custom": {
152+
"imports": [
153+
{
154+
"path": "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
155+
}
156+
],
157+
"schema_definition": "stringplanmodifier.RequiresReplace()"
158+
}
159+
}
160+
]
161+
}
162+
},
163+
{
164+
"name": "role",
165+
"string": {
166+
"computed_optional_required": "required",
167+
"description": "Team permission. Should be admin, creator, or member.",
168+
"validators": [
169+
{
170+
"custom": {
171+
"imports": [
172+
{
173+
"path": "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
174+
}
175+
],
176+
"schema_definition": "stringvalidator.OneOf([]string{\"admin\", \"creator\", \"member\"}...)"
177+
}
178+
}
179+
]
180+
}
181+
}
182+
]
183+
}
184+
}
185+
],
186+
"datasources": [
187+
{
188+
"name": "organization",
189+
"schema": {
190+
"attributes": [
191+
{
192+
"name": "email",
193+
"string": {
194+
"computed_optional_required": "computed",
195+
"description": "Organization contact email"
196+
}
197+
},
198+
{
199+
"name": "name",
200+
"string": {
201+
"computed_optional_required": "required",
202+
"description": "Organization name"
203+
}
204+
}
205+
]
206+
}
207+
}
208+
],
209+
"version": "0.1"
52210
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "quay_organization_robot Resource - quay"
4+
subcategory: ""
5+
description: |-
6+
7+
---
8+
9+
# quay_organization_robot (Resource)
10+
11+
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "quay_organization" "main" {
17+
name = "main"
18+
19+
}
20+
21+
resource "quay_organization_robot" "test" {
22+
name = "test"
23+
orgname = quay_organization.main.name
24+
}
25+
```
26+
27+
<!-- schema generated by tfplugindocs -->
28+
## Schema
29+
30+
### Required
31+
32+
- `name` (String) Robot short name
33+
- `orgname` (String) Organization name
34+
35+
### Optional
36+
37+
- `description` (String) Text description
38+
39+
### Read-Only
40+
41+
- `fullname` (String) Robot full name
42+
43+
## Import
44+
45+
Import is supported using the following syntax:
46+
47+
```shell
48+
# An organization robot can be imported using its short name.
49+
terraform import quay_organization_robot.test test
50+
```
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "quay_organization_team Resource - quay"
4+
subcategory: ""
5+
description: |-
6+
7+
---
8+
9+
# quay_organization_team (Resource)
10+
11+
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "quay_organization" "main" {
17+
name = "main"
18+
19+
}
20+
21+
resource "quay_organization_robot" "test" {
22+
name = "test"
23+
orgname = quay_organization.main.name
24+
}
25+
26+
resource "quay_organization_team" "admin" {
27+
name = "admin"
28+
orgname = quay_organization.main.name
29+
role = "admin"
30+
members = [
31+
quay_organization_robot.test.fullname
32+
]
33+
}
34+
```
35+
36+
<!-- schema generated by tfplugindocs -->
37+
## Schema
38+
39+
### Required
40+
41+
- `name` (String) Team name
42+
- `orgname` (String) Organization name
43+
- `role` (String) Team permission. Should be admin, creator, or member.
44+
45+
### Optional
46+
47+
- `description` (String) Markdown description
48+
- `members` (List of String) List of team members
49+
50+
## Import
51+
52+
Import is supported using the following syntax:
53+
54+
```shell
55+
# An organization team can be imported using its name.
56+
terraform import quay_organization_team.admin admin
57+
```

examples/main.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,17 @@ resource "quay_organization" "main" {
1414
name = "main"
1515
1616
}
17+
18+
resource "quay_organization_robot" "test" {
19+
name = "test"
20+
orgname = quay_organization.main.name
21+
}
22+
23+
resource "quay_organization_team" "admin" {
24+
name = "admin"
25+
orgname = quay_organization.main.name
26+
role = "admin"
27+
members = [
28+
quay_organization_robot.test.fullname
29+
]
30+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# An organization robot can be imported using its short name.
2+
terraform import quay_organization_robot.test test

0 commit comments

Comments
 (0)