organization_security_policies_association
Creates, updates, deletes, gets or lists an organization_security_policies_association resource.
Overview
| Name | organization_security_policies_association |
| Type | Resource |
| Id | google.compute.organization_security_policies_association |
Fields
The following fields are returned by SELECT queries:
- get_association
| Name | Datatype | Description |
|---|---|---|
name | string | The name for an association. |
attachmentId | string | The resource that the security policy is attached to. |
displayName | string | Output only. [Output Only] The display name of the security policy of the association. |
excludedFolders | array | A list of folders to exclude from the security policy. |
excludedProjects | array | A list of projects to exclude from the security policy. |
securityPolicyId | string | Output only. [Output Only] The security policy ID of the association. |
shortName | string | Output only. [Output Only] The short name of the security policy of the association. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_association | select | securityPolicy | name | 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. |
add_association | insert | securityPolicy | requestId, replaceExistingAssociation | 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. |
remove_association | delete | securityPolicy | requestId, name | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
securityPolicy | string | |
name | string | |
replaceExistingAssociation | boolean | |
requestId | string |
SELECT examples
- get_association
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
- add_association
- Manifest
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
;
# Description fields are for documentation purposes
- name: organization_security_policies_association
props:
- name: securityPolicy
value: "{{ securityPolicy }}"
description: Required parameter for the organization_security_policies_association resource.
- name: excludedProjects
value:
- "{{ excludedProjects }}"
description: |
A list of projects to exclude from the security policy.
- name: name
value: "{{ name }}"
description: |
The name for an association.
- name: attachmentId
value: "{{ attachmentId }}"
description: |
The resource that the security policy is attached to.
- name: excludedFolders
value:
- "{{ excludedFolders }}"
description: |
A list of folders to exclude from the security policy.
- name: requestId
value: "{{ requestId }}"
- name: replaceExistingAssociation
value: {{ replaceExistingAssociation }}
DELETE examples
- remove_association
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 }}'
;