Update an External ID
For security purposes, you can update the external ID provided on your DW service unit console. This section guides you on using Terraform to complete this operation.
Use a Terraform script to update an external ID
To use the script, ensure you have obtained the API key that allows you to call Relyt Open API operations.
To obtain an API key, sign in to your Relyt console, choose API Keys from the top navigation bar, and click + API key to create one.
-
Download the latest Terraform script from:
https://github.com/relytcloud/terraform-provider-relyt/tree/main/docs/demo/terraform/modules/relyt
Following is a code snippet example from the module for updating external IDs. You can adjust the parameters according to your needs.
terraform {
required_providers {
relyt = {
source = "relytcloud/relyt"
}
}
}
provider "relyt" {
role = "SYSTEMADMIN"
}
resource "relyt_dwsu_integration_info" "integration_info" {
dwsu_id = "<dwsu_id>"
integration_info = {
external_id = "<external_id>"
}
}Parameter description:
Parameter Description source
The name of the Relyt plugin. It is fixed to relytcloud/relyt
.role
The system role of your Relyt cloud account. It is fixed to SYSTEMADMIN
.dwsu_id
The ID of the DW service unit. external_id
The current external ID.
-
Run the following command to export the auth key.
export RELYT_AUTH_KEY="<api_key>"
Replace
<api_key>
with the API key you have obtained. -
Run the following command to initialize the Terraform working directory.
terraform init
-
Run the following command to apply the module. For details about how to obtain the API key, view the instructions provided at the start of this section.
terraform apply --target=module.integration_info
-
Enter
yes
to confirm the operation.
After the external ID is updated, you can obtain the new external ID by performing the following operations:
-
Sign in to the DW service unit console.
-
Choose Access Control > Output Location or Access Control > Lake Formation.
-
Expand the Configure Cross-Account IAM Role section and copy the value of the External ID field.