Skip to main content

automated_dns_records

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

Overview

Nameautomated_dns_records
TypeResource
Idgoogle.networkconnectivity.automated_dns_records

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringImmutable. Identifier. The name of an AutomatedDnsRecord. Format: projects/{project}/locations/{location}/automatedDnsRecords/{automated_dns_record} See: https://google.aip.dev/122#fields-representing-resource-names
consumerNetworkstringRequired. Immutable. The full resource path of the consumer network this AutomatedDnsRecord is visible to. Example: "projects/{projectNumOrId}/global/networks/{networkName}".
createTimestring (google-datetime)Output only. The timestamp of when the record was created.
creationModestringRequired. Immutable. The creation mode of the AutomatedDnsRecord. This field is immutable. (CREATION_MODE_UNSPECIFIED, CONSUMER_API, SERVICE_CONNECTION_MAP)
currentConfigobjectOutput only. The current settings for this record as identified by (hostname, dns_suffix, type) in Cloud DNS. The current_config field reflects the actual settings of the DNS record in Cloud DNS based on the hostname, dns_suffix, and type. * Absence: If current_config is unset, it means a DNS record with the specified hostname, dns_suffix, and type does not currently exist in Cloud DNS. This could be because the AutomatedDnsRecord has never been successfully programmed, has been deleted, or there was an error during provisioning. * Presence: If current_config is present: * It can be different from the original_config. This can happen due to several reasons: * Out-of-band changes: A consumer might have directly modified the DNS record in Cloud DNS. * OVERWRITE operations from other AutomatedDnsRecord resources: Another AutomatedDnsRecord with the same identifying attributes (hostname, dns_suffix, type) but a different configuration might have overwritten the record using insert_mode: OVERWRITE. Therefore, the presence of current_config indicates that a corresponding DNS record exists, but its values (TTL and RRData) might not always align with the original_config of the AutomatedDnsRecord. (id: Config)
descriptionstringA human-readable description of the record.
dnsSuffixstringRequired. Immutable. The dns suffix for this record to use in longest-suffix matching. Requires a trailing dot. Example: "example.com."
dnsZonestringOutput only. DnsZone is the DNS zone managed by automation. Format: projects/{project}/managedZones/{managedZone}
etagstringOptional. The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
fqdnstringOutput only. The FQDN created by combining the hostname and dns suffix. Should include a trailing dot.
hostnamestringRequired. Immutable. The hostname for the DNS record. This value will be prepended to the dns_suffix to create the full domain name (FQDN) for the record. For example, if hostname is "corp.db" and dns_suffix is "example.com.", the resulting record will be "corp.db.example.com.". Should not include a trailing dot.
labelsobjectOptional. User-defined labels.
originalConfigobjectRequired. Immutable. The configuration settings used to create this DNS record. These settings define the desired state of the record as specified by the producer. (id: Config)
recordTypestringRequired. Immutable. The identifier of a supported record type. (RECORD_TYPE_UNSPECIFIED, A, AAAA, TXT, CNAME)
serviceClassstringRequired. Immutable. The service class identifier which authorizes this AutomatedDnsRecord. Any API calls targeting this AutomatedDnsRecord must have networkconnectivity.serviceClasses.use IAM permission for the provided service class.
statestringOutput only. The current operational state of this AutomatedDnsRecord as managed by Service Connectivity Automation. (STATE_UNSPECIFIED, PROGRAMMED, FAILED_DEPROGRAMMING, CREATING, DELETING)
stateDetailsstringOutput only. A human-readable message providing more context about the current state, such as an error description if the state is FAILED_DEPROGRAMMING.
updateTimestring (google-datetime)Output only. The timestamp of when the record was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, automatedDnsRecordsIdGets details of a single AutomatedDnsRecord.
listselectprojectsId, locationsIdorderBy, pageToken, filter, pageSizeLists AutomatedDnsRecords in a given project and location.
createinsertprojectsId, locationsIdautomatedDnsRecordId, insertMode, requestIdCreates a new AutomatedDnsRecord in a given project and location.
deletedeleteprojectsId, locationsId, automatedDnsRecordsIddeleteMode, etag, requestIdDeletes a single AutomatedDnsRecord.

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
automatedDnsRecordsIdstring
locationsIdstring
projectsIdstring
automatedDnsRecordIdstring
deleteModestring
etagstring
filterstring
insertModestring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring

SELECT examples

Gets details of a single AutomatedDnsRecord.

SELECT
name,
consumerNetwork,
createTime,
creationMode,
currentConfig,
description,
dnsSuffix,
dnsZone,
etag,
fqdn,
hostname,
labels,
originalConfig,
recordType,
serviceClass,
state,
stateDetails,
updateTime
FROM google.networkconnectivity.automated_dns_records
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND automatedDnsRecordsId = '{{ automatedDnsRecordsId }}' -- required
;

INSERT examples

Creates a new AutomatedDnsRecord in a given project and location.

INSERT INTO google.networkconnectivity.automated_dns_records (
data__creationMode,
data__etag,
data__dnsSuffix,
data__name,
data__recordType,
data__originalConfig,
data__description,
data__hostname,
data__labels,
data__serviceClass,
data__consumerNetwork,
projectsId,
locationsId,
automatedDnsRecordId,
insertMode,
requestId
)
SELECT
'{{ creationMode }}',
'{{ etag }}',
'{{ dnsSuffix }}',
'{{ name }}',
'{{ recordType }}',
'{{ originalConfig }}',
'{{ description }}',
'{{ hostname }}',
'{{ labels }}',
'{{ serviceClass }}',
'{{ consumerNetwork }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ automatedDnsRecordId }}',
'{{ insertMode }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples

Deletes a single AutomatedDnsRecord.

DELETE FROM google.networkconnectivity.automated_dns_records
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND automatedDnsRecordsId = '{{ automatedDnsRecordsId }}' --required
AND deleteMode = '{{ deleteMode }}'
AND etag = '{{ etag }}'
AND requestId = '{{ requestId }}'
;