|
| 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