Skip to main content

policies

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

Overview

Namepolicies
TypeResource
Idgoogle.dns.policies

Fields

NameDatatypeDescription
idstringUnique identifier for the resource; defined by the server (output only).
namestringUser-assigned name for this policy.
descriptionstringA mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the policy's function.
alternativeNameServerConfigobject
enableInboundForwardingbooleanAllows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address is allocated from each of the subnetworks that are bound to this policy.
enableLoggingbooleanControls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set.
kindstring
networksarrayList of network names specifying networks to which this policy is applied.

Methods

NameAccessible byRequired ParamsDescription
getSELECTpolicy, projectFetches the representation of an existing Policy.
listSELECTprojectEnumerates all Policies associated with a project.
createINSERTprojectCreates a new Policy.
deleteDELETEpolicy, projectDeletes a previously created Policy. Fails if the policy is still being referenced by a network.
patchUPDATEpolicy, projectApplies a partial update to an existing Policy.
updateREPLACEpolicy, projectUpdates an existing Policy.

SELECT examples

Enumerates all Policies associated with a project.

SELECT
id,
name,
description,
alternativeNameServerConfig,
enableInboundForwarding,
enableLogging,
kind,
networks
FROM google.dns.policies
WHERE project = '{{ project }}';

INSERT example

Use the following StackQL query and manifest file to create a new policies resource.

/*+ create */
INSERT INTO google.dns.policies (
project,
name,
enableInboundForwarding,
description,
networks,
alternativeNameServerConfig,
enableLogging
)
SELECT
'{{ project }}',
'{{ name }}',
{{ enableInboundForwarding }},
'{{ description }}',
'{{ networks }}',
'{{ alternativeNameServerConfig }}',
{{ enableLogging }}
;

UPDATE example

Updates a policies resource.

/*+ update */
UPDATE google.dns.policies
SET
name = '{{ name }}',
enableInboundForwarding = true|false,
description = '{{ description }}',
networks = '{{ networks }}',
alternativeNameServerConfig = '{{ alternativeNameServerConfig }}',
enableLogging = true|false
WHERE
policy = '{{ policy }}'
AND project = '{{ project }}';

REPLACE example

Replaces all fields in the specified policies resource.

/*+ update */
REPLACE google.dns.policies
SET
name = '{{ name }}',
enableInboundForwarding = true|false,
description = '{{ description }}',
networks = '{{ networks }}',
alternativeNameServerConfig = '{{ alternativeNameServerConfig }}',
enableLogging = true|false
WHERE
policy = '{{ policy }}'
AND project = '{{ project }}';

DELETE example

Deletes the specified policies resource.

/*+ delete */
DELETE FROM google.dns.policies
WHERE policy = '{{ policy }}'
AND project = '{{ project }}';