Skip to content

Commit 28d2c68

Browse files
committed
initial draft
1 parent 574f53e commit 28d2c68

File tree

2 files changed

+160
-0
lines changed

2 files changed

+160
-0
lines changed

spectrocloud/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ func New(_ string) func() *schema.Provider {
138138
"spectrocloud_user": resourceUser(),
139139
"spectrocloud_role": resourceRole(),
140140
"spectrocloud_password_policy": resourcePasswordPolicy(),
141+
"spectrocloud_resource_limit": resourceResourceLimit(),
141142
},
142143
DataSourcesMap: map[string]*schema.Resource{
143144
"spectrocloud_permission": dataSourcePermission(),
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
package spectrocloud
2+
3+
import (
4+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
5+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
6+
"time"
7+
)
8+
9+
func resourceResourceLimit() *schema.Resource {
10+
return &schema.Resource{
11+
CreateContext: nil,
12+
ReadContext: nil,
13+
UpdateContext: nil,
14+
DeleteContext: nil,
15+
16+
Timeouts: &schema.ResourceTimeout{
17+
Create: schema.DefaultTimeout(10 * time.Minute),
18+
Update: schema.DefaultTimeout(10 * time.Minute),
19+
Delete: schema.DefaultTimeout(10 * time.Minute),
20+
},
21+
Description: "",
22+
SchemaVersion: 1,
23+
Schema: map[string]*schema.Schema{
24+
"alert": {
25+
Type: schema.TypeInt,
26+
Optional: true,
27+
Default: 100,
28+
ValidateFunc: validation.IntBetween(1, 10000),
29+
Description: "The number of alert limit. Must be between 1 and 10000.",
30+
},
31+
"api_keys": {
32+
Type: schema.TypeInt,
33+
Optional: true,
34+
Default: 20,
35+
ValidateFunc: validation.IntBetween(1, 10000),
36+
},
37+
"application_deployment": {
38+
Type: schema.TypeInt,
39+
Optional: true,
40+
Default: 20,
41+
ValidateFunc: validation.IntBetween(1, 10000),
42+
},
43+
"application_profile": {
44+
Type: schema.TypeInt,
45+
Optional: true,
46+
Default: 20,
47+
ValidateFunc: validation.IntBetween(1, 10000),
48+
},
49+
"certificate": {
50+
Type: schema.TypeInt,
51+
Optional: true,
52+
Default: 20,
53+
ValidateFunc: validation.IntBetween(1, 10000),
54+
},
55+
"cloud_account": {
56+
Type: schema.TypeInt,
57+
Optional: true,
58+
Default: 20,
59+
ValidateFunc: validation.IntBetween(1, 10000),
60+
},
61+
"cluster_group": {
62+
Type: schema.TypeInt,
63+
Optional: true,
64+
Default: 20,
65+
ValidateFunc: validation.IntBetween(1, 10000),
66+
},
67+
"cluster_profile": {
68+
Type: schema.TypeInt,
69+
Optional: true,
70+
Default: 20,
71+
ValidateFunc: validation.IntBetween(1, 10000),
72+
},
73+
"appliance": {
74+
Type: schema.TypeInt,
75+
Optional: true,
76+
Default: 20,
77+
ValidateFunc: validation.IntBetween(1, 10000),
78+
},
79+
"appliance_token": {
80+
Type: schema.TypeInt,
81+
Optional: true,
82+
Default: 20,
83+
ValidateFunc: validation.IntBetween(1, 10000),
84+
},
85+
"filter": {
86+
Type: schema.TypeInt,
87+
Optional: true,
88+
Default: 20,
89+
ValidateFunc: validation.IntBetween(1, 10000),
90+
},
91+
"location": {
92+
Type: schema.TypeInt,
93+
Optional: true,
94+
Default: 20,
95+
ValidateFunc: validation.IntBetween(1, 10000),
96+
},
97+
"macro": {
98+
Type: schema.TypeInt,
99+
Optional: true,
100+
Default: 20,
101+
ValidateFunc: validation.IntBetween(1, 10000),
102+
},
103+
"private_gateway": {
104+
Type: schema.TypeInt,
105+
Optional: true,
106+
Default: 20,
107+
ValidateFunc: validation.IntBetween(1, 10000),
108+
},
109+
"project": {
110+
Type: schema.TypeInt,
111+
Optional: true,
112+
Default: 20,
113+
ValidateFunc: validation.IntBetween(1, 10000),
114+
},
115+
"registry": {
116+
Type: schema.TypeInt,
117+
Optional: true,
118+
Default: 20,
119+
ValidateFunc: validation.IntBetween(1, 10000),
120+
},
121+
"role": {
122+
Type: schema.TypeInt,
123+
Optional: true,
124+
Default: 20,
125+
ValidateFunc: validation.IntBetween(1, 10000),
126+
},
127+
"cluster": {
128+
Type: schema.TypeInt,
129+
Optional: true,
130+
Default: 20,
131+
ValidateFunc: validation.IntBetween(1, 10000),
132+
},
133+
"ssh_key": {
134+
Type: schema.TypeInt,
135+
Optional: true,
136+
Default: 20,
137+
ValidateFunc: validation.IntBetween(1, 10000),
138+
},
139+
"team": {
140+
Type: schema.TypeInt,
141+
Optional: true,
142+
Default: 20,
143+
ValidateFunc: validation.IntBetween(1, 10000),
144+
},
145+
"user": {
146+
Type: schema.TypeInt,
147+
Optional: true,
148+
Default: 20,
149+
ValidateFunc: validation.IntBetween(1, 10000),
150+
},
151+
"workspace": {
152+
Type: schema.TypeInt,
153+
Optional: true,
154+
Default: 20,
155+
ValidateFunc: validation.IntBetween(1, 10000),
156+
},
157+
},
158+
}
159+
}

0 commit comments

Comments
 (0)