Skip to main content
The env zero Terraform provider (env0/env0) manages env zero itself as code: projects, templates, environments, variables, credentials, agents, and policies. It works with Terraform and OpenTofu. For every resource and data source, see the Terraform Registry or the OpenTofu Registry.

Prerequisites

  • Terraform or OpenTofu installed.
  • An env zero API key ID and secret.
The key’s role decides what the provider can manage. For example, a read-only key can read but not create.

Configure the provider

main.tf
Check the registry for the latest release. Set the API key in environment variables instead of the provider block, so it stays out of your code:
To run the provider from an env zero environment, set ENV0_API_KEY and ENV0_API_SECRET as sensitive environment variables on the environment or its project. See Secrets. env zero sets ENV0_ORGANIZATION_ID in every deployment, so the provider uses the environment’s organization.

Rate limits

Each provider process keeps its own request rate under the API rate limits. The API counts requests per source IP, so parallel runs from one IP share the limit and can exceed it together. If the API still returns 429 Too Many Requests, the provider pauses requests to that method and path, then retries with an increasing wait. It retries a request up to 10 times, so a large plan runs slower instead of failing on the first 429.

Common tasks

Next steps