railway_domain_dns_records
Creates, updates, deletes, gets or lists a railway_domain_dns_records resource.
Overview​
| Name | railway_domain_dns_records |
| Type | Resource |
| Id | railway.networking.railway_domain_dns_records |
Fields​
The following fields are returned by SELECT queries:
- list
One row per RailwayDomainDnsRecord.
| Name | Datatype | Description |
|---|---|---|
id | integer | |
domain_name | string | |
answer | string | |
fqdn | string | |
host | string | |
priority | integer | |
ttl | integer | |
type | string | (A, AAAA, ANAME, CNAME, MX, NS, SRV, TXT) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | domain, workspace_id | List DNS records for a Railway domain. Backed by the Railway GraphQL query railwayDomainDnsRecords. | |
create | insert | answer, domain, host, type, workspace_id | Create a DNS record for a Railway domain. Backed by the Railway GraphQL mutation railwayDomainDnsRecordCreate. | |
update | update | answer, domain, host, record_id, type, workspace_id | Update a DNS record for a Railway domain. Backed by the Railway GraphQL mutation railwayDomainDnsRecordUpdate. | |
delete | delete | domain, record_id, workspace_id | remove_email_forwarding | Delete a DNS record for a Railway domain. Backed by the Railway GraphQL mutation railwayDomainDnsRecordDelete. |
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 |
|---|---|---|
domain | string | |
workspace_id | string | |
answer | string | |
host | string | |
record_id | integer | |
remove_email_forwarding | boolean | Confirms that deleting a mail exchange may also remove every forwarding address and its sibling exchanges. |
type | string | (A, AAAA, ANAME, CNAME, MX, NS, SRV, TXT) |
SELECT examples​
- list
List DNS records for a Railway domain. Backed by the Railway GraphQL query railwayDomainDnsRecords.
SELECT
id,
domain_name,
answer,
fqdn,
host,
priority,
ttl,
type
FROM railway.networking.railway_domain_dns_records
WHERE domain = '{{ domain }}' -- required
AND workspace_id = '{{ workspace_id }}' -- required
;
INSERT examples​
- create
- Manifest
Create a DNS record for a Railway domain. Backed by the Railway GraphQL mutation railwayDomainDnsRecordCreate.
INSERT INTO railway.networking.railway_domain_dns_records (
answer,
domain,
host,
priority,
ttl,
type,
workspace_id
)
SELECT
'{{ answer }}' /* required */,
'{{ domain }}' /* required */,
'{{ host }}' /* required */,
{{ priority }},
{{ ttl }},
'{{ type }}' /* required */,
'{{ workspace_id }}' /* required */
RETURNING
id,
domain_name,
answer,
fqdn,
host,
priority,
ttl,
type
;
# Description fields are for documentation purposes
- name: railway_domain_dns_records
props:
- name: answer
value: "{{ answer }}"
- name: domain
value: "{{ domain }}"
- name: host
value: "{{ host }}"
- name: priority
value: {{ priority }}
- name: ttl
value: {{ ttl }}
- name: type
value: "{{ type }}"
valid_values: ['A', 'AAAA', 'ANAME', 'CNAME', 'MX', 'NS', 'SRV', 'TXT']
- name: workspace_id
value: "{{ workspace_id }}"
UPDATE examples​
- update
Update a DNS record for a Railway domain. Backed by the Railway GraphQL mutation railwayDomainDnsRecordUpdate.
UPDATE railway.networking.railway_domain_dns_records
SET
priority = '{{ priority }}',
ttl = '{{ ttl }}'
WHERE
answer = '{{ answer }}' --required
AND domain = '{{ domain }}' --required
AND host = '{{ host }}' --required
AND record_id = '{{ record_id }}' --required
AND type = '{{ type }}' --required
AND workspace_id = '{{ workspace_id }}' --required
RETURNING
id,
domain_name,
answer,
fqdn,
host,
priority,
ttl,
type;
DELETE examples​
- delete
Delete a DNS record for a Railway domain. Backed by the Railway GraphQL mutation railwayDomainDnsRecordDelete.
DELETE FROM railway.networking.railway_domain_dns_records
WHERE
domain = '{{ domain }}' --required
AND record_id = '{{ record_id }}' --required
AND workspace_id = '{{ workspace_id }}' --required
AND remove_email_forwarding = '{{ remove_email_forwarding }}'
;