Component environment variable reference
The Amazon IoT Greengrass Core software sets environment variables when it runs lifecycle scripts for components. You can get these environment variables in your components to get the thing name, Amazon Web Services Region, and Greengrass nucleus version. The software also sets environment variables that your component requires to use the interprocess communication SDK and to interact with Amazon services.
You can also set custom environment variables for your component's lifecycle scripts. For more information, see Setenv.
The Amazon IoT Greengrass Core software sets the following environment variables:
AWS_IOT_THING_NAME
-
The name of the Amazon IoT thing that represents this Greengrass core device.
AWS_REGION
-
The Amazon Web Services Region where this Greengrass core device operates.
The Amazon SDKs use this environment variable to identify the default Region to use. This variable is equivalent to
AWS_DEFAULT_REGION
. AWS_DEFAULT_REGION
-
The Amazon Web Services Region where this Greengrass core device operates.
The Amazon CLI uses this environment variable to identify the default Region to use. This variable is equivalent to
AWS_REGION
. GGC_VERSION
-
The version of the Greengrass nucleus component that runs on this Greengrass core device.
GG_ROOT_CA_PATH
-
This feature is available for v2.5.5 and later of the Greengrass nucleus component.
The path to the root certificate authority (CA) certificate that the Greengrass nucleus uses.
AWS_GG_NUCLEUS_DOMAIN_SOCKET_FILEPATH_FOR_COMPONENT
-
The path to the IPC socket that components use to communicate with the Amazon IoT Greengrass Core software. For more information, see Use the Amazon IoT Device SDK to communicate with the Greengrass nucleus, other components, and Amazon IoT Core.
SVCUID
-
The secret token that components use to connect to the IPC socket and communicate with the Amazon IoT Greengrass Core software. For more information, see Use the Amazon IoT Device SDK to communicate with the Greengrass nucleus, other components, and Amazon IoT Core.
AWS_CONTAINER_AUTHORIZATION_TOKEN
-
The secret token that components use to retrieve credentials from the token exchange service component.
AWS_CONTAINER_CREDENTIALS_FULL_URI
-
The URI that components request to retrieve credentials from the token exchange service component.