Setting Environment Variables

Set resource principals in Big Data Service or consume resource principal session tokens.

The OCI SDK client or any other client that must use a resource principal, uses environment variables to read required values to consume resource principal session token. These environment variables must be set before consuming the resource principal session token.
Update the following environment variables:
  • OCI_RESOURCE_PRINCIPAL_VERSION: The resource principal version. The exact value can be read from OCI RPST Conf Path.
  • OCI_RESOURCE_PRINCIPAL_REGION: The region where the resource principal is created. The exact value can be read from OCI RPST Conf Path.
  • OCI_RESOURCE_PRINCIPAL_PRIVATE_PEM: The absolute path of private key file for resource principal. The path is the same as the OCI RPST Pem Path.
  • OCI_RESOURCE_PRINCIPAL_RPST: The absolute path of resource principal session token. The path is the same as the OCI RPST Path.

Example:

OCI_RESOURCE_PRINCIPAL_VERSION=2.2
OCI_RESOURCE_PRINCIPAL_PRIVATE_PEM=/etc/security/tokens/rpst.pem
OCI_RESOURCE_PRINCIPAL_REGION=us-region-1
OCI_RESOURCE_PRINCIPAL_RPST=/etc/security/tokens/rpst.token