> For the complete documentation index, see [llms.txt](https://docs.terrakube.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.terrakube.io/2.34.0/reference/configuration/executor.md).

# Executor

Environment variables of the Terrakube **Executor**. See [Configuration Reference](/2.34.0/reference/configuration.md) for how to set them. An empty default means the variable has no default: either it is optional or it must be provided.

### Terraform CLI Settings

| Variable                     | Default                              | Description                                               |
| ---------------------------- | ------------------------------------ | --------------------------------------------------------- |
| `TerrakubeEnableColorOutput` | `true`                               | Sets `io.terrakube.terraform.flags.enableColor`.          |
| `CustomTerraformReleasesUrl` |                                      | Sets `io.terrakube.terraform.flags.terraformReleasesUrl`. |
| `CustomTofuReleasesUrl`      | `${AzBuilderApiUrl}/tofu/index.json` | Sets `io.terrakube.terraform.flags.tofuReleasesUrl`.      |

### General Settings Executor

| Variable                                           | Default    | Description                                                                                                                                                                |
| -------------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `EphemeralFlagBatch`                               | `false`    | This will be the new flag used to trigger the ephemeral jobs                                                                                                               |
| `EphemeralJobData`                                 |            | Sets `io.terrakube.executor.flags.ephemeralJobData`.                                                                                                                       |
| `ExecutorFlagDisableAcknowledge`                   | `false`    | Sets `io.terrakube.executor.flags.disableAcknowledge`.                                                                                                                     |
| `ExecutorAsyncStructuredOutput`                    | `true`     | Structured plan/apply output: persist context via a bounded async queue off the terraform process-output reader thread (set false for the previous synchronous behaviour). |
| `ExecutorStructuredOutputRecovery`                 | `true`     | Sets `io.terrakube.executor.flags.structuredOutputRecovery`.                                                                                                               |
| `ExecutorStructuredOutputQueueCapacity`            | `256`      | Sets `io.terrakube.executor.structured-output.queue-capacity`.                                                                                                             |
| `ExecutorStructuredOutputQueueMaxBytes`            | `67108864` | Sets `io.terrakube.executor.structured-output.queue-max-bytes`.                                                                                                            |
| `ExecutorStructuredOutputMaxPersistAttempts`       | `4`        | Sets `io.terrakube.executor.structured-output.max-persist-attempts`.                                                                                                       |
| `ExecutorStructuredOutputInitialBackoffMs`         | `250`      | Sets `io.terrakube.executor.structured-output.initial-backoff-ms`.                                                                                                         |
| `ExecutorStructuredOutputMaxBackoffMs`             | `4000`     | Sets `io.terrakube.executor.structured-output.max-backoff-ms`.                                                                                                             |
| `ExecutorStructuredOutputDrainTimeoutMs`           | `30000`    | Sets `io.terrakube.executor.structured-output.drain-timeout-ms`.                                                                                                           |
| `ExecutorStructuredOutputRecoveryRetentionMs`      | `600000`   | Sets `io.terrakube.executor.structured-output.recovery-retention-ms`.                                                                                                      |
| `ExecutorStructuredOutputRecoveryInitialDelayMs`   | `15000`    | Sets `io.terrakube.executor.structured-output.recovery-initial-delay-ms`.                                                                                                  |
| `ExecutorStructuredOutputRecoveryMaxDelayMs`       | `60000`    | Sets `io.terrakube.executor.structured-output.recovery-max-delay-ms`.                                                                                                      |
| `ExecutorStructuredOutputRecoveryMaxRetained`      | `64`       | Sets `io.terrakube.executor.structured-output.recovery-max-retained`.                                                                                                      |
| `ExecutorStructuredOutputRecoveryMaxRetainedBytes` | `67108864` | Sets `io.terrakube.executor.structured-output.recovery-max-retained-bytes`.                                                                                                |
| `ExecutorContextConnectTimeoutMs`                  | `5000`     | Executor -> API /context/v1 HTTP timeouts (separate from object-storage timeouts).                                                                                         |
| `ExecutorContextReadTimeoutMs`                     | `15000`    | Sets `io.terrakube.executor.context.read-timeout-ms`.                                                                                                                      |
| `ExecutorJobMaxDurationMinutes`                    | `360`      | Ceiling for a single job before the pod is marked unhealthy (watchdog for a wedged terraform/hook process)                                                                 |

### State/Output Type

| Variable             | Default | Description                                       |
| -------------------- | ------- | ------------------------------------------------- |
| `TerraformStateType` |         | Sets `io.terrakube.executor.plugin.tfstate.type`. |

### Storage Azure State

| Variable                                  | Default | Description                                                             |
| ----------------------------------------- | ------- | ----------------------------------------------------------------------- |
| `AzureTerraformStateResourceGroup`        |         | Sets `io.terrakube.executor.plugin.tfstate.azure.resourceGroupName`.    |
| `AzureTerraformStateStorageAccountName`   |         | Sets `io.terrakube.executor.plugin.tfstate.azure.storageAccountName`.   |
| `AzureTerraformStateStorageContainerName` |         | Sets `io.terrakube.executor.plugin.tfstate.azure.storageContainerName`. |
| `AzureTerraformStateStorageAccessKey`     |         | Sets `io.terrakube.executor.plugin.tfstate.azure.storageAccessKey`.     |
| `AzureTerraformStateStorageAccessKeyFile` |         | Sets `io.terrakube.executor.plugin.tfstate.azure.storageAccessKeyFile`. |

### Storage Aws State

| Variable                         | Default | Description                                                                                                |
| -------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------- |
| `AwsTerraformStateAccessKey`     |         | Sets `io.terrakube.executor.plugin.tfstate.aws.accessKey`.                                                 |
| `AwsTerraformStateAccessKeyFile` |         | Sets `io.terrakube.executor.plugin.tfstate.aws.accessKeyFile`.                                             |
| `AwsTerraformStateSecretKey`     |         | Sets `io.terrakube.executor.plugin.tfstate.aws.secretKey`.                                                 |
| `AwsTerraformStateSecretKeyFile` |         | Sets `io.terrakube.executor.plugin.tfstate.aws.secretKeyFile`.                                             |
| `AwsTerraformStateBucketName`    |         | Sets `io.terrakube.executor.plugin.tfstate.aws.bucketName`.                                                |
| `AwsTerraformStateRegion`        |         | Sets `io.terrakube.executor.plugin.tfstate.aws.region`.                                                    |
| `AwsEndpoint`                    |         | Sets `io.terrakube.executor.plugin.tfstate.aws.endpoint`.                                                  |
| `AwsIncludeBackendKeys`          | `true`  | Sets `io.terrakube.executor.plugin.tfstate.aws.includeBackendKeys`.                                        |
| `AwsEnableRoleAuth`              | `false` | Sets `io.terrakube.executor.plugin.tfstate.aws.enableRoleAuthentication`.                                  |
| `AwsUseLockfile`                 | `false` | Sets `io.terrakube.executor.plugin.tfstate.aws.useLockfile`.                                               |
| `AwsEndpointRegion`              | `auto`  | S3-compatible backends (Qumulo, MinIO, ...) that need a real signing region or no chunked/checksum support |
| `AwsPathStyleAccess`             | `true`  | Sets `io.terrakube.executor.plugin.tfstate.aws.pathStyleAccessEnabled`.                                    |
| `AwsChunkedEncodingEnabled`      | `true`  | Sets `io.terrakube.executor.plugin.tfstate.aws.chunkedEncodingEnabled`.                                    |
| `AwsChecksumValidationEnabled`   | `true`  | Sets `io.terrakube.executor.plugin.tfstate.aws.checksumValidationEnabled`.                                 |

### Storage Gcp State

| Variable                           | Default | Description                                                      |
| ---------------------------------- | ------- | ---------------------------------------------------------------- |
| `GcpTerraformStateCredentials`     |         | Sets `io.terrakube.executor.plugin.tfstate.gcp.credentials`.     |
| `GcpTerraformStateCredentialsFile` |         | Sets `io.terrakube.executor.plugin.tfstate.gcp.credentialsFile`. |
| `GcpTerraformStateBucketName`      |         | Sets `io.terrakube.executor.plugin.tfstate.gcp.bucketName`.      |
| `GcpTerraformStateProjectId`       |         | Sets `io.terrakube.executor.plugin.tfstate.gcp.projectId`.       |

### Security

| Variable                   | Default | Description                                |
| -------------------------- | ------- | ------------------------------------------ |
| `TerrakubeEnableSecurity`  |         | Sets `io.terrakube.client.enableSecurity`. |
| `AzBuilderApiUrl`          |         | Sets `io.terrakube.client.url`.            |
| `InternalSecret`           |         | Sets `io.terrakube.client.secretKey`.      |
| `InternalSecretFile`       |         | Sets `io.terrakube.client.secretKeyFile`.  |
| `ExecutorSecretsDirectory` |         | Ephemeral secret loading configuration     |
| `ExecutorSecretsFile`      |         | Sets `io.terrakube.executor.secrets.file`. |

### Terrakube Extension Repository

| Variable                   | Default | Description                           |
| -------------------------- | ------- | ------------------------------------- |
| `TerrakubeToolsRepository` |         | Sets `io.terrakube.tools.repository`. |
| `TerrakubeToolsBranch`     |         | Sets `io.terrakube.tools.branch`.     |

### Terrakube Domains/URL

| Variable                  | Default | Description                          |
| ------------------------- | ------- | ------------------------------------ |
| `TerrakubeRegistryDomain` |         | Sets `io.terrakube.registry.domain`. |
| `TerrakubeApiUrl`         |         | Sets `io.terrakube.api.url`.         |

### REDIS

| Variable                               | Default | Description                                                |
| -------------------------------------- | ------- | ---------------------------------------------------------- |
| `TerrakubeRedisHostname`               |         | Sets `io.terrakube.executor.redis.hostname`.               |
| `TerrakubeRedisTimeout`                | `10000` | Sets `io.terrakube.executor.redis.timeout`.                |
| `TerrakubeRedisPort`                   |         | Sets `io.terrakube.executor.redis.port`.                   |
| `TerrakubeRedisUsername`               |         | Sets `io.terrakube.executor.redis.username`.               |
| `TerrakubeRedisPassword`               |         | Sets `io.terrakube.executor.redis.password`.               |
| `TerrakubeRedisPasswordFile`           |         | Sets `io.terrakube.executor.redis.passwordFile`.           |
| `TerrakubeRedisSSL`                    | `false` | Sets `io.terrakube.executor.redis.ssl`.                    |
| `TerrakubeRedisTruststorePath`         |         | Sets `io.terrakube.executor.redis.truststorePath`.         |
| `TerrakubeRedisTruststorePassword`     |         | Sets `io.terrakube.executor.redis.truststorePassword`.     |
| `TerrakubeRedisTruststorePasswordFile` |         | Sets `io.terrakube.executor.redis.truststorePasswordFile`. |
| `TerrakubeRedisClusterNodes`           |         | Sets `io.terrakube.executor.redis.cluster.nodes`.          |
| `TerrakubeRedisClusterMaxRedirects`    | `0`     | Sets `io.terrakube.executor.redis.cluster.max-redirects`.  |
| `TerrakubeRedisSentinelMaster`         |         | Sets `io.terrakube.executor.redis.sentinel.master`.        |
| `TerrakubeRedisSentinelNodes`          |         | Sets `io.terrakube.executor.redis.sentinel.nodes`.         |
| `TerrakubeRedisSentinelUsername`       |         | Sets `io.terrakube.executor.redis.sentinel.username`.      |
| `TerrakubeRedisSentinelPassword`       |         | Sets `io.terrakube.executor.redis.sentinel.password`.      |
| `TerrakubeRedisSentinelPasswordFile`   |         | Sets `io.terrakube.executor.redis.sentinel.passwordFile`.  |

### Save Terraform logs via API

| Variable                                  | Default    | Description                                                                                                                                                                        |
| ----------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `LogViaApi`                               | `false`    | Sets `io.executor.log-via-api`.                                                                                                                                                    |
| `ExecutorLogsRedisMaxLen`                 | `200000`   | Approximate cap on the per-job live-log Redis stream (\~200k lines) so a huge apply can't exhaust ElastiCache. The complete log is always persisted to object storage at step end. |
| `ExecutorLogsEchoToServiceLog`            | `false`    | Sets `io.terrakube.executor.logs.echoToServiceLog`.                                                                                                                                |
| `ExecutorLogsLiveLineMaxBytes`            | `65536`    | Sets `io.terrakube.executor.logs.liveLineMaxBytes`.                                                                                                                                |
| `ExecutorLogsApiQueueMaxBytes`            | `16777216` | Sets `io.terrakube.executor.logs.apiQueueMaxBytes`.                                                                                                                                |
| `ExecutorLogsApiBatchMaxBytes`            | `1048576`  | Sets `io.terrakube.executor.logs.apiBatchMaxBytes`.                                                                                                                                |
| `ExecutorLogsStepOutputMemoryBytes`       | `4194304`  | Sets `io.terrakube.executor.logs.stepOutputMemoryBytes`.                                                                                                                           |
| `ExecutorLogsRenderedPlanContextMaxBytes` | `49152`    | Sets `io.terrakube.executor.logs.renderedPlanContextMaxBytes`.                                                                                                                     |
| `ExecutorLogsArchiveEnabled`              | `true`     | Sets `io.terrakube.executor.logs.archiveEnabled`.                                                                                                                                  |
| `ExecutorLogsArchivePartBytes`            | `1048576`  | Sets `io.terrakube.executor.logs.archivePartBytes`.                                                                                                                                |
| `ExecutorLogsArchiveIntervalSeconds`      | `30`       | Sets `io.terrakube.executor.logs.archiveIntervalSeconds`.                                                                                                                          |
| `ExecutorLogsArchiveMaxParts`             | `1000`     | Sets `io.terrakube.executor.logs.archiveMaxParts`.                                                                                                                                 |

### OPA EVALUATION

| Variable                     | Default     | Description                                        |
| ---------------------------- | ----------- | -------------------------------------------------- |
| `ExecutorOpaConcurrencyCore` | `8`         | Sets `io.terrakube.executor.opa.concurrency.core`. |
| `ExecutorOpaConcurrencyMax`  | `16`        | Sets `io.terrakube.executor.opa.concurrency.max`.  |
| `ExecutorOpaDefaultVersion`  | `1.20.2`    | Sets `io.terrakube.executor.opa.default-version`.  |
| `ExecutorArtifactsMaxBytes`  | `536870912` | Sets `io.terrakube.executor.artifacts.max-bytes`.  |
| `ExecutorArtifactsMaxFiles`  | `10000`     | Sets `io.terrakube.executor.artifacts.max-files`.  |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.terrakube.io/2.34.0/reference/configuration/executor.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
