policies
Creates, updates, deletes, gets or lists a policies
resource.
Overview
Name | policies |
Type | Resource |
Id | google.dns.policies |
Fields
Name | Datatype | Description |
---|---|---|
id | string | Unique identifier for the resource; defined by the server (output only). |
name | string | User-assigned name for this policy. |
description | string | A mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the policy's function. |
alternativeNameServerConfig | object | |
enableInboundForwarding | boolean | Allows 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. |
enableLogging | boolean | Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set. |
kind | string | |
networks | array | List of network names specifying networks to which this policy is applied. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | policy, project | Fetches the representation of an existing Policy. |
list | SELECT | project | Enumerates all Policies associated with a project. |
create | INSERT | project | Creates a new Policy. |
delete | DELETE | policy, project | Deletes a previously created Policy. Fails if the policy is still being referenced by a network. |
patch | UPDATE | policy, project | Applies a partial update to an existing Policy. |
update | REPLACE | policy, project | Updates 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.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.dns.policies (
project,
name,
enableInboundForwarding,
description,
networks,
alternativeNameServerConfig,
enableLogging
)
SELECT
'{{ project }}',
'{{ name }}',
{{ enableInboundForwarding }},
'{{ description }}',
'{{ networks }}',
'{{ alternativeNameServerConfig }}',
{{ enableLogging }}
;
- name: your_resource_model_name
props:
- name: id
value: string
- name: name
value: string
- name: enableInboundForwarding
value: boolean
- name: description
value: string
- name: networks
value:
- - name: networkUrl
value: string
- name: kind
value: string
- name: alternativeNameServerConfig
value:
- name: targetNameServers
value:
- - name: ipv4Address
value: string
- name: forwardingPath
value: string
- name: ipv6Address
value: string
- name: kind
value: string
- name: kind
value: string
- name: enableLogging
value: boolean
- name: kind
value: string
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 }}';