Skip to content

Commit 593ee7f

Browse files
authored
Merge pull request #139 from mackerelio-labs/max-items-dashboard
add MaxItems for list in dashboard schema
2 parents 9426cd0 + 47514e3 commit 593ee7f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

mackerel/resource_mackerel_dashboard.go

+10
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ func resourceMackerelDashboard() *schema.Resource {
149149
"host": {
150150
Type: schema.TypeList,
151151
Optional: true,
152+
MaxItems: 1,
152153
Elem: &schema.Resource{
153154
Schema: map[string]*schema.Schema{
154155
"host_id": {
@@ -165,6 +166,7 @@ func resourceMackerelDashboard() *schema.Resource {
165166
"role": {
166167
Type: schema.TypeList,
167168
Optional: true,
169+
MaxItems: 1,
168170
Elem: &schema.Resource{
169171
Schema: map[string]*schema.Schema{
170172
"role_fullname": {
@@ -186,6 +188,7 @@ func resourceMackerelDashboard() *schema.Resource {
186188
"service": {
187189
Type: schema.TypeList,
188190
Optional: true,
191+
MaxItems: 1,
189192
Elem: &schema.Resource{
190193
Schema: map[string]*schema.Schema{
191194
"service_name": {
@@ -202,6 +205,7 @@ func resourceMackerelDashboard() *schema.Resource {
202205
"expression": {
203206
Type: schema.TypeList,
204207
Optional: true,
208+
MaxItems: 1,
205209
Elem: &schema.Resource{
206210
Schema: map[string]*schema.Schema{
207211
"expression": {
@@ -214,11 +218,13 @@ func resourceMackerelDashboard() *schema.Resource {
214218
"range": {
215219
Type: schema.TypeList,
216220
Optional: true,
221+
MaxItems: 1,
217222
Elem: dashboardRangeResource,
218223
},
219224
"layout": {
220225
Type: schema.TypeList,
221226
Required: true,
227+
MaxItems: 1,
222228
Elem: dashboardLayoutResource,
223229
},
224230
},
@@ -236,6 +242,7 @@ func resourceMackerelDashboard() *schema.Resource {
236242
"metric": {
237243
Type: schema.TypeList,
238244
Required: true,
245+
MaxItems: 1,
239246
Elem: dashboardMetricResource,
240247
},
241248
"fraction_size": {
@@ -249,6 +256,7 @@ func resourceMackerelDashboard() *schema.Resource {
249256
"layout": {
250257
Type: schema.TypeList,
251258
Required: true,
259+
MaxItems: 1,
252260
Elem: dashboardLayoutResource,
253261
},
254262
},
@@ -270,6 +278,7 @@ func resourceMackerelDashboard() *schema.Resource {
270278
"layout": {
271279
Type: schema.TypeList,
272280
Required: true,
281+
MaxItems: 1,
273282
Elem: dashboardLayoutResource,
274283
},
275284
},
@@ -291,6 +300,7 @@ func resourceMackerelDashboard() *schema.Resource {
291300
"layout": {
292301
Type: schema.TypeList,
293302
Required: true,
303+
MaxItems: 1,
294304
Elem: dashboardLayoutResource,
295305
},
296306
},

0 commit comments

Comments
 (0)