Skip to content

Commit dfdb6df

Browse files
porky256Dawid212
authored andcommitted
Add bac to backend service (GoogleCloudPlatform#13213)
1 parent 75b993b commit dfdb6df

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

mmv1/products/compute/BackendService.yaml

+47
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ examples:
128128
default_neg_name: 'network-endpoint'
129129
health_check_name: 'health-check'
130130
network_name: 'network'
131+
- name: 'backend_service_tls_settings'
132+
primary_resource_id: 'default'
133+
vars:
134+
backend_service_name: 'backend-service'
135+
health_check_name: 'health-check'
136+
authentication_name: 'authentication'
131137
parameters:
132138
properties:
133139
- name: 'affinityCookieTtlSec'
@@ -1467,3 +1473,44 @@ properties:
14671473
description: |
14681474
URL to networkservices.ServiceLbPolicy resource.
14691475
Can only be set if load balancing scheme is EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED or INTERNAL_SELF_MANAGED and the scope is global.
1476+
- name: 'tlsSettings'
1477+
type: NestedObject
1478+
description: |
1479+
Configuration for Backend Authenticated TLS and mTLS. May only be specified when the backend protocol is SSL, HTTPS or HTTP2.
1480+
properties:
1481+
- name: 'sni'
1482+
type: String
1483+
description: |
1484+
Server Name Indication - see RFC3546 section 3.1. If set, the load balancer sends this string as the SNI hostname in the
1485+
TLS connection to the backend, and requires that this string match a Subject Alternative Name (SAN) in the backend's
1486+
server certificate. With a Regional Internet NEG backend, if the SNI is specified here, the load balancer uses it
1487+
regardless of whether the Regional Internet NEG is specified with FQDN or IP address and port.
1488+
- name: 'subjectAltNames'
1489+
type: Array
1490+
description: |
1491+
A list of Subject Alternative Names (SANs) that the Load Balancer verifies during a TLS handshake with the backend.
1492+
When the server presents its X.509 certificate to the Load Balancer, the Load Balancer inspects the certificate's SAN field,
1493+
and requires that at least one SAN match one of the subjectAltNames in the list. This field is limited to 5 entries.
1494+
When both sni and subjectAltNames are specified, the load balancer matches the backend certificate's SAN only to
1495+
subjectAltNames.
1496+
item_type:
1497+
type: NestedObject
1498+
properties:
1499+
- name: 'dnsName'
1500+
type: String
1501+
description: The SAN specified as a DNS Name.
1502+
exactly_one_of:
1503+
- tlsSettings.0.uniform_resource_identifier
1504+
- tlsSettings.0.dns_name
1505+
- name: 'uniformResourceIdentifier'
1506+
type: String
1507+
description: The SAN specified as a URI.
1508+
exactly_one_of:
1509+
- tlsSettings.0.uniform_resource_identifier
1510+
- tlsSettings.0.dns_name
1511+
- name: 'authenticationConfig'
1512+
type: String
1513+
description: |
1514+
Reference to the BackendAuthenticationConfig resource from the networksecurity.googleapis.com namespace.
1515+
Can be used in authenticating TLS connections to the backend, as specified by the authenticationMode field.
1516+
Can only be specified if authenticationMode is not NONE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
resource "google_compute_backend_service" "{{$.PrimaryResourceId}}" {
2+
name = "{{index $.Vars "backend_service_name"}}"
3+
health_checks = [google_compute_health_check.default.id]
4+
load_balancing_scheme = "EXTERNAL_MANAGED"
5+
protocol = "HTTPS"
6+
tls_settings {
7+
sni = "example.com"
8+
subjectAltNames = [
9+
{
10+
dns_name = "example.com"
11+
},
12+
{
13+
uniform_resource_identifier = "https://example.com"
14+
}
15+
]
16+
authentication_config = [google_network_security_backend_authentication_config.default.id]
17+
}
18+
}
19+
20+
resource "google_compute_health_check" "default" {
21+
name = "{{index $.Vars "health_check_name"}}"
22+
http_health_check {
23+
port = 80
24+
}
25+
}
26+
27+
resource "google_network_security_backend_authentication_config" "default" {
28+
name = "{{index $.Vars "authentication_name"}}"
29+
well_known_roots = "PUBLIC_ROOTS"
30+
}

0 commit comments

Comments
 (0)