@@ -118,6 +118,18 @@ attachment.`,
118
118
Optional : true ,
119
119
Description : `An optional description of this resource.` ,
120
120
},
121
+ "domain_names" : {
122
+ Type : schema .TypeList ,
123
+ Optional : true ,
124
+ ForceNew : true ,
125
+ Description : `If specified, the domain name will be used during the integration between
126
+ the PSC connected endpoints and the Cloud DNS. For example, this is a
127
+ valid domain name: "p.mycompany.com.". Current max number of domain names
128
+ supported is 1.` ,
129
+ Elem : & schema.Schema {
130
+ Type : schema .TypeString ,
131
+ },
132
+ },
121
133
"region" : {
122
134
Type : schema .TypeString ,
123
135
Computed : true ,
@@ -218,6 +230,12 @@ func resourceComputeServiceAttachmentCreate(d *schema.ResourceData, meta interfa
218
230
} else if v , ok := d .GetOkExists ("enable_proxy_protocol" ); ! isEmptyValue (reflect .ValueOf (enableProxyProtocolProp )) && (ok || ! reflect .DeepEqual (v , enableProxyProtocolProp )) {
219
231
obj ["enableProxyProtocol" ] = enableProxyProtocolProp
220
232
}
233
+ domainNamesProp , err := expandComputeServiceAttachmentDomainNames (d .Get ("domain_names" ), d , config )
234
+ if err != nil {
235
+ return err
236
+ } else if v , ok := d .GetOkExists ("domain_names" ); ! isEmptyValue (reflect .ValueOf (domainNamesProp )) && (ok || ! reflect .DeepEqual (v , domainNamesProp )) {
237
+ obj ["domainNames" ] = domainNamesProp
238
+ }
221
239
consumerRejectListsProp , err := expandComputeServiceAttachmentConsumerRejectLists (d .Get ("consumer_reject_lists" ), d , config )
222
240
if err != nil {
223
241
return err
@@ -341,6 +359,9 @@ func resourceComputeServiceAttachmentRead(d *schema.ResourceData, meta interface
341
359
if err := d .Set ("enable_proxy_protocol" , flattenComputeServiceAttachmentEnableProxyProtocol (res ["enableProxyProtocol" ], d , config )); err != nil {
342
360
return fmt .Errorf ("Error reading ServiceAttachment: %s" , err )
343
361
}
362
+ if err := d .Set ("domain_names" , flattenComputeServiceAttachmentDomainNames (res ["domainNames" ], d , config )); err != nil {
363
+ return fmt .Errorf ("Error reading ServiceAttachment: %s" , err )
364
+ }
344
365
if err := d .Set ("consumer_reject_lists" , flattenComputeServiceAttachmentConsumerRejectLists (res ["consumerRejectLists" ], d , config )); err != nil {
345
366
return fmt .Errorf ("Error reading ServiceAttachment: %s" , err )
346
367
}
@@ -573,6 +594,10 @@ func flattenComputeServiceAttachmentEnableProxyProtocol(v interface{}, d *schema
573
594
return v
574
595
}
575
596
597
+ func flattenComputeServiceAttachmentDomainNames (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
598
+ return v
599
+ }
600
+
576
601
func flattenComputeServiceAttachmentConsumerRejectLists (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
577
602
return v
578
603
}
@@ -668,6 +693,10 @@ func expandComputeServiceAttachmentEnableProxyProtocol(v interface{}, d Terrafor
668
693
return v , nil
669
694
}
670
695
696
+ func expandComputeServiceAttachmentDomainNames (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
697
+ return v , nil
698
+ }
699
+
671
700
func expandComputeServiceAttachmentConsumerRejectLists (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
672
701
return v , nil
673
702
}
0 commit comments