Skip to main content

organization_security_policies_association

Creates, updates, deletes, gets or lists an organization_security_policies_association resource.

Overview

Nameorganization_security_policies_association
TypeResource
Idgoogle.compute.organization_security_policies_association

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name for an association.
attachmentIdstringThe resource that the security policy is attached to.
displayNamestringOutput only. [Output Only] The display name of the security policy of the association.
excludedFoldersarrayA list of folders to exclude from the security policy.
excludedProjectsarrayA list of projects to exclude from the security policy.
securityPolicyIdstringOutput only. [Output Only] The security policy ID of the association.
shortNamestringOutput only. [Output Only] The short name of the security policy of the association.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_associationselectsecurityPolicynameGets an association with the specified name.

Use this API to read Cloud Armor policies. Previously, alpha and beta
versions of this API were used to read firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.getAssociation
instead.
add_associationinsertsecurityPolicyrequestId, replaceExistingAssociationInserts an association for the specified security policy.

This has billing implications. Projects in the hierarchy with effective
hierarchical security policies will be automatically enrolled into Cloud
Armor Enterprise if not already enrolled.

Use this API to modify Cloud Armor policies. Previously, alpha and beta
versions of this API were used to modify firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.addAssociation
instead.
remove_associationdeletesecurityPolicyrequestId, nameRemoves an association for the specified security policy.

Use this API to modify Cloud Armor policies. Previously, alpha and beta
versions of this API were used to modify firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.removeAssociation
instead.

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
securityPolicystring
namestring
replaceExistingAssociationboolean
requestIdstring

SELECT examples

Gets an association with the specified name.

Use this API to read Cloud Armor policies. Previously, alpha and beta
versions of this API were used to read firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.getAssociation
instead.

SELECT
name,
attachmentId,
displayName,
excludedFolders,
excludedProjects,
securityPolicyId,
shortName
FROM google.compute.organization_security_policies_association
WHERE securityPolicy = '{{ securityPolicy }}' -- required
AND name = '{{ name }}'
;

INSERT examples

Inserts an association for the specified security policy.

This has billing implications. Projects in the hierarchy with effective
hierarchical security policies will be automatically enrolled into Cloud
Armor Enterprise if not already enrolled.

Use this API to modify Cloud Armor policies. Previously, alpha and beta
versions of this API were used to modify firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.addAssociation
instead.

INSERT INTO google.compute.organization_security_policies_association (
data__excludedProjects,
data__name,
data__attachmentId,
data__excludedFolders,
securityPolicy,
requestId,
replaceExistingAssociation
)
SELECT
'{{ excludedProjects }}',
'{{ name }}',
'{{ attachmentId }}',
'{{ excludedFolders }}',
'{{ securityPolicy }}',
'{{ requestId }}',
'{{ replaceExistingAssociation }}'
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 security policy.

Use this API to modify Cloud Armor policies. Previously, alpha and beta
versions of this API were used to modify firewall policies. This usage is
now disabled for most organizations. Use firewallPolicies.removeAssociation
instead.

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