@@ -77,6 +77,18 @@ resource "google_container_cluster" "example" {
77
77
enable_autopilot = true
78
78
79
79
datapath_provider = "ADVANCED_DATAPATH"
80
+
81
+ cluster_autoscaling {
82
+ enabled = true
83
+ auto_provisioning_defaults {
84
+ service_account = "test"
85
+ image_type = "COS_CONTAINERD"
86
+ management {
87
+ auto_repair = true
88
+ auto_upgrade = true
89
+ }
90
+ }
91
+ }
80
92
}
81
93
82
94
resource "google_container_node_pool" "primary_preemptible_nodes" {
@@ -102,9 +114,7 @@ resource "google_container_node_pool" "primary_preemptible_nodes" {
102
114
expected : gke.GKE {
103
115
Clusters : []gke.Cluster {
104
116
{
105
- Metadata : iacTypes .NewTestMetadata (),
106
117
NodeConfig : gke.NodeConfig {
107
- Metadata : iacTypes .NewTestMetadata (),
108
118
ImageType : iacTypes .String ("COS_CONTAINERD" , iacTypes .NewTestMetadata ()),
109
119
WorkloadMetadataConfig : gke.WorkloadMetadataConfig {
110
120
Metadata : iacTypes .NewTestMetadata (),
@@ -113,9 +123,19 @@ resource "google_container_node_pool" "primary_preemptible_nodes" {
113
123
ServiceAccount : iacTypes .String ("" , iacTypes .NewTestMetadata ()),
114
124
EnableLegacyEndpoints : iacTypes .Bool (false , iacTypes .NewTestMetadata ()),
115
125
},
126
+ AutoScaling : gke.AutoScaling {
127
+ Enabled : iacTypes .BoolTest (true ),
128
+ AutoProvisioningDefaults : gke.AutoProvisioningDefaults {
129
+ ImageType : iacTypes .StringTest ("COS_CONTAINERD" ),
130
+ ServiceAccount : iacTypes .StringTest ("test" ),
131
+ Management : gke.Management {
132
+ EnableAutoRepair : iacTypes .BoolTest (true ),
133
+ EnableAutoUpgrade : iacTypes .BoolTest (true ),
134
+ },
135
+ },
136
+ },
116
137
NodePools : []gke.NodePool {
117
138
{
118
- Metadata : iacTypes .NewTestMetadata (),
119
139
Management : gke.Management {
120
140
Metadata : iacTypes .NewTestMetadata (),
121
141
EnableAutoRepair : iacTypes .Bool (true , iacTypes .NewTestMetadata ()),
@@ -134,19 +154,16 @@ resource "google_container_node_pool" "primary_preemptible_nodes" {
134
154
},
135
155
},
136
156
IPAllocationPolicy : gke.IPAllocationPolicy {
137
- Metadata : iacTypes .NewTestMetadata (),
138
- Enabled : iacTypes .Bool (true , iacTypes .NewTestMetadata ()),
157
+ Enabled : iacTypes .Bool (true , iacTypes .NewTestMetadata ()),
139
158
},
140
159
MasterAuthorizedNetworks : gke.MasterAuthorizedNetworks {
141
- Metadata : iacTypes .NewTestMetadata (),
142
- Enabled : iacTypes .Bool (true , iacTypes .NewTestMetadata ()),
160
+ Enabled : iacTypes .Bool (true , iacTypes .NewTestMetadata ()),
143
161
CIDRs : []iacTypes.StringValue {
144
162
iacTypes .String ("10.10.128.0/24" , iacTypes .NewTestMetadata ()),
145
163
},
146
164
},
147
165
NetworkPolicy : gke.NetworkPolicy {
148
- Metadata : iacTypes .NewTestMetadata (),
149
- Enabled : iacTypes .Bool (true , iacTypes .NewTestMetadata ()),
166
+ Enabled : iacTypes .Bool (true , iacTypes .NewTestMetadata ()),
150
167
},
151
168
DatapathProvider : iacTypes .String ("ADVANCED_DATAPATH" , iacTypes .NewTestMetadata ()),
152
169
PrivateCluster : gke.PrivateCluster {
@@ -156,7 +173,6 @@ resource "google_container_node_pool" "primary_preemptible_nodes" {
156
173
LoggingService : iacTypes .String ("logging.googleapis.com/kubernetes" , iacTypes .NewTestMetadata ()),
157
174
MonitoringService : iacTypes .String ("monitoring.googleapis.com/kubernetes" , iacTypes .NewTestMetadata ()),
158
175
MasterAuth : gke.MasterAuth {
159
- Metadata : iacTypes .NewTestMetadata (),
160
176
ClientCertificate : gke.ClientCertificate {
161
177
Metadata : iacTypes .NewTestMetadata (),
162
178
IssueCertificate : iacTypes .Bool (true , iacTypes .NewTestMetadata ()),
@@ -182,7 +198,7 @@ resource "google_container_cluster" "example" {
182
198
node_config {
183
199
service_account = "service-account"
184
200
metadata = {
185
- disable-legacy-endpoints = true
201
+ disable-legacy-endpoints = " true"
186
202
}
187
203
image_type = "COS"
188
204
workload_metadata_config {
@@ -194,7 +210,6 @@ resource "google_container_cluster" "example" {
194
210
expected : gke.GKE {
195
211
Clusters : []gke.Cluster {
196
212
{
197
- Metadata : iacTypes .NewTestMetadata (),
198
213
NodeConfig : gke.NodeConfig {
199
214
Metadata : iacTypes .NewTestMetadata (),
200
215
ImageType : iacTypes .String ("COS" , iacTypes .NewTestMetadata ()),
@@ -207,17 +222,14 @@ resource "google_container_cluster" "example" {
207
222
},
208
223
209
224
IPAllocationPolicy : gke.IPAllocationPolicy {
210
- Metadata : iacTypes .NewTestMetadata (),
211
- Enabled : iacTypes .Bool (false , iacTypes .NewTestMetadata ()),
225
+ Enabled : iacTypes .Bool (false , iacTypes .NewTestMetadata ()),
212
226
},
213
227
MasterAuthorizedNetworks : gke.MasterAuthorizedNetworks {
214
- Metadata : iacTypes .NewTestMetadata (),
215
- Enabled : iacTypes .Bool (false , iacTypes .NewTestMetadata ()),
216
- CIDRs : []iacTypes.StringValue {},
228
+ Enabled : iacTypes .Bool (false , iacTypes .NewTestMetadata ()),
229
+ CIDRs : []iacTypes.StringValue {},
217
230
},
218
231
NetworkPolicy : gke.NetworkPolicy {
219
- Metadata : iacTypes .NewTestMetadata (),
220
- Enabled : iacTypes .Bool (false , iacTypes .NewTestMetadata ()),
232
+ Enabled : iacTypes .Bool (false , iacTypes .NewTestMetadata ()),
221
233
},
222
234
DatapathProvider : iacTypes .StringDefault ("DATAPATH_PROVIDER_UNSPECIFIED" , iacTypes .NewTestMetadata ()),
223
235
PrivateCluster : gke.PrivateCluster {
@@ -227,7 +239,6 @@ resource "google_container_cluster" "example" {
227
239
LoggingService : iacTypes .String ("logging.googleapis.com/kubernetes" , iacTypes .NewTestMetadata ()),
228
240
MonitoringService : iacTypes .String ("monitoring.googleapis.com/kubernetes" , iacTypes .NewTestMetadata ()),
229
241
MasterAuth : gke.MasterAuth {
230
- Metadata : iacTypes .NewTestMetadata (),
231
242
ClientCertificate : gke.ClientCertificate {
232
243
Metadata : iacTypes .NewTestMetadata (),
233
244
IssueCertificate : iacTypes .Bool (false , iacTypes .NewTestMetadata ()),
0 commit comments