@@ -116,6 +116,34 @@ For attachments of type DEDICATED, the user can set the bandwidth.
116
116
For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth.
117
117
Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED,
118
118
Defaults to BPS_10G Possible values: ["BPS_50M", "BPS_100M", "BPS_200M", "BPS_300M", "BPS_400M", "BPS_500M", "BPS_1G", "BPS_2G", "BPS_5G", "BPS_10G", "BPS_20G", "BPS_50G", "BPS_100G"]` ,
119
+ },
120
+ "candidate_cloud_router_ip_address" : {
121
+ Type : schema .TypeString ,
122
+ Optional : true ,
123
+ ForceNew : true ,
124
+ Description : `Single IPv4 address + prefix length to be configured on the cloud router interface for this
125
+ interconnect attachment. Example: 203.0.113.1/29` ,
126
+ },
127
+ "candidate_cloud_router_ipv6_address" : {
128
+ Type : schema .TypeString ,
129
+ Optional : true ,
130
+ ForceNew : true ,
131
+ Description : `Single IPv6 address + prefix length to be configured on the cloud router interface for this
132
+ interconnect attachment. Example: 2001:db8::1/125` ,
133
+ },
134
+ "candidate_customer_router_ip_address" : {
135
+ Type : schema .TypeString ,
136
+ Optional : true ,
137
+ ForceNew : true ,
138
+ Description : `Single IPv4 address + prefix length to be configured on the customer router interface for this
139
+ interconnect attachment. Example: 203.0.113.2/29` ,
140
+ },
141
+ "candidate_customer_router_ipv6_address" : {
142
+ Type : schema .TypeString ,
143
+ Optional : true ,
144
+ ForceNew : true ,
145
+ Description : `Single IPv6 address + prefix length to be configured on the customer router interface for this
146
+ interconnect attachment. Example: 2001:db8::2/125` ,
119
147
},
120
148
"candidate_subnets" : {
121
149
Type : schema .TypeList ,
@@ -474,6 +502,30 @@ func resourceComputeInterconnectAttachmentCreate(d *schema.ResourceData, meta in
474
502
} else if v , ok := d .GetOkExists ("label_fingerprint" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (labelFingerprintProp )) && (ok || ! reflect .DeepEqual (v , labelFingerprintProp )) {
475
503
obj ["labelFingerprint" ] = labelFingerprintProp
476
504
}
505
+ candidateCloudRouterIpAddressProp , err := expandComputeInterconnectAttachmentCandidateCloudRouterIpAddress (d .Get ("candidate_cloud_router_ip_address" ), d , config )
506
+ if err != nil {
507
+ return err
508
+ } else if v , ok := d .GetOkExists ("candidate_cloud_router_ip_address" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (candidateCloudRouterIpAddressProp )) && (ok || ! reflect .DeepEqual (v , candidateCloudRouterIpAddressProp )) {
509
+ obj ["candidateCloudRouterIpAddress" ] = candidateCloudRouterIpAddressProp
510
+ }
511
+ candidateCustomerRouterIpAddressProp , err := expandComputeInterconnectAttachmentCandidateCustomerRouterIpAddress (d .Get ("candidate_customer_router_ip_address" ), d , config )
512
+ if err != nil {
513
+ return err
514
+ } else if v , ok := d .GetOkExists ("candidate_customer_router_ip_address" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (candidateCustomerRouterIpAddressProp )) && (ok || ! reflect .DeepEqual (v , candidateCustomerRouterIpAddressProp )) {
515
+ obj ["candidateCustomerRouterIpAddress" ] = candidateCustomerRouterIpAddressProp
516
+ }
517
+ candidateCloudRouterIpv6AddressProp , err := expandComputeInterconnectAttachmentCandidateCloudRouterIpv6Address (d .Get ("candidate_cloud_router_ipv6_address" ), d , config )
518
+ if err != nil {
519
+ return err
520
+ } else if v , ok := d .GetOkExists ("candidate_cloud_router_ipv6_address" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (candidateCloudRouterIpv6AddressProp )) && (ok || ! reflect .DeepEqual (v , candidateCloudRouterIpv6AddressProp )) {
521
+ obj ["candidateCloudRouterIpv6Address" ] = candidateCloudRouterIpv6AddressProp
522
+ }
523
+ candidateCustomerRouterIpv6AddressProp , err := expandComputeInterconnectAttachmentCandidateCustomerRouterIpv6Address (d .Get ("candidate_customer_router_ipv6_address" ), d , config )
524
+ if err != nil {
525
+ return err
526
+ } else if v , ok := d .GetOkExists ("candidate_customer_router_ipv6_address" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (candidateCustomerRouterIpv6AddressProp )) && (ok || ! reflect .DeepEqual (v , candidateCustomerRouterIpv6AddressProp )) {
527
+ obj ["candidateCustomerRouterIpv6Address" ] = candidateCustomerRouterIpv6AddressProp
528
+ }
477
529
labelsProp , err := expandComputeInterconnectAttachmentEffectiveLabels (d .Get ("effective_labels" ), d , config )
478
530
if err != nil {
479
531
return err
@@ -724,6 +776,18 @@ func resourceComputeInterconnectAttachmentRead(d *schema.ResourceData, meta inte
724
776
if err := d .Set ("label_fingerprint" , flattenComputeInterconnectAttachmentLabelFingerprint (res ["labelFingerprint" ], d , config )); err != nil {
725
777
return fmt .Errorf ("Error reading InterconnectAttachment: %s" , err )
726
778
}
779
+ if err := d .Set ("candidate_cloud_router_ip_address" , flattenComputeInterconnectAttachmentCandidateCloudRouterIpAddress (res ["candidateCloudRouterIpAddress" ], d , config )); err != nil {
780
+ return fmt .Errorf ("Error reading InterconnectAttachment: %s" , err )
781
+ }
782
+ if err := d .Set ("candidate_customer_router_ip_address" , flattenComputeInterconnectAttachmentCandidateCustomerRouterIpAddress (res ["candidateCustomerRouterIpAddress" ], d , config )); err != nil {
783
+ return fmt .Errorf ("Error reading InterconnectAttachment: %s" , err )
784
+ }
785
+ if err := d .Set ("candidate_cloud_router_ipv6_address" , flattenComputeInterconnectAttachmentCandidateCloudRouterIpv6Address (res ["candidateCloudRouterIpv6Address" ], d , config )); err != nil {
786
+ return fmt .Errorf ("Error reading InterconnectAttachment: %s" , err )
787
+ }
788
+ if err := d .Set ("candidate_customer_router_ipv6_address" , flattenComputeInterconnectAttachmentCandidateCustomerRouterIpv6Address (res ["candidateCustomerRouterIpv6Address" ], d , config )); err != nil {
789
+ return fmt .Errorf ("Error reading InterconnectAttachment: %s" , err )
790
+ }
727
791
if err := d .Set ("terraform_labels" , flattenComputeInterconnectAttachmentTerraformLabels (res ["labels" ], d , config )); err != nil {
728
792
return fmt .Errorf ("Error reading InterconnectAttachment: %s" , err )
729
793
}
@@ -1133,6 +1197,22 @@ func flattenComputeInterconnectAttachmentLabelFingerprint(v interface{}, d *sche
1133
1197
return v
1134
1198
}
1135
1199
1200
+ func flattenComputeInterconnectAttachmentCandidateCloudRouterIpAddress (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1201
+ return v
1202
+ }
1203
+
1204
+ func flattenComputeInterconnectAttachmentCandidateCustomerRouterIpAddress (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1205
+ return v
1206
+ }
1207
+
1208
+ func flattenComputeInterconnectAttachmentCandidateCloudRouterIpv6Address (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1209
+ return v
1210
+ }
1211
+
1212
+ func flattenComputeInterconnectAttachmentCandidateCustomerRouterIpv6Address (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1213
+ return v
1214
+ }
1215
+
1136
1216
func flattenComputeInterconnectAttachmentTerraformLabels (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1137
1217
if v == nil {
1138
1218
return v
@@ -1239,6 +1319,22 @@ func expandComputeInterconnectAttachmentLabelFingerprint(v interface{}, d tpgres
1239
1319
return v , nil
1240
1320
}
1241
1321
1322
+ func expandComputeInterconnectAttachmentCandidateCloudRouterIpAddress (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1323
+ return v , nil
1324
+ }
1325
+
1326
+ func expandComputeInterconnectAttachmentCandidateCustomerRouterIpAddress (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1327
+ return v , nil
1328
+ }
1329
+
1330
+ func expandComputeInterconnectAttachmentCandidateCloudRouterIpv6Address (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1331
+ return v , nil
1332
+ }
1333
+
1334
+ func expandComputeInterconnectAttachmentCandidateCustomerRouterIpv6Address (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1335
+ return v , nil
1336
+ }
1337
+
1242
1338
func expandComputeInterconnectAttachmentEffectiveLabels (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (map [string ]string , error ) {
1243
1339
if v == nil {
1244
1340
return map [string ]string {}, nil
0 commit comments