Skip to content

Commit

Permalink
[#15779] Add google_network_security_firewall_endpoint_association re…
Browse files Browse the repository at this point in the history
…source (#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]>
  • Loading branch information
modular-magician authored Mar 11, 2024
1 parent a88c0e5 commit 99a090f
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/9815.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
networksecurity: new `google_network_security_firewall_endpoint_association` resource
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package networksecurity_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Network security"
description: |-
Firewall endpoint association links a firewall endpoint to a VPC network in
the same zone.
---

# google\_network\_security\_firewall\_endpoint\_association

Firewall endpoint association links a firewall endpoint to a VPC network in
the same zone. After you define this association, Cloud Firewall forwards the
zonal workload traffic in your VPC network that requires layer 7 inspection to
the attached firewall endpoint.

~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.

To get more information about FirewallEndpointAssociation, see:

* [API documentation](https://cloud.google.com/firewall/docs/reference/network-security/rest/v1beta1/projects.locations.firewallEndpointAssociations#FirewallEndpointAssociation)
* How-to Guides
* [Firewall endpoint overview](https://cloud.google.com/firewall/docs/about-firewall-endpoints)
* [Create and associate firewall endpoints](https://cloud.google.com/firewall/docs/configure-firewall-endpoints)

## Example Usage - Network Security Firewall Endpoint Association Basic


```hcl
resource "google_network_security_firewall_endpoint" "default" {
provider = google-beta
name = "my-firewall-endpoint"
parent = "organizations/123456789"
location = "us-central1-a"
labels = {
foo = "bar"
}
}
resource "google_network_security_firewall_endpoint_association" "default_association" {
provider = google-beta
name = "my-firewall-endpoint-association"
parent = "projects/my-project-name"
location = "us-central1-a"
labels = {
foo = "bar"
}
}
```

## Argument Reference

The following arguments are supported:


* `firewall_endpoint` -
(Required)
The URL of the firewall endpoint that is being associated.

* `network` -
(Required)
The URL of the network that is being associated.

* `name` -
(Required)
The name of the firewall endpoint association resource.

* `location` -
(Required)
The location (zone) of the firewall endpoint association.


- - -


* `tls_inspection_policy` -
(Optional)
The URL of the TlsInspectionPolicy that is being associated.

* `labels` -
(Optional)
A map of key/value label pairs to assign to the resource.

**Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field `effective_labels` for all of the labels present on the resource.

* `parent` -
(Optional)
The name of the parent this firewall endpoint association belongs to.
Format: projects/{project_id}.


## Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

* `id` - an identifier for the resource with format `{{parent}}/locations/{{location}}/firewallEndpointAssociations/{{name}}`

* `self_link` -
Server-defined URL of this resource.

* `create_time` -
Time the firewall endpoint was created in UTC.

* `update_time` -
Time the firewall endpoint was updated in UTC.

* `reconciling` -
Whether reconciling is in progress, recommended per https://google.aip.dev/128.

* `state` -
The current state of the endpoint.

* `terraform_labels` -
The combination of labels configured directly on the resource
and default labels configured on the provider.

* `effective_labels` -
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.


## Timeouts

This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:

- `create` - Default is 20 minutes.
- `update` - Default is 20 minutes.
- `delete` - Default is 20 minutes.

## Import


FirewallEndpointAssociation can be imported using any of these accepted formats:

* `{{parent}}/locations/{{location}}/firewallEndpointAssociations/{{name}}`


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:

```tf
import {
id = "{{parent}}/locations/{{location}}/firewallEndpointAssociations/{{name}}"
to = google_network_security_firewall_endpoint_association.default
}
```

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:

```
$ terraform import google_network_security_firewall_endpoint_association.default {{parent}}/locations/{{location}}/firewallEndpointAssociations/{{name}}
```

0 comments on commit 99a090f

Please sign in to comment.