Skip to main content

firewall_policies_associations

Creates, updates, deletes, gets or lists a firewall_policies_associations resource.

Overview

Namefirewall_policies_associations
TypeResource
Idgoogle.compute.firewall_policies_associations

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringThe name for an association.
attachmentTargetstringThe target that the firewall policy is attached to.
displayNamestring[Output Only] Deprecated, please use short name instead. The display name of the firewall policy of the association.
firewallPolicyIdstring[Output Only] The firewall policy ID of the association.
shortNamestring[Output Only] The short name of the firewall policy of the association.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_associationselectproject, region, firewallPolicynameGets an association with the specified name.
list_associationsselecttargetResourceLists associations of a specified target, i.e., organization or folder.
add_associationinsertproject, region, firewallPolicyreplaceExistingAssociation, requestIdInserts an association for the specified network firewall policy.
remove_associationdeleteproject, region, firewallPolicyname, requestIdRemoves an association for the specified network firewall policy.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
firewallPolicystring
projectstring
regionstring
namestring
replaceExistingAssociationboolean
requestIdstring
targetResourcestring

SELECT examples

Gets an association with the specified name.

SELECT
name,
attachmentTarget,
displayName,
firewallPolicyId,
shortName
FROM google.compute.firewall_policies_associations
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND firewallPolicy = '{{ firewallPolicy }}' -- required
AND name = '{{ name }}';

INSERT examples

Inserts an association for the specified network firewall policy.

INSERT INTO google.compute.firewall_policies_associations (
data__name,
data__attachmentTarget,
data__firewallPolicyId,
data__shortName,
data__displayName,
project,
region,
firewallPolicy,
replaceExistingAssociation,
requestId
)
SELECT
'{{ name }}',
'{{ attachmentTarget }}',
'{{ firewallPolicyId }}',
'{{ shortName }}',
'{{ displayName }}',
'{{ project }}',
'{{ region }}',
'{{ firewallPolicy }}',
'{{ replaceExistingAssociation }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone
;

DELETE examples

Removes an association for the specified network firewall policy.

DELETE FROM google.compute.firewall_policies_associations
WHERE project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND firewallPolicy = '{{ firewallPolicy }}' --required
AND name = '{{ name }}'
AND requestId = '{{ requestId }}';