Skip to content

Commit 99a090f

Browse files
[#15779] Add google_network_security_firewall_endpoint_association resource (#9815) (#17540)
* [#15779] Add google_network_security_firewall_endpoint_association resource * Fixing tests * Fixes * Add test for update --------- [upstream:124dd0e33a5d934bf27cd2764db835fa7791e4fd] Signed-off-by: Modular Magician <[email protected]>
1 parent a88c0e5 commit 99a090f

File tree

3 files changed

+172
-0
lines changed

3 files changed

+172
-0
lines changed

.changelog/9815.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
networksecurity: new `google_network_security_firewall_endpoint_association` resource
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,166 @@
1+
---
2+
# ----------------------------------------------------------------------------
3+
#
4+
# *** AUTO GENERATED CODE *** Type: MMv1 ***
5+
#
6+
# ----------------------------------------------------------------------------
7+
#
8+
# This file is automatically generated by Magic Modules and manual
9+
# changes will be clobbered when the file is regenerated.
10+
#
11+
# Please read more about how to change this file in
12+
# .github/CONTRIBUTING.md.
13+
#
14+
# ----------------------------------------------------------------------------
15+
subcategory: "Network security"
16+
description: |-
17+
Firewall endpoint association links a firewall endpoint to a VPC network in
18+
the same zone.
19+
---
20+
21+
# google\_network\_security\_firewall\_endpoint\_association
22+
23+
Firewall endpoint association links a firewall endpoint to a VPC network in
24+
the same zone. After you define this association, Cloud Firewall forwards the
25+
zonal workload traffic in your VPC network that requires layer 7 inspection to
26+
the attached firewall endpoint.
27+
28+
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
29+
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
30+
31+
To get more information about FirewallEndpointAssociation, see:
32+
33+
* [API documentation](https://cloud.google.com/firewall/docs/reference/network-security/rest/v1beta1/projects.locations.firewallEndpointAssociations#FirewallEndpointAssociation)
34+
* How-to Guides
35+
* [Firewall endpoint overview](https://cloud.google.com/firewall/docs/about-firewall-endpoints)
36+
* [Create and associate firewall endpoints](https://cloud.google.com/firewall/docs/configure-firewall-endpoints)
37+
38+
## Example Usage - Network Security Firewall Endpoint Association Basic
39+
40+
41+
```hcl
42+
resource "google_network_security_firewall_endpoint" "default" {
43+
provider = google-beta
44+
name = "my-firewall-endpoint"
45+
parent = "organizations/123456789"
46+
location = "us-central1-a"
47+
48+
labels = {
49+
foo = "bar"
50+
}
51+
}
52+
53+
resource "google_network_security_firewall_endpoint_association" "default_association" {
54+
provider = google-beta
55+
name = "my-firewall-endpoint-association"
56+
parent = "projects/my-project-name"
57+
location = "us-central1-a"
58+
59+
labels = {
60+
foo = "bar"
61+
}
62+
}
63+
```
64+
65+
## Argument Reference
66+
67+
The following arguments are supported:
68+
69+
70+
* `firewall_endpoint` -
71+
(Required)
72+
The URL of the firewall endpoint that is being associated.
73+
74+
* `network` -
75+
(Required)
76+
The URL of the network that is being associated.
77+
78+
* `name` -
79+
(Required)
80+
The name of the firewall endpoint association resource.
81+
82+
* `location` -
83+
(Required)
84+
The location (zone) of the firewall endpoint association.
85+
86+
87+
- - -
88+
89+
90+
* `tls_inspection_policy` -
91+
(Optional)
92+
The URL of the TlsInspectionPolicy that is being associated.
93+
94+
* `labels` -
95+
(Optional)
96+
A map of key/value label pairs to assign to the resource.
97+
98+
**Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
99+
Please refer to the field `effective_labels` for all of the labels present on the resource.
100+
101+
* `parent` -
102+
(Optional)
103+
The name of the parent this firewall endpoint association belongs to.
104+
Format: projects/{project_id}.
105+
106+
107+
## Attributes Reference
108+
109+
In addition to the arguments listed above, the following computed attributes are exported:
110+
111+
* `id` - an identifier for the resource with format `{{parent}}/locations/{{location}}/firewallEndpointAssociations/{{name}}`
112+
113+
* `self_link` -
114+
Server-defined URL of this resource.
115+
116+
* `create_time` -
117+
Time the firewall endpoint was created in UTC.
118+
119+
* `update_time` -
120+
Time the firewall endpoint was updated in UTC.
121+
122+
* `reconciling` -
123+
Whether reconciling is in progress, recommended per https://google.aip.dev/128.
124+
125+
* `state` -
126+
The current state of the endpoint.
127+
128+
* `terraform_labels` -
129+
The combination of labels configured directly on the resource
130+
and default labels configured on the provider.
131+
132+
* `effective_labels` -
133+
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
134+
135+
136+
## Timeouts
137+
138+
This resource provides the following
139+
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
140+
141+
- `create` - Default is 20 minutes.
142+
- `update` - Default is 20 minutes.
143+
- `delete` - Default is 20 minutes.
144+
145+
## Import
146+
147+
148+
FirewallEndpointAssociation can be imported using any of these accepted formats:
149+
150+
* `{{parent}}/locations/{{location}}/firewallEndpointAssociations/{{name}}`
151+
152+
153+
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import FirewallEndpointAssociation using one of the formats above. For example:
154+
155+
```tf
156+
import {
157+
id = "{{parent}}/locations/{{location}}/firewallEndpointAssociations/{{name}}"
158+
to = google_network_security_firewall_endpoint_association.default
159+
}
160+
```
161+
162+
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), FirewallEndpointAssociation can be imported using one of the formats above. For example:
163+
164+
```
165+
$ terraform import google_network_security_firewall_endpoint_association.default {{parent}}/locations/{{location}}/firewallEndpointAssociations/{{name}}
166+
```

0 commit comments

Comments
 (0)