Skip to content

Commit 87204bf

Browse files
modular-magiciandanawillow
authored andcommitted
Sort optional properties by name (#2091)
<!-- This change is generated by MagicModules. --> /cc @danawillow
1 parent 72b759d commit 87204bf

15 files changed

+241
-241
lines changed

google/resource_binaryauthorization_policy.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ func resourceBinaryAuthorizationPolicy() *schema.Resource {
8181
},
8282
},
8383
},
84-
"description": {
85-
Type: schema.TypeString,
86-
Optional: true,
87-
},
8884
"admission_whitelist_patterns": {
8985
Type: schema.TypeList,
9086
Optional: true,
@@ -106,6 +102,11 @@ func resourceBinaryAuthorizationPolicy() *schema.Resource {
106102
Type: schema.TypeString,
107103
Required: true,
108104
},
105+
"enforcement_mode": {
106+
Type: schema.TypeString,
107+
Optional: true,
108+
ValidateFunc: validation.StringInSlice([]string{"ENFORCED_BLOCK_AND_AUDIT_LOG", "DRYRUN_AUDIT_LOG_ONLY", ""}, false),
109+
},
109110
"evaluation_mode": {
110111
Type: schema.TypeString,
111112
Optional: true,
@@ -120,11 +121,6 @@ func resourceBinaryAuthorizationPolicy() *schema.Resource {
120121
},
121122
Set: selfLinkNameHash,
122123
},
123-
"enforcement_mode": {
124-
Type: schema.TypeString,
125-
Optional: true,
126-
ValidateFunc: validation.StringInSlice([]string{"ENFORCED_BLOCK_AND_AUDIT_LOG", "DRYRUN_AUDIT_LOG_ONLY", ""}, false),
127-
},
128124
},
129125
},
130126
Set: func(v interface{}) int {
@@ -144,6 +140,10 @@ func resourceBinaryAuthorizationPolicy() *schema.Resource {
144140
return hashcode.String(buf.String())
145141
},
146142
},
143+
"description": {
144+
Type: schema.TypeString,
145+
Optional: true,
146+
},
147147
"project": {
148148
Type: schema.TypeString,
149149
Optional: true,

google/resource_compute_address.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -67,26 +67,26 @@ func resourceComputeAddress() *schema.Resource {
6767
Optional: true,
6868
ForceNew: true,
6969
},
70+
"labels": {
71+
Type: schema.TypeMap,
72+
Optional: true,
73+
Elem: &schema.Schema{Type: schema.TypeString},
74+
},
7075
"network_tier": {
7176
Type: schema.TypeString,
7277
Computed: true,
7378
Optional: true,
7479
ForceNew: true,
7580
ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD", ""}, false),
7681
},
77-
"subnetwork": {
82+
"region": {
7883
Type: schema.TypeString,
7984
Computed: true,
8085
Optional: true,
8186
ForceNew: true,
8287
DiffSuppressFunc: compareSelfLinkOrResourceName,
8388
},
84-
"labels": {
85-
Type: schema.TypeMap,
86-
Optional: true,
87-
Elem: &schema.Schema{Type: schema.TypeString},
88-
},
89-
"region": {
89+
"subnetwork": {
9090
Type: schema.TypeString,
9191
Computed: true,
9292
Optional: true,

google/resource_compute_autoscaler.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -77,37 +77,37 @@ func resourceComputeAutoscaler() *schema.Resource {
7777
},
7878
},
7979
},
80-
"metric": {
80+
"load_balancing_utilization": {
8181
Type: schema.TypeList,
8282
Optional: true,
83+
MaxItems: 1,
8384
Elem: &schema.Resource{
8485
Schema: map[string]*schema.Schema{
85-
"name": {
86-
Type: schema.TypeString,
87-
Required: true,
88-
},
8986
"target": {
9087
Type: schema.TypeFloat,
9188
Required: true,
9289
},
93-
"type": {
94-
Type: schema.TypeString,
95-
Required: true,
96-
ValidateFunc: validation.StringInSlice([]string{"GAUGE", "DELTA_PER_SECOND", "DELTA_PER_MINUTE"}, false),
97-
},
9890
},
9991
},
10092
},
101-
"load_balancing_utilization": {
93+
"metric": {
10294
Type: schema.TypeList,
10395
Optional: true,
104-
MaxItems: 1,
10596
Elem: &schema.Resource{
10697
Schema: map[string]*schema.Schema{
98+
"name": {
99+
Type: schema.TypeString,
100+
Required: true,
101+
},
107102
"target": {
108103
Type: schema.TypeFloat,
109104
Required: true,
110105
},
106+
"type": {
107+
Type: schema.TypeString,
108+
Required: true,
109+
ValidateFunc: validation.StringInSlice([]string{"GAUGE", "DELTA_PER_SECOND", "DELTA_PER_MINUTE"}, false),
110+
},
111111
},
112112
},
113113
},

google/resource_compute_disk.go

+40-40
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,32 @@ func resourceComputeDisk() *schema.Resource {
282282
Optional: true,
283283
ForceNew: true,
284284
},
285+
"disk_encryption_key": {
286+
Type: schema.TypeList,
287+
Optional: true,
288+
ForceNew: true,
289+
DiffSuppressFunc: diskEncryptionKeyDiffSuppress,
290+
MaxItems: 1,
291+
Elem: &schema.Resource{
292+
Schema: map[string]*schema.Schema{
293+
"raw_key": {
294+
Type: schema.TypeString,
295+
Optional: true,
296+
ForceNew: true,
297+
},
298+
"sha256": {
299+
Type: schema.TypeString,
300+
Computed: true,
301+
},
302+
},
303+
},
304+
},
305+
"image": {
306+
Type: schema.TypeString,
307+
Optional: true,
308+
ForceNew: true,
309+
DiffSuppressFunc: diskImageDiffSuppress,
310+
},
285311
"labels": {
286312
Type: schema.TypeMap,
287313
Optional: true,
@@ -292,22 +318,8 @@ func resourceComputeDisk() *schema.Resource {
292318
Computed: true,
293319
Optional: true,
294320
},
295-
"type": {
296-
Type: schema.TypeString,
297-
Optional: true,
298-
ForceNew: true,
299-
DiffSuppressFunc: compareSelfLinkOrResourceName,
300-
Default: "pd-standard",
301-
},
302-
"image": {
303-
Type: schema.TypeString,
304-
Optional: true,
305-
ForceNew: true,
306-
DiffSuppressFunc: diskImageDiffSuppress,
307-
},
308-
"zone": {
321+
"snapshot": {
309322
Type: schema.TypeString,
310-
Computed: true,
311323
Optional: true,
312324
ForceNew: true,
313325
DiffSuppressFunc: compareSelfLinkOrResourceName,
@@ -331,12 +343,11 @@ func resourceComputeDisk() *schema.Resource {
331343
},
332344
},
333345
},
334-
"disk_encryption_key": {
335-
Type: schema.TypeList,
336-
Optional: true,
337-
ForceNew: true,
338-
DiffSuppressFunc: diskEncryptionKeyDiffSuppress,
339-
MaxItems: 1,
346+
"source_snapshot_encryption_key": {
347+
Type: schema.TypeList,
348+
Optional: true,
349+
ForceNew: true,
350+
MaxItems: 1,
340351
Elem: &schema.Resource{
341352
Schema: map[string]*schema.Schema{
342353
"raw_key": {
@@ -351,30 +362,19 @@ func resourceComputeDisk() *schema.Resource {
351362
},
352363
},
353364
},
354-
"snapshot": {
365+
"type": {
355366
Type: schema.TypeString,
356367
Optional: true,
357368
ForceNew: true,
358369
DiffSuppressFunc: compareSelfLinkOrResourceName,
370+
Default: "pd-standard",
359371
},
360-
"source_snapshot_encryption_key": {
361-
Type: schema.TypeList,
362-
Optional: true,
363-
ForceNew: true,
364-
MaxItems: 1,
365-
Elem: &schema.Resource{
366-
Schema: map[string]*schema.Schema{
367-
"raw_key": {
368-
Type: schema.TypeString,
369-
Optional: true,
370-
ForceNew: true,
371-
},
372-
"sha256": {
373-
Type: schema.TypeString,
374-
Computed: true,
375-
},
376-
},
377-
},
372+
"zone": {
373+
Type: schema.TypeString,
374+
Computed: true,
375+
Optional: true,
376+
ForceNew: true,
377+
DiffSuppressFunc: compareSelfLinkOrResourceName,
378378
},
379379
"creation_timestamp": {
380380
Type: schema.TypeString,

google/resource_compute_forwarding_rule.go

+24-24
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ func resourceComputeForwardingRule() *schema.Resource {
4949
Required: true,
5050
ForceNew: true,
5151
},
52-
"description": {
53-
Type: schema.TypeString,
54-
Optional: true,
55-
ForceNew: true,
56-
},
5752
"ip_address": {
5853
Type: schema.TypeString,
5954
Computed: true,
@@ -74,12 +69,22 @@ func resourceComputeForwardingRule() *schema.Resource {
7469
ForceNew: true,
7570
DiffSuppressFunc: compareSelfLinkOrResourceName,
7671
},
72+
"description": {
73+
Type: schema.TypeString,
74+
Optional: true,
75+
ForceNew: true,
76+
},
7777
"ip_version": {
7878
Type: schema.TypeString,
7979
Optional: true,
8080
ForceNew: true,
8181
ValidateFunc: validation.StringInSlice([]string{"IPV4", "IPV6", ""}, false),
8282
},
83+
"labels": {
84+
Type: schema.TypeMap,
85+
Optional: true,
86+
Elem: &schema.Schema{Type: schema.TypeString},
87+
},
8388
"load_balancing_scheme": {
8489
Type: schema.TypeString,
8590
Optional: true,
@@ -94,6 +99,13 @@ func resourceComputeForwardingRule() *schema.Resource {
9499
ForceNew: true,
95100
DiffSuppressFunc: compareSelfLinkOrResourceName,
96101
},
102+
"network_tier": {
103+
Type: schema.TypeString,
104+
Computed: true,
105+
Optional: true,
106+
ForceNew: true,
107+
ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD", ""}, false),
108+
},
97109
"port_range": {
98110
Type: schema.TypeString,
99111
Optional: true,
@@ -110,43 +122,31 @@ func resourceComputeForwardingRule() *schema.Resource {
110122
},
111123
Set: schema.HashString,
112124
},
113-
"subnetwork": {
125+
"region": {
114126
Type: schema.TypeString,
115127
Computed: true,
116128
Optional: true,
117129
ForceNew: true,
118130
DiffSuppressFunc: compareSelfLinkOrResourceName,
119131
},
120-
"target": {
121-
Type: schema.TypeString,
122-
Optional: true,
123-
DiffSuppressFunc: compareSelfLinkRelativePaths,
124-
},
125-
"labels": {
126-
Type: schema.TypeMap,
127-
Optional: true,
128-
Elem: &schema.Schema{Type: schema.TypeString},
129-
},
130-
"network_tier": {
131-
Type: schema.TypeString,
132-
Computed: true,
133-
Optional: true,
134-
ForceNew: true,
135-
ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD", ""}, false),
136-
},
137132
"service_label": {
138133
Type: schema.TypeString,
139134
Optional: true,
140135
ForceNew: true,
141136
ValidateFunc: validateGCPName,
142137
},
143-
"region": {
138+
"subnetwork": {
144139
Type: schema.TypeString,
145140
Computed: true,
146141
Optional: true,
147142
ForceNew: true,
148143
DiffSuppressFunc: compareSelfLinkOrResourceName,
149144
},
145+
"target": {
146+
Type: schema.TypeString,
147+
Optional: true,
148+
DiffSuppressFunc: compareSelfLinkRelativePaths,
149+
},
150150
"creation_timestamp": {
151151
Type: schema.TypeString,
152152
Computed: true,

google/resource_compute_global_address.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ func resourceComputeGlobalAddress() *schema.Resource {
5353
Optional: true,
5454
ForceNew: true,
5555
},
56-
"labels": {
57-
Type: schema.TypeMap,
58-
Optional: true,
59-
Elem: &schema.Schema{Type: schema.TypeString},
60-
},
6156
"ip_version": {
6257
Type: schema.TypeString,
6358
Optional: true,
6459
ForceNew: true,
6560
ValidateFunc: validation.StringInSlice([]string{"IPV4", "IPV6", ""}, false),
6661
DiffSuppressFunc: emptyOrDefaultStringSuppress("IPV4"),
6762
},
63+
"labels": {
64+
Type: schema.TypeMap,
65+
Optional: true,
66+
Elem: &schema.Schema{Type: schema.TypeString},
67+
},
6868
"address": {
6969
Type: schema.TypeString,
7070
Computed: true,

0 commit comments

Comments
 (0)