Skip to main content

egress_gateways

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

Overview​

Nameegress_gateways
TypeResource
Idrailway.networking.egress_gateways

Fields​

The following fields are returned by SELECT queries:

One row per EgressGateway.

NameDatatypeDescription
ipv4string
regionstring
zonestring

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectenvironment_id, service_idAll egress gateways assigned to a service instance. Backed by the Railway GraphQL query egressGateways.
createinsertenvironment_id, service_idCreate a new egress gateway association for a service instance. Backed by the Railway GraphQL mutation egressGatewayAssociationCreate.
cleardeleteenvironment_id, service_idall_environmentsClear all egress gateway associations for a service instance. Backed by the Railway GraphQL mutation egressGatewayAssociationsClear.
preview_ha_migrationexecenvironment_id, service_idall_environmentsPreview the HA static egress IPs that would be assigned, without applying them. Set allEnvironments to cover all of the service's environments. Backed by the Railway GraphQL mutation egressGatewayHAMigrationPreview.
rollback_from_haexecenvironment_id, service_idall_environmentsSwitch a service from HA static egress IPs back to a standard static IP. Set allEnvironments to apply to all of the service's environments. Backed by the Railway GraphQL mutation egressGatewayRollbackFromHA.
upgrade_to_haexecenvironment_id, service_idall_environmentsEnable HA static egress IPs for a service. Set allEnvironments to apply to all of the service's environments. Backed by the Railway GraphQL mutation egressGatewayUpgradeToHA.

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
service_idstring
all_environmentsboolean

SELECT examples​

All egress gateways assigned to a service instance. Backed by the Railway GraphQL query egressGateways.

SELECT
ipv4,
region,
zone
FROM railway.networking.egress_gateways
WHERE environment_id = '{{ environment_id }}' -- required
AND service_id = '{{ service_id }}' -- required
;

INSERT examples​

Create a new egress gateway association for a service instance. Backed by the Railway GraphQL mutation egressGatewayAssociationCreate.

INSERT INTO railway.networking.egress_gateways (
environment_id,
region,
service_id
)
SELECT
'{{ environment_id }}' /* required */,
'{{ region }}',
'{{ service_id }}' /* required */
RETURNING
ipv4,
region,
zone
;

DELETE examples​

Clear all egress gateway associations for a service instance. Backed by the Railway GraphQL mutation egressGatewayAssociationsClear.

DELETE FROM railway.networking.egress_gateways
WHERE
environment_id = '{{ environment_id }}' --required
AND service_id = '{{ service_id }}' --required
AND all_environments = '{{ all_environments }}'
;

Lifecycle Methods​

Preview the HA static egress IPs that would be assigned, without applying them. Set allEnvironments to cover all of the service's environments. Backed by the Railway GraphQL mutation egressGatewayHAMigrationPreview.

EXEC railway.networking.egress_gateways.preview_ha_migration
@environment_id='{{ environment_id }}', --required
@service_id='{{ service_id }}', --required
@all_environments='{{ all_environments }}'
;