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.
Configure the provider
main.tf
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 returns429 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
- API keys - Create the key the provider uses.
- API access - Call the env zero API directly.
- env zero CLI - Manage environments from the terminal.