@@ -129,6 +129,68 @@ func TestFlattenDeploymentResource(t *testing.T) {
129
129
deplDisableScheduledRootPasswordRotationFieldName : true ,
130
130
deplLockedFieldName : false ,
131
131
deplDeploymentProfileIDFieldName : deploymentProfileTestID ,
132
+ deplIsPlatformAuthEnabled : false ,
133
+ }
134
+ assert .Equal (t , expected , flattened )
135
+ }
136
+
137
+ // TestFlattenDeploymentResourcePlatformAuthentication tests the Oasis Deployment flattening with PlatformAuthentication set to true.
138
+ func TestFlattenDeploymentResourcePlatformAuthentication (t * testing.T ) {
139
+ depl := & data.Deployment {
140
+ Name : "test-name" ,
141
+ Description : "test-desc" ,
142
+ ProjectId : "123456789" ,
143
+ RegionId : "gcp-europe-west4" ,
144
+ Version : "3.9.1" ,
145
+ Certificates : & data.Deployment_CertificateSpec {
146
+ CaCertificateId : "certificate-id" ,
147
+ },
148
+ IpallowlistId : "ip-allowlist" ,
149
+ DisableFoxxAuthentication : true ,
150
+ Model : & data.Deployment_ModelSpec {
151
+ Model : "oneshard" ,
152
+ NodeSizeId : "a8" ,
153
+ NodeCount : 3 ,
154
+ NodeDiskSize : 32 ,
155
+ },
156
+ IsScheduledRootPasswordRotationEnabled : true ,
157
+ Locked : true ,
158
+ IsPlatformAuthenticationEnabled : true ,
159
+ }
160
+ flattened := flattenDeployment (depl )
161
+ expected := map [string ]interface {}{
162
+ deplProjectFieldName : "123456789" ,
163
+ deplNameFieldName : "test-name" ,
164
+ deplDescriptionFieldName : "test-desc" ,
165
+ deplLocationFieldName : []interface {}{
166
+ map [string ]interface {}{
167
+ deplLocationRegionFieldName : "gcp-europe-west4" ,
168
+ },
169
+ },
170
+ deplVersionFieldName : []interface {}{
171
+ map [string ]interface {}{
172
+ deplVersionDbVersionFieldName : "3.9.1" ,
173
+ },
174
+ },
175
+ deplSecurityFieldName : []interface {}{
176
+ map [string ]interface {}{
177
+ deplSecurityCaCertificateFieldName : "certificate-id" ,
178
+ deplSecurityIpAllowlistFieldName : "ip-allowlist" ,
179
+ deplSecurityDisableFoxxAuthenticationFieldName : true ,
180
+ },
181
+ },
182
+ deplConfigurationFieldName : []interface {}{
183
+ map [string ]interface {}{
184
+ deplConfigurationModelFieldName : "oneshard" ,
185
+ deplConfigurationNodeSizeIdFieldName : "a8" ,
186
+ deplConfigurationNodeCountFieldName : 3 ,
187
+ deplConfigurationNodeDiskSizeFieldName : 32 ,
188
+ },
189
+ },
190
+ deplDiskPerformanceFieldName : "" , // Not set
191
+ deplDisableScheduledRootPasswordRotationFieldName : false ,
192
+ deplLockedFieldName : true ,
193
+ deplIsPlatformAuthEnabled : true ,
132
194
}
133
195
assert .Equal (t , expected , flattened )
134
196
}
@@ -188,6 +250,7 @@ func TestFlattenDeploymentResourceDisableFoxxAuth(t *testing.T) {
188
250
deplDiskPerformanceFieldName : "" , // Not set
189
251
deplDisableScheduledRootPasswordRotationFieldName : false ,
190
252
deplLockedFieldName : true ,
253
+ deplIsPlatformAuthEnabled : false ,
191
254
}
192
255
assert .Equal (t , expected , flattened )
193
256
}
@@ -255,6 +318,7 @@ func TestFlattenDeploymentResourceNotificationSettings(t *testing.T) {
255
318
deplDiskPerformanceFieldName : "" ,
256
319
deplDisableScheduledRootPasswordRotationFieldName : true ,
257
320
deplLockedFieldName : true ,
321
+ deplIsPlatformAuthEnabled : false ,
258
322
}
259
323
assert .Equal (t , expected , flattened )
260
324
}
@@ -381,7 +445,8 @@ func TestExpandingDeploymentResourceDisableFoxxAuth(t *testing.T) {
381
445
},
382
446
},
383
447
deplDisableScheduledRootPasswordRotationFieldName : false ,
384
- deplLockedFieldName : true ,
448
+ deplLockedFieldName : true ,
449
+ deplIsPlatformAuthEnabled : false ,
385
450
}
386
451
s := resourceDeployment ().Schema
387
452
resourceData := schema .TestResourceDataRaw (t , s , raw )
@@ -440,7 +505,8 @@ func TestExpandDeploymentOverrideProjectID(t *testing.T) {
440
505
},
441
506
},
442
507
deplDisableScheduledRootPasswordRotationFieldName : true ,
443
- deplLockedFieldName : true ,
508
+ deplLockedFieldName : true ,
509
+ deplIsPlatformAuthEnabled : false ,
444
510
}
445
511
s := resourceDeployment ().Schema
446
512
resourceData := schema .TestResourceDataRaw (t , s , raw )
0 commit comments