@@ -1204,56 +1204,6 @@ For more information see, [Backend service settings](https://cloud.google.com/co
1204
1204
The default is 30 seconds.
1205
1205
The full range of timeout values allowed goes from 1 through 2,147,483,647 seconds.` ,
1206
1206
},
1207
- "tls_settings" : {
1208
- Type : schema .TypeList ,
1209
- Optional : true ,
1210
- Description : `Configuration for Backend Authenticated TLS and mTLS. May only be specified when the backend protocol is SSL, HTTPS or HTTP2.` ,
1211
- MaxItems : 1 ,
1212
- Elem : & schema.Resource {
1213
- Schema : map [string ]* schema.Schema {
1214
- "authentication_config" : {
1215
- Type : schema .TypeString ,
1216
- Optional : true ,
1217
- Description : `Reference to the BackendAuthenticationConfig resource from the networksecurity.googleapis.com namespace.
1218
- Can be used in authenticating TLS connections to the backend, as specified by the authenticationMode field.
1219
- Can only be specified if authenticationMode is not NONE.` ,
1220
- },
1221
- "sni" : {
1222
- Type : schema .TypeString ,
1223
- Optional : true ,
1224
- Description : `Server Name Indication - see RFC3546 section 3.1. If set, the load balancer sends this string as the SNI hostname in the
1225
- TLS connection to the backend, and requires that this string match a Subject Alternative Name (SAN) in the backend's
1226
- server certificate. With a Regional Internet NEG backend, if the SNI is specified here, the load balancer uses it
1227
- regardless of whether the Regional Internet NEG is specified with FQDN or IP address and port.` ,
1228
- },
1229
- "subject_alt_names" : {
1230
- Type : schema .TypeList ,
1231
- Optional : true ,
1232
- Description : `A list of Subject Alternative Names (SANs) that the Load Balancer verifies during a TLS handshake with the backend.
1233
- When the server presents its X.509 certificate to the Load Balancer, the Load Balancer inspects the certificate's SAN field,
1234
- and requires that at least one SAN match one of the subjectAltNames in the list. This field is limited to 5 entries.
1235
- When both sni and subjectAltNames are specified, the load balancer matches the backend certificate's SAN only to
1236
- subjectAltNames.` ,
1237
- Elem : & schema.Resource {
1238
- Schema : map [string ]* schema.Schema {
1239
- "dns_name" : {
1240
- Type : schema .TypeString ,
1241
- Optional : true ,
1242
- Description : `The SAN specified as a DNS Name.` ,
1243
- ExactlyOneOf : []string {},
1244
- },
1245
- "uniform_resource_identifier" : {
1246
- Type : schema .TypeString ,
1247
- Optional : true ,
1248
- Description : `The SAN specified as a URI.` ,
1249
- ExactlyOneOf : []string {},
1250
- },
1251
- },
1252
- },
1253
- },
1254
- },
1255
- },
1256
- },
1257
1207
"creation_timestamp" : {
1258
1208
Type : schema .TypeString ,
1259
1209
Computed : true ,
@@ -1646,12 +1596,6 @@ func resourceComputeBackendServiceCreate(d *schema.ResourceData, meta interface{
1646
1596
} else if v , ok := d .GetOkExists ("service_lb_policy" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (serviceLbPolicyProp )) && (ok || ! reflect .DeepEqual (v , serviceLbPolicyProp )) {
1647
1597
obj ["serviceLbPolicy" ] = serviceLbPolicyProp
1648
1598
}
1649
- tlsSettingsProp , err := expandComputeBackendServiceTlsSettings (d .Get ("tls_settings" ), d , config )
1650
- if err != nil {
1651
- return err
1652
- } else if v , ok := d .GetOkExists ("tls_settings" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (tlsSettingsProp )) && (ok || ! reflect .DeepEqual (v , tlsSettingsProp )) {
1653
- obj ["tlsSettings" ] = tlsSettingsProp
1654
- }
1655
1599
1656
1600
obj , err = resourceComputeBackendServiceEncoder (d , meta , obj )
1657
1601
if err != nil {
@@ -1918,9 +1862,6 @@ func resourceComputeBackendServiceRead(d *schema.ResourceData, meta interface{})
1918
1862
if err := d .Set ("service_lb_policy" , flattenComputeBackendServiceServiceLbPolicy (res ["serviceLbPolicy" ], d , config )); err != nil {
1919
1863
return fmt .Errorf ("Error reading BackendService: %s" , err )
1920
1864
}
1921
- if err := d .Set ("tls_settings" , flattenComputeBackendServiceTlsSettings (res ["tlsSettings" ], d , config )); err != nil {
1922
- return fmt .Errorf ("Error reading BackendService: %s" , err )
1923
- }
1924
1865
if err := d .Set ("self_link" , tpgresource .ConvertSelfLinkToV1 (res ["selfLink" ].(string ))); err != nil {
1925
1866
return fmt .Errorf ("Error reading BackendService: %s" , err )
1926
1867
}
@@ -2130,12 +2071,6 @@ func resourceComputeBackendServiceUpdate(d *schema.ResourceData, meta interface{
2130
2071
} else if v , ok := d .GetOkExists ("service_lb_policy" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , serviceLbPolicyProp )) {
2131
2072
obj ["serviceLbPolicy" ] = serviceLbPolicyProp
2132
2073
}
2133
- tlsSettingsProp , err := expandComputeBackendServiceTlsSettings (d .Get ("tls_settings" ), d , config )
2134
- if err != nil {
2135
- return err
2136
- } else if v , ok := d .GetOkExists ("tls_settings" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , tlsSettingsProp )) {
2137
- obj ["tlsSettings" ] = tlsSettingsProp
2138
- }
2139
2074
2140
2075
obj , err = resourceComputeBackendServiceEncoder (d , meta , obj )
2141
2076
if err != nil {
@@ -3660,58 +3595,6 @@ func flattenComputeBackendServiceServiceLbPolicy(v interface{}, d *schema.Resour
3660
3595
return v
3661
3596
}
3662
3597
3663
- func flattenComputeBackendServiceTlsSettings (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
3664
- if v == nil {
3665
- return nil
3666
- }
3667
- original := v .(map [string ]interface {})
3668
- if len (original ) == 0 {
3669
- return nil
3670
- }
3671
- transformed := make (map [string ]interface {})
3672
- transformed ["sni" ] =
3673
- flattenComputeBackendServiceTlsSettingsSni (original ["sni" ], d , config )
3674
- transformed ["subject_alt_names" ] =
3675
- flattenComputeBackendServiceTlsSettingsSubjectAltNames (original ["subjectAltNames" ], d , config )
3676
- transformed ["authentication_config" ] =
3677
- flattenComputeBackendServiceTlsSettingsAuthenticationConfig (original ["authenticationConfig" ], d , config )
3678
- return []interface {}{transformed }
3679
- }
3680
- func flattenComputeBackendServiceTlsSettingsSni (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
3681
- return v
3682
- }
3683
-
3684
- func flattenComputeBackendServiceTlsSettingsSubjectAltNames (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
3685
- if v == nil {
3686
- return v
3687
- }
3688
- l := v .([]interface {})
3689
- transformed := make ([]interface {}, 0 , len (l ))
3690
- for _ , raw := range l {
3691
- original := raw .(map [string ]interface {})
3692
- if len (original ) < 1 {
3693
- // Do not include empty json objects coming back from the api
3694
- continue
3695
- }
3696
- transformed = append (transformed , map [string ]interface {}{
3697
- "dns_name" : flattenComputeBackendServiceTlsSettingsSubjectAltNamesDnsName (original ["dnsName" ], d , config ),
3698
- "uniform_resource_identifier" : flattenComputeBackendServiceTlsSettingsSubjectAltNamesUniformResourceIdentifier (original ["uniformResourceIdentifier" ], d , config ),
3699
- })
3700
- }
3701
- return transformed
3702
- }
3703
- func flattenComputeBackendServiceTlsSettingsSubjectAltNamesDnsName (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
3704
- return v
3705
- }
3706
-
3707
- func flattenComputeBackendServiceTlsSettingsSubjectAltNamesUniformResourceIdentifier (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
3708
- return v
3709
- }
3710
-
3711
- func flattenComputeBackendServiceTlsSettingsAuthenticationConfig (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
3712
- return v
3713
- }
3714
-
3715
3598
func expandComputeBackendServiceAffinityCookieTtlSec (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
3716
3599
return v , nil
3717
3600
}
@@ -5024,84 +4907,6 @@ func expandComputeBackendServiceServiceLbPolicy(v interface{}, d tpgresource.Ter
5024
4907
return v , nil
5025
4908
}
5026
4909
5027
- func expandComputeBackendServiceTlsSettings (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
5028
- l := v .([]interface {})
5029
- if len (l ) == 0 || l [0 ] == nil {
5030
- return nil , nil
5031
- }
5032
- raw := l [0 ]
5033
- original := raw .(map [string ]interface {})
5034
- transformed := make (map [string ]interface {})
5035
-
5036
- transformedSni , err := expandComputeBackendServiceTlsSettingsSni (original ["sni" ], d , config )
5037
- if err != nil {
5038
- return nil , err
5039
- } else if val := reflect .ValueOf (transformedSni ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
5040
- transformed ["sni" ] = transformedSni
5041
- }
5042
-
5043
- transformedSubjectAltNames , err := expandComputeBackendServiceTlsSettingsSubjectAltNames (original ["subject_alt_names" ], d , config )
5044
- if err != nil {
5045
- return nil , err
5046
- } else if val := reflect .ValueOf (transformedSubjectAltNames ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
5047
- transformed ["subjectAltNames" ] = transformedSubjectAltNames
5048
- }
5049
-
5050
- transformedAuthenticationConfig , err := expandComputeBackendServiceTlsSettingsAuthenticationConfig (original ["authentication_config" ], d , config )
5051
- if err != nil {
5052
- return nil , err
5053
- } else if val := reflect .ValueOf (transformedAuthenticationConfig ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
5054
- transformed ["authenticationConfig" ] = transformedAuthenticationConfig
5055
- }
5056
-
5057
- return transformed , nil
5058
- }
5059
-
5060
- func expandComputeBackendServiceTlsSettingsSni (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
5061
- return v , nil
5062
- }
5063
-
5064
- func expandComputeBackendServiceTlsSettingsSubjectAltNames (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
5065
- l := v .([]interface {})
5066
- req := make ([]interface {}, 0 , len (l ))
5067
- for _ , raw := range l {
5068
- if raw == nil {
5069
- continue
5070
- }
5071
- original := raw .(map [string ]interface {})
5072
- transformed := make (map [string ]interface {})
5073
-
5074
- transformedDnsName , err := expandComputeBackendServiceTlsSettingsSubjectAltNamesDnsName (original ["dns_name" ], d , config )
5075
- if err != nil {
5076
- return nil , err
5077
- } else if val := reflect .ValueOf (transformedDnsName ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
5078
- transformed ["dnsName" ] = transformedDnsName
5079
- }
5080
-
5081
- transformedUniformResourceIdentifier , err := expandComputeBackendServiceTlsSettingsSubjectAltNamesUniformResourceIdentifier (original ["uniform_resource_identifier" ], d , config )
5082
- if err != nil {
5083
- return nil , err
5084
- } else if val := reflect .ValueOf (transformedUniformResourceIdentifier ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
5085
- transformed ["uniformResourceIdentifier" ] = transformedUniformResourceIdentifier
5086
- }
5087
-
5088
- req = append (req , transformed )
5089
- }
5090
- return req , nil
5091
- }
5092
-
5093
- func expandComputeBackendServiceTlsSettingsSubjectAltNamesDnsName (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
5094
- return v , nil
5095
- }
5096
-
5097
- func expandComputeBackendServiceTlsSettingsSubjectAltNamesUniformResourceIdentifier (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
5098
- return v , nil
5099
- }
5100
-
5101
- func expandComputeBackendServiceTlsSettingsAuthenticationConfig (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
5102
- return v , nil
5103
- }
5104
-
5105
4910
func resourceComputeBackendServiceEncoder (d * schema.ResourceData , meta interface {}, obj map [string ]interface {}) (map [string ]interface {}, error ) {
5106
4911
backendsRaw , ok := obj ["backends" ]
5107
4912
if ! ok {
0 commit comments