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:

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.
firewallPolicyIdstringOutput only. [Output Only] The firewall policy ID of the association.
shortNamestringOutput only. [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_associationselectfirewallPolicynameGets an association with the specified name.
list_associationsselecttargetResource, includeInheritedPoliciesLists associations of a specified target, i.e., organization or folder.
add_associationinsertfirewallPolicyreplaceExistingAssociation, requestIdInserts an association for the specified firewall policy.
remove_associationdeletefirewallPolicyname, requestIdRemoves an association for the specified 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
includeInheritedPoliciesboolean
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 firewallPolicy = '{{ firewallPolicy }}' -- required
AND name = '{{ name }}'
;

INSERT examples

Inserts an association for the specified firewall policy.

INSERT INTO google.compute.firewall_policies_associations (
data__name,
data__displayName,
data__attachmentTarget,
firewallPolicy,
replaceExistingAssociation,
requestId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ attachmentTarget }}',
'{{ firewallPolicy }}',
'{{ replaceExistingAssociation }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
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 firewall policy.

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