Skip to main content

Resource Identifiers

Tharsis uses two types of identifiers to reference resources: Global IDs and Tharsis Resource Names (TRNs).

Global IDs​

Global IDs are unique identifiers assigned to every resource. They are base64-encoded strings containing a type prefix and UUID:

U0FfZjA5OWVkMmQtNDZmMS00ZmYwLTkyYmItZjAyOTYwNmFjYTVj
↓ base64 decode
SA_f099ed2d-46f1-4ff0-92bb-f029606aca5c

The type prefix (e.g., SA_ for service account, R_ for run) is internal—treat Global IDs as opaque strings.

info

Global IDs and TRNs are typically found in the metadata object of API responses, or sometimes at the top level of a resource.

Use Global IDs when:

  • You have a reference from a previous API call
  • Storing references in external systems
  • The resource path might change

Tharsis Resource Names (TRNs)​

TRNs are human-readable identifiers that encode the resource type and path:

trn:TYPE:PATH

Use TRNs when:

  • You know the resource path but don't have the Global ID
  • Writing scripts or configuration files
  • Running CLI commands
info

For nested resources like runs and jobs, the final path segment is the resource's Global ID. For example: trn:run:my-org/my-workspace/Ul83MWQ...

Supported Types​

TypePath FormatExample
groupparent/childtrn:group:infrastructure/production
workspacegroup-path/workspace-nametrn:workspace:infrastructure/production/web-app
runworkspace-path/run-idtrn:run:infra/prod/web-app/Ul83MWQ...
planworkspace-path/plan-idtrn:plan:infra/prod/web-app/UGxhbl8...
applyworkspace-path/apply-idtrn:apply:infra/prod/web-app/QXBwbH...
jobworkspace-path/job-idtrn:job:infra/prod/web-app/Sm9iXzE...
state_versionworkspace-path/state-version-idtrn:state_version:infra/prod/web-app/U1ZfMT...
configuration_versionworkspace-path/config-version-idtrn:configuration_version:infra/web-app/Q1ZfMT...
managed_identitygroup-path/identity-nametrn:managed_identity:infrastructure/aws-deploy
service_accountgroup-path/service-account-nametrn:service_account:infrastructure/ci-runner
terraform_modulegroup-path/module-name/systemtrn:terraform_module:infra/vpc/aws
terraform_module_versiongroup-path/module-name/system/versiontrn:terraform_module_version:infra/vpc/aws/1.0.0
terraform_providergroup-path/provider-nametrn:terraform_provider:infrastructure/custom
terraform_provider_versiongroup-path/provider-name/versiontrn:terraform_provider_version:infra/custom/1.0.0
terraform_provider_platformgroup-path/provider-name/version/os_archtrn:terraform_provider_platform:infra/custom/1.0.0/linux_amd64
runnergroup-path/runner-nametrn:runner:infrastructure/shared-runner
variablenamespace-path/variable-nametrn:variable:infra/prod/web-app/api_key
vcs_providergroup-path/vcs-provider-nametrn:vcs_provider:infrastructure/github

Which to Use?​

ScenarioRecommended
Storing references long-termGlobal ID
Scripts with known pathsTRN
Following up on API responsesGlobal ID
Human-readable configurationTRN
Resources that might be movedGlobal ID
tip

Most Tharsis APIs and tools accept either format. Use whichever is more convenient for your use case.