The Compute NetworkFirewallPolicyAssociation resource
resource "google_compute_network_firewall_policy" "network_firewall_policy" {
name = "policy"
project = "my-project-name"
description = "Sample global network firewall policy"
}
resource "google_compute_network" "network" {
name = "network"
}
resource "google_compute_network_firewall_policy_association" "primary" {
name = "association"
attachment_target = google_compute_network.network.id
firewall_policy = google_compute_network_firewall_policy.network_firewall_policy.name
project = "my-project-name"
}
The following arguments are supported:
attachment_target
-
(Required)
The target that the firewall policy is attached to.
firewall_policy
-
(Required)
The firewall policy ID of the association.
name
-
(Required)
The name for an association.
project
-
(Optional)
The project for the resourceIn addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}
short_name
-
The short name of the firewall policy of the association.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.delete
- Default is 20 minutes.NetworkFirewallPolicyAssociation can be imported using any of these accepted formats:
projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}
{{project}}/{{firewall_policy}}/{{name}}
In Terraform v1.5.0 and later, use an import
block to import NetworkFirewallPolicyAssociation using one of the formats above. For example:
import {
id = "projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}"
to = google_compute_network_firewall_policy_association.default
}
When using the terraform import
command, NetworkFirewallPolicyAssociation can be imported using one of the formats above. For example:
$ terraform import google_compute_network_firewall_policy_association.default projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}
$ terraform import google_compute_network_firewall_policy_association.default {{project}}/{{firewall_policy}}/{{name}}