Skip to content

Commit 47909eb

Browse files
Add networksecurity BackendAuthenticationConfig resource (beta) (#13210)
[upstream:859ca01f049d877ca04a38608de601b3ab4f96b5] Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent 53e8d44 commit 47909eb

File tree

5 files changed

+269
-0
lines changed

5 files changed

+269
-0
lines changed

.changelog/13210.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
`google_network_security_backend_authentication_config` (beta)
3+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
package networksecurity_test
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIDDzCCAfegAwIBAgIUDOiCLH9QNMMYnjPZVf4VwO9blsEwDQYJKoZIhvcNAQEL
3+
BQAwFjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wIBcNMjIwODI0MDg0MDUxWhgPMzAy
4+
MTEyMjUwODQwNTFaMBYxFDASBgNVBAMMC2V4YW1wbGUuY29tMIIBIjANBgkqhkiG
5+
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvOT925GG4lKV9HvAHsbecMhGPAqjhVRC26iZ
6+
UJC8oSWOu95lWJSX5ZhbiF6Nz192wDGV/VAh3Lxj8RYtcn75eDxQKTcKouDld+To
7+
CGIStPFWbR6rbysLuZqFVEXVOTvp2QIegInfrvnGC4j7Qpic7zrFB9HzJx+0HpeE
8+
yO4gkdzJfEK/gMmolUgJrKX59o+0+Rj+Jq3EtcQxL1fVBVJSx0NvpoR1eYpnHMr/
9+
rJKZkUUZ2xE86hrtpiP6OEYQTi00rmf4GnZF5QfGGD0xuoQXtR7Tu+XhKibXIhxc
10+
D4RzPLX1QS040PXvmMPLDb4YlUQ6V3Rs42JDvkkDwIMXZvn8awIDAQABo1MwUTAd
11+
BgNVHQ4EFgQURuo1CCZZAUv7xi02f2nC5tRbf18wHwYDVR0jBBgwFoAURuo1CCZZ
12+
AUv7xi02f2nC5tRbf18wDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOC
13+
AQEAqx3tDxurnYr9EUPhF5/LlDPYM+VI7EgrKdRnuIqUlZI0tm3vOGME0te6dBTC
14+
YLNaHLW3m/4Tm4M2eg0Kpz6CxJfn3109G31dCi0xwzSDHf5TPUWvqIVhq5WRgMIf
15+
n8KYBlQSmqdJBRztUIQH/UPFnSbxymlS4s5qwDgTH5ag9EEBcnWsQ2LZjKi0eqve
16+
MaqAvvB+j8RGZzYY4re94bSJI42zIZ6nMWPtXwRuDc30xl/u+E0jWIgWbPwSd6Km
17+
3wnJnGiU2ezPGq3zEU+Rc39VVIFKQpciNeYuF3neHPJvYOf58qW2Z8s0VH0MR1x3
18+
3DoO/e30FIr9j+PRD+s5BPKF2A==
19+
-----END CERTIFICATE-----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
-----BEGIN PRIVATE KEY-----
2+
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC85P3bkYbiUpX0
3+
e8Aext5wyEY8CqOFVELbqJlQkLyhJY673mVYlJflmFuIXo3PX3bAMZX9UCHcvGPx
4+
Fi1yfvl4PFApNwqi4OV35OgIYhK08VZtHqtvKwu5moVURdU5O+nZAh6Aid+u+cYL
5+
iPtCmJzvOsUH0fMnH7Qel4TI7iCR3Ml8Qr+AyaiVSAmspfn2j7T5GP4mrcS1xDEv
6+
V9UFUlLHQ2+mhHV5imccyv+skpmRRRnbETzqGu2mI/o4RhBOLTSuZ/gadkXlB8YY
7+
PTG6hBe1HtO75eEqJtciHFwPhHM8tfVBLTjQ9e+Yw8sNvhiVRDpXdGzjYkO+SQPA
8+
gxdm+fxrAgMBAAECggEAV4/A24TQpV4KFBw/WSTvnRFBeXinB1mhamhztWR6hCrA
9+
SPcVPKQY632eRI8sJmpGxl3V/Ogl4khT/cA9j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YtIN7NHy2GtzrgmmY/ZAFB/hX8Ft4ex2MxbIp3hvxroTqGn
26+
bfu7uv97NoPQqbjtc3Mz8h2IaXTVDUnWYY5gDu6rM2w+Z75/sWIGiTWrsdYX4ohb
27+
ujngzJ7Ew7GgKSboj6mtlVM=
28+
-----END PRIVATE KEY-----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
---
2+
# ----------------------------------------------------------------------------
3+
#
4+
# *** AUTO GENERATED CODE *** Type: MMv1 ***
5+
#
6+
# ----------------------------------------------------------------------------
7+
#
8+
# This code is generated by Magic Modules using the following:
9+
#
10+
# Configuration: https:#github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/products/networksecurity/BackendAuthenticationConfig.yaml
11+
# Template: https:#github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/templates/terraform/resource.html.markdown.tmpl
12+
#
13+
# DO NOT EDIT this file directly. Any changes made to this file will be
14+
# overwritten during the next generation cycle.
15+
#
16+
# ----------------------------------------------------------------------------
17+
subcategory: "Network Security"
18+
description: |-
19+
BackendAuthenticationConfig groups the TrustConfig together with other settings that control how the load balancer authenticates, and expresses its identity to the backend.
20+
---
21+
22+
# google_network_security_backend_authentication_config
23+
24+
BackendAuthenticationConfig groups the TrustConfig together with other settings that control how the load balancer authenticates, and expresses its identity to the backend.
25+
26+
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
27+
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
28+
29+
To get more information about BackendAuthenticationConfig, see:
30+
* How-to Guides
31+
* [Backend mTLS](https://cloud.google.com/load-balancing/docs/backend-authenticated-tls-backend-mtls#backend-authentication-config)
32+
33+
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
34+
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md&cloudshell_working_dir=network_security_backend_authentication_config_basic&open_in_editor=main.tf" target="_blank">
35+
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
36+
</a>
37+
</div>
38+
## Example Usage - Network Security Backend Authentication Config Basic
39+
40+
41+
```hcl
42+
resource "google_network_security_backend_authentication_config" "default" {
43+
provider = google-beta
44+
name = "my-backend-authentication-config"
45+
labels = {
46+
foo = "bar"
47+
}
48+
description = "my description"
49+
well_known_roots = "PUBLIC_ROOTS"
50+
}
51+
```
52+
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
53+
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md&cloudshell_working_dir=network_security_backend_authentication_config_full&open_in_editor=main.tf" target="_blank">
54+
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
55+
</a>
56+
</div>
57+
## Example Usage - Network Security Backend Authentication Config Full
58+
59+
60+
```hcl
61+
resource "google_certificate_manager_certificate" "certificate" {
62+
provider = google-beta
63+
name = "my-certificate"
64+
labels = {
65+
foo = "bar"
66+
}
67+
location = "global"
68+
self_managed {
69+
pem_certificate = file("test-fixtures/cert.pem")
70+
pem_private_key = file("test-fixtures/key.pem")
71+
}
72+
scope = "CLIENT_AUTH"
73+
}
74+
75+
resource "google_certificate_manager_trust_config" "trust_config" {
76+
provider = google-beta
77+
name = "my-trust-config"
78+
description = "sample description for the trust config"
79+
location = "global"
80+
81+
trust_stores {
82+
trust_anchors {
83+
pem_certificate = file("test-fixtures/cert.pem")
84+
}
85+
intermediate_cas {
86+
pem_certificate = file("test-fixtures/cert.pem")
87+
}
88+
}
89+
90+
labels = {
91+
foo = "bar"
92+
}
93+
}
94+
95+
resource "google_network_security_backend_authentication_config" "default" {
96+
provider = google-beta
97+
name = "my-backend-authentication-config"
98+
labels = {
99+
bar = "foo"
100+
}
101+
location = "global"
102+
description = "my description"
103+
well_known_roots = "PUBLIC_ROOTS"
104+
client_certificate = google_certificate_manager_certificate.certificate.id
105+
trust_config = google_certificate_manager_trust_config.trust_config.id
106+
}
107+
```
108+
109+
## Argument Reference
110+
111+
The following arguments are supported:
112+
113+
114+
* `name` -
115+
(Required)
116+
Name of the BackendAuthenticationConfig resource.
117+
118+
119+
- - -
120+
121+
122+
* `labels` -
123+
(Optional)
124+
Set of label tags associated with the BackendAuthenticationConfig resource.
125+
**Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
126+
Please refer to the field `effective_labels` for all of the labels present on the resource.
127+
128+
* `description` -
129+
(Optional)
130+
A free-text description of the resource. Max length 1024 characters.
131+
132+
* `client_certificate` -
133+
(Optional)
134+
Reference to a Certificate resource from the certificatemanager.googleapis.com namespace.
135+
Used by a BackendService to negotiate mTLS when the backend connection uses TLS and the backend requests a client certificate. Must have a CLIENT_AUTH scope.
136+
137+
* `trust_config` -
138+
(Optional)
139+
Reference to a TrustConfig resource from the certificatemanager.googleapis.com namespace.
140+
A BackendService uses the chain of trust represented by this TrustConfig, if specified, to validate the server certificates presented by the backend. Required unless wellKnownRoots is set to PUBLIC_ROOTS.
141+
142+
* `well_known_roots` -
143+
(Optional)
144+
Well known roots to use for server certificate validation. If set to NONE, the BackendService will only validate server certificates against roots specified in TrustConfig.
145+
If set to PUBLIC_ROOTS, the BackendService uses a set of well-known public roots, in addition to any roots specified in the trustConfig field, when validating the server certificates presented by the backend.
146+
Validation with these roots is only considered when the TlsSettings.sni field in the BackendService is set. The well-known roots are a set of root CAs managed by Google. CAs in this set can be added or removed without notice.
147+
Possible values are: `NONE`, `PUBLIC_ROOTS`.
148+
149+
* `location` -
150+
(Optional)
151+
The location of the backend authentication config.
152+
The default value is `global`.
153+
154+
* `project` - (Optional) The ID of the project in which the resource belongs.
155+
If it is not provided, the provider project is used.
156+
157+
158+
## Attributes Reference
159+
160+
In addition to the arguments listed above, the following computed attributes are exported:
161+
162+
* `id` - an identifier for the resource with format `projects/{{project}}/locations/{{location}}/backendAuthenticationConfigs/{{name}}`
163+
164+
* `create_time` -
165+
Time the BackendAuthenticationConfig was created in UTC.
166+
167+
* `update_time` -
168+
Time the BackendAuthenticationConfig was updated in UTC.
169+
170+
* `terraform_labels` -
171+
The combination of labels configured directly on the resource
172+
and default labels configured on the provider.
173+
174+
* `effective_labels` -
175+
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
176+
177+
178+
## Timeouts
179+
180+
This resource provides the following
181+
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
182+
183+
- `create` - Default is 20 minutes.
184+
- `update` - Default is 20 minutes.
185+
- `delete` - Default is 20 minutes.
186+
187+
## Import
188+
189+
190+
BackendAuthenticationConfig can be imported using any of these accepted formats:
191+
192+
* `projects/{{project}}/locations/{{location}}/backendAuthenticationConfigs/{{name}}`
193+
* `{{project}}/{{location}}/{{name}}`
194+
* `{{location}}/{{name}}`
195+
196+
197+
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import BackendAuthenticationConfig using one of the formats above. For example:
198+
199+
```tf
200+
import {
201+
id = "projects/{{project}}/locations/{{location}}/backendAuthenticationConfigs/{{name}}"
202+
to = google_network_security_backend_authentication_config.default
203+
}
204+
```
205+
206+
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), BackendAuthenticationConfig can be imported using one of the formats above. For example:
207+
208+
```
209+
$ terraform import google_network_security_backend_authentication_config.default projects/{{project}}/locations/{{location}}/backendAuthenticationConfigs/{{name}}
210+
$ terraform import google_network_security_backend_authentication_config.default {{project}}/{{location}}/{{name}}
211+
$ terraform import google_network_security_backend_authentication_config.default {{location}}/{{name}}
212+
```
213+
214+
## User Project Overrides
215+
216+
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).

0 commit comments

Comments
 (0)