Skip to main content

custom_domains

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

Overview​

Namecustom_domains
TypeResource
Idrailway.networking.custom_domains

Fields​

The following fields are returned by SELECT queries:

One row per CustomDomain.

NameDatatypeDescription
idstring
edge_idstring
environment_idstring
project_idstring
service_idstring
created_atstring (date-time)
deleted_atstring (date-time)
domainstring
is_railway_domainboolean
statusobjectCustomDomainStatus object
sync_statusstring (ACTIVE, CREATING, DELETED, DELETING, UNSPECIFIED, UPDATING)
target_portinteger
updated_atstring (date-time)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectenvironment_id, project_id, service_idLists CustomDomain objects of a AllDomains. Backed by the Railway GraphQL query domains.customDomains.
getselectid, project_idFetch details for a custom domain. Backed by the Railway GraphQL query customDomain.
createinsertdomain, environment_id, project_id, service_idCreates a new custom domain. Backed by the Railway GraphQL mutation customDomainCreate.
updateupdateenvironment_id, idUpdates a custom domain. Backed by the Railway GraphQL mutation customDomainUpdate.
deletedeleteidDeletes a custom domain. Backed by the Railway GraphQL mutation customDomainDelete.
issue_certificateexecidIssues a new certificate. Backed by the Railway GraphQL mutation customDomainIssueCertificate.

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
environment_idstring
idstring
project_idstring
service_idstring
domainstring

SELECT examples​

Lists CustomDomain objects of a AllDomains. Backed by the Railway GraphQL query domains.customDomains.

SELECT
id,
edge_id,
environment_id,
project_id,
service_id,
created_at,
deleted_at,
domain,
is_railway_domain,
status,
sync_status,
target_port,
updated_at
FROM railway.networking.custom_domains
WHERE environment_id = '{{ environment_id }}' -- required
AND project_id = '{{ project_id }}' -- required
AND service_id = '{{ service_id }}' -- required
;

INSERT examples​

Creates a new custom domain. Backed by the Railway GraphQL mutation customDomainCreate.

INSERT INTO railway.networking.custom_domains (
domain,
environment_id,
project_id,
service_id,
target_port
)
SELECT
'{{ domain }}' /* required */,
'{{ environment_id }}' /* required */,
'{{ project_id }}' /* required */,
'{{ service_id }}' /* required */,
{{ target_port }}
RETURNING
id,
edge_id,
environment_id,
project_id,
service_id,
created_at,
deleted_at,
domain,
is_railway_domain,
status,
sync_status,
target_port,
updated_at
;

UPDATE examples​

Updates a custom domain. Backed by the Railway GraphQL mutation customDomainUpdate.

UPDATE railway.networking.custom_domains
SET
target_port = '{{ target_port }}'
WHERE
environment_id = '{{ environment_id }}' --required
AND id = '{{ id }}' --required
RETURNING
result;

DELETE examples​

Deletes a custom domain. Backed by the Railway GraphQL mutation customDomainDelete.

DELETE FROM railway.networking.custom_domains
WHERE
id = '{{ id }}' --required
;

Lifecycle Methods​

Issues a new certificate. Backed by the Railway GraphQL mutation customDomainIssueCertificate.

EXEC railway.networking.custom_domains.issue_certificate
@id='{{ id }}' --required
;