@@ -520,6 +520,25 @@ Format: projects/{project}/locations/{location}/instances/{instance}`,
520
520
},
521
521
},
522
522
},
523
+ "psc_attachment_details" : {
524
+ Type : schema .TypeList ,
525
+ Computed : true ,
526
+ Description : `Configuration of a service attachment of the cluster, for creating PSC connections.` ,
527
+ Elem : & schema.Resource {
528
+ Schema : map [string ]* schema.Schema {
529
+ "connection_type" : {
530
+ Type : schema .TypeString ,
531
+ Computed : true ,
532
+ Description : `Service attachment URI which your self-created PscConnection should use as target.` ,
533
+ },
534
+ "service_attachment" : {
535
+ Type : schema .TypeString ,
536
+ Computed : true ,
537
+ Description : `Service attachment URI which your self-created PscConnection should use as target.` ,
538
+ },
539
+ },
540
+ },
541
+ },
523
542
"psc_auto_connections" : {
524
543
Type : schema .TypeList ,
525
544
Computed : true ,
@@ -607,6 +626,16 @@ DELETING`,
607
626
Description : `Represents information about instance with state UPDATING.` ,
608
627
Elem : & schema.Resource {
609
628
Schema : map [string ]* schema.Schema {
629
+ "target_engine_version" : {
630
+ Type : schema .TypeString ,
631
+ Computed : true ,
632
+ Description : `Output only. Target engine version for the instance.` ,
633
+ },
634
+ "target_node_type" : {
635
+ Type : schema .TypeString ,
636
+ Computed : true ,
637
+ Description : `Output only. Target node type for the instance.` ,
638
+ },
610
639
"target_replica_count" : {
611
640
Type : schema .TypeInt ,
612
641
Computed : true ,
@@ -642,9 +671,9 @@ DELETING`,
642
671
},
643
672
"desired_psc_auto_connections" : {
644
673
Type : schema .TypeList ,
645
- Required : true ,
674
+ Optional : true ,
646
675
ForceNew : true ,
647
- Description : `Required. Immutable. User inputs for the auto-created PSC connections.` ,
676
+ Description : `Immutable. User inputs for the auto-created PSC connections.` ,
648
677
Elem : & schema.Resource {
649
678
Schema : map [string ]* schema.Schema {
650
679
"network" : {
@@ -966,6 +995,9 @@ func resourceMemorystoreInstanceRead(d *schema.ResourceData, meta interface{}) e
966
995
if err := d .Set ("mode" , flattenMemorystoreInstanceMode (res ["mode" ], d , config )); err != nil {
967
996
return fmt .Errorf ("Error reading Instance: %s" , err )
968
997
}
998
+ if err := d .Set ("psc_attachment_details" , flattenMemorystoreInstancePscAttachmentDetails (res ["pscAttachmentDetails" ], d , config )); err != nil {
999
+ return fmt .Errorf ("Error reading Instance: %s" , err )
1000
+ }
969
1001
if err := d .Set ("psc_auto_connections" , flattenMemorystoreInstancePscAutoConnections (res ["pscAutoConnections" ], d , config )); err != nil {
970
1002
return fmt .Errorf ("Error reading Instance: %s" , err )
971
1003
}
@@ -1277,6 +1309,10 @@ func flattenMemorystoreInstanceStateInfoUpdateInfo(v interface{}, d *schema.Reso
1277
1309
flattenMemorystoreInstanceStateInfoUpdateInfoTargetShardCount (original ["targetShardCount" ], d , config )
1278
1310
transformed ["target_replica_count" ] =
1279
1311
flattenMemorystoreInstanceStateInfoUpdateInfoTargetReplicaCount (original ["targetReplicaCount" ], d , config )
1312
+ transformed ["target_engine_version" ] =
1313
+ flattenMemorystoreInstanceStateInfoUpdateInfoTargetEngineVersion (original ["targetEngineVersion" ], d , config )
1314
+ transformed ["target_node_type" ] =
1315
+ flattenMemorystoreInstanceStateInfoUpdateInfoTargetNodeType (original ["targetNodeType" ], d , config )
1280
1316
return []interface {}{transformed }
1281
1317
}
1282
1318
func flattenMemorystoreInstanceStateInfoUpdateInfoTargetShardCount (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
@@ -1313,6 +1349,14 @@ func flattenMemorystoreInstanceStateInfoUpdateInfoTargetReplicaCount(v interface
1313
1349
return v // let terraform core handle it otherwise
1314
1350
}
1315
1351
1352
+ func flattenMemorystoreInstanceStateInfoUpdateInfoTargetEngineVersion (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1353
+ return v
1354
+ }
1355
+
1356
+ func flattenMemorystoreInstanceStateInfoUpdateInfoTargetNodeType (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1357
+ return v
1358
+ }
1359
+
1316
1360
func flattenMemorystoreInstanceUid (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1317
1361
return v
1318
1362
}
@@ -1799,6 +1843,33 @@ func flattenMemorystoreInstanceMode(v interface{}, d *schema.ResourceData, confi
1799
1843
return v
1800
1844
}
1801
1845
1846
+ func flattenMemorystoreInstancePscAttachmentDetails (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1847
+ if v == nil {
1848
+ return v
1849
+ }
1850
+ l := v .([]interface {})
1851
+ transformed := make ([]interface {}, 0 , len (l ))
1852
+ for _ , raw := range l {
1853
+ original := raw .(map [string ]interface {})
1854
+ if len (original ) < 1 {
1855
+ // Do not include empty json objects coming back from the api
1856
+ continue
1857
+ }
1858
+ transformed = append (transformed , map [string ]interface {}{
1859
+ "service_attachment" : flattenMemorystoreInstancePscAttachmentDetailsServiceAttachment (original ["serviceAttachment" ], d , config ),
1860
+ "connection_type" : flattenMemorystoreInstancePscAttachmentDetailsConnectionType (original ["connectionType" ], d , config ),
1861
+ })
1862
+ }
1863
+ return transformed
1864
+ }
1865
+ func flattenMemorystoreInstancePscAttachmentDetailsServiceAttachment (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1866
+ return v
1867
+ }
1868
+
1869
+ func flattenMemorystoreInstancePscAttachmentDetailsConnectionType (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1870
+ return v
1871
+ }
1872
+
1802
1873
func flattenMemorystoreInstancePscAutoConnections (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1803
1874
if v == nil {
1804
1875
return v
@@ -2258,7 +2329,7 @@ func resourceMemorystoreInstanceDecoder(d *schema.ResourceData, meta interface{}
2258
2329
if _ , endpointsFound := res ["endpoints" ]; endpointsFound {
2259
2330
return res , nil // For Cluster Disabled instances, we would have 'endpoints' instead of 'pscAutoConnections'
2260
2331
}
2261
- return nil , fmt . Errorf ( "pscAutoConnections field not found in API response" )
2332
+ return res , nil
2262
2333
}
2263
2334
2264
2335
connections , ok := v .([]interface {})
0 commit comments