@@ -129,6 +129,68 @@ func TestFlattenDeploymentResource(t *testing.T) {
129129 deplDisableScheduledRootPasswordRotationFieldName : true ,
130130 deplLockedFieldName : false ,
131131 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 ,
132194 }
133195 assert .Equal (t , expected , flattened )
134196}
@@ -188,6 +250,7 @@ func TestFlattenDeploymentResourceDisableFoxxAuth(t *testing.T) {
188250 deplDiskPerformanceFieldName : "" , // Not set
189251 deplDisableScheduledRootPasswordRotationFieldName : false ,
190252 deplLockedFieldName : true ,
253+ deplIsPlatformAuthEnabled : false ,
191254 }
192255 assert .Equal (t , expected , flattened )
193256}
@@ -255,6 +318,7 @@ func TestFlattenDeploymentResourceNotificationSettings(t *testing.T) {
255318 deplDiskPerformanceFieldName : "" ,
256319 deplDisableScheduledRootPasswordRotationFieldName : true ,
257320 deplLockedFieldName : true ,
321+ deplIsPlatformAuthEnabled : false ,
258322 }
259323 assert .Equal (t , expected , flattened )
260324}
@@ -381,7 +445,8 @@ func TestExpandingDeploymentResourceDisableFoxxAuth(t *testing.T) {
381445 },
382446 },
383447 deplDisableScheduledRootPasswordRotationFieldName : false ,
384- deplLockedFieldName : true ,
448+ deplLockedFieldName : true ,
449+ deplIsPlatformAuthEnabled : false ,
385450 }
386451 s := resourceDeployment ().Schema
387452 resourceData := schema .TestResourceDataRaw (t , s , raw )
@@ -440,7 +505,8 @@ func TestExpandDeploymentOverrideProjectID(t *testing.T) {
440505 },
441506 },
442507 deplDisableScheduledRootPasswordRotationFieldName : true ,
443- deplLockedFieldName : true ,
508+ deplLockedFieldName : true ,
509+ deplIsPlatformAuthEnabled : false ,
444510 }
445511 s := resourceDeployment ().Schema
446512 resourceData := schema .TestResourceDataRaw (t , s , raw )
0 commit comments