Skip to Content
Envault

Resource References

Use the address of a container or database in a secret value without copying it.

Reference a resource address

A value in Application Secrets, Workspace Defaults or Shared Secrets can contain the address of a Container, Memory Store or Relational Database in the same workspace:

  • ${resource.<name>.internal_domain}: the hostname on the project network.
  • ${resource.<name>.external_domain_default}: the public hostname the platform assigns.
  • ${resource.<name>.external_domain_custom}: the primary custom domain of a container.
  • ${resource.<name>.internal_connection_url}: the full connection URL on the project network, including the user name and password (Memory Store and Relational Database).
  • ${resource.<name>.external_connection_url}: the full public connection URL, including the user name and password (Memory Store and PostgreSQL).

<name> is the resource name, which is unique in the workspace and cannot be changed. A reference can be part of a longer value, for example postgresql://${resource.orders-db.internal_domain}:5432/orders or https://${resource.web-api.external_domain_custom}/v1.

Type ${ in a value to see suggestions. The list contains the resources you can read in the workspace, and only the fields each resource provides. A saved reference links to its resource.

Values

Resourceinternal_domainexternal_domain_defaultexternal_domain_custom
ContainerInternal hostname shown in OverviewDefault domain, when it is enabledPrimary custom domain
Memory StoreInternal hostname from ConnectionExternal hostname from ConnectionNot available
Relational DatabaseInternal hostname from ConnectionExternal hostname from Connection (PostgreSQL only)Not available

external_domain_custom is the custom domain marked Primary in the container's Domain & DNS page. When none is marked, it is the connected custom domain that was added first. A custom domain that is not connected yet is never used; without a connected custom domain the reference fails.

external_domain is the earlier name of external_domain_default. Saved values that use it keep working.

The connection URL fields have the same value as the connection string in Connection for the first active customer account. Examples: postgresql://<user>:<password>@<host>:5432/<database>?sslmode=require, mysql://<user>:<password>@<host>:3306/<database>?ssl=true, rediss://<user>:<password>@<host>:6379. Containers have no connection URL. MariaDB has no external_connection_url.

When references are resolved

References are replaced when values are delivered: on container creation, start and redeployment, and on rdc envault export. Envault keeps the reference text, so revealing or editing a value shows ${resource.…}, never the password. A plain Restart keeps the previously delivered values. If a resource address changes or its password is rotated, redeploy the containers that use it.

The user or service account that deploys or exports must be able to read the referenced resource in the resource's project:

FieldRequired access
internal_domainInstance read
external_domain_default, external_domain_customDomain read
internal_connection_url, external_connection_urlCredential read (General Admin or Owner, Memory Store Admin or Relational Database Admin)

General Editors can deploy containers but cannot read credentials, so their deployments fail when its values use a connection URL.

Errors

Delivery stops and no values are delivered when a reference cannot be resolved.

ErrorWhat to check
RESOURCE_REFERENCE_INVALIDUse a lowercase resource name and one of the four fields above. Any other ${resource. text is rejected.
RESOURCE_REFERENCE_NOT_FOUNDCheck that a resource with the name exists in this workspace and has not been deleted.
RESOURCE_REFERENCE_UNAVAILABLEThe resource has no value for this field, for example a disabled default domain, a MariaDB external address, a container without an internal hostname, a connection URL for a container or a database without an active customer account.
Permission deniedAsk an administrator for read access to the referenced resource's project.