Query Endpoints
An endpoint is the URL that serves as the entry point for your DW service unit. To programmatically connect to your DW service unit or its associated resources, you'll need an endpoint.
This guide describes how to use a Terraform script to query available endpoints.
Procedure
-
Download the latest Terraform script.
Following is a code snippet example from the module for creating DW service units. Configure the parameters according to your needs.
terraform {
required_providers {
relyt = {
source = "relytcloud/relyt"
}
}
}
provider "relyt" {
role = "SYSTEMADMIN"
}
data "relyt_cloud_region_endpoints" "endpoint_list" {
cloud = var.cloud
region = var.region
}Field description:
Field Description sourceThe name of the Relyt plugin. It is fixed to relytcloud/relyt.roleThe system role of your Relyt cloud account. It is fixed to SYSTEMADMIN.
-
Run the following command to initialize the Terraform working directory.
terraform initThe operation is successful when similar information appears as shown in the following picture.

-
Run the following command to apply the module.
terraform apply --target=module.relyt_cloud_region_endpoints -
When prompted, enter
yesto confirm the operation. -
When
Apply completeis displayed, run the following command.terraform showInformation similar to the following will be displayed.
In this example, only one endpoint is returned.

Fields returned for each endpoint include:
-
cloud: the cloud provider of the region. It is fixed toaws. -
host: the host name. -
id: a reserved parameter. Ignore this field. -
open: whether the endpoint is public.trueindicates the endpoint is public.falseindicates the endpoint is private and accessible only via private connections. -
port: the port number. -
protocol: the access protocol. -
type: the type of the endpoint. It is fixed toopenapi, indicating that the endpoint is accessible via Open API. -
uri: the URI of the endpoint.
-