---
title: "Cloud execution context variables | Grafana Cloud documentation"
description: "You can use three additional environment variables to find out in which load zone, server instance, and distribution label the script is currently running."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Cloud execution context variables

When you run a cloud test, you can use three additional environment variables to find out in which load zone, server instance, and distribution label the script is currently running.

Expand table

| Name                       | Value  | Description                                                                                                                                                                   |
|----------------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `K6_CLOUDRUN_LOAD_ZONE`    | string | The [load zone](/docs/grafana-cloud/testing/k6/author-run/use-load-zones/) from where the metric was collected. Values are in the following format: `amazon:us:ashburn`.      |
| `K6_CLOUDRUN_INSTANCE_ID`  | number | A sequential number representing the unique ID of a load generator server taking part in the test, starts at 0.                                                               |
| `K6_CLOUDRUN_DISTRIBUTION` | string | The value of the [`cloud.distribution` label"](/docs/grafana-cloud/testing/k6/author-run/cloud-scripting-extras/cloud-options/) corresponding to the load generator instance. |
| `K6_CLOUDRUN_TEST_RUN_ID`  | string | The test run ID of the currently running test.                                                                                                                                |

You can read the values of these variables in your k6 script as usual.

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
export const options = {
  vus: 50,
  duration: '30s',
  cloud: {
    distribution: {
      ashburnDistribution: { loadZone: 'amazon:us:ashburn', percent: 50 },
      dublinDistribution: { loadZone: 'amazon:ie:dublin', percent: 50 },
    },
  },
};
export default function () {
  if (__ENV.K6_CLOUDRUN_DISTRIBUTION === 'ashburnDistribution') {
    // do something
  } else if (__ENV.K6_CLOUDRUN_DISTRIBUTION == 'dublinDistribution') {
    // do something
  }
}
```
