Terraform + Elido — short links as infrastructure code
Declare, version, and deploy short links with terraform-provider-elido. Plan before you change. Roll back with git revert. No competitor ships a Terraform provider.
What you can do
Links that belong in version control
How it works
HCL → Elido REST API → live redirect
The provider wraps the Elido REST API using Plugin Framework CRUD operations. On terraform apply, it calls POST /v1/workspaces/{id}/linksand stores the returned link ID in Terraform state. Updates and destroys call the matching PATCH / DELETE endpoints. The redirect goes live at edge within seconds.
elido_link resource with slug + destination_url
Preview creates, updates, and destroys before applying
Provider calls REST API; redirect goes live at edge
Setup guide
Three steps to your first managed link
- 1Pin the provider
Add a required_providers block to your root module or a providers.tf file.
terraform { required_providers { elido = { source = "elidoapp/elido" version = "~> 0.1" } } } - 2Configure auth
Export your Elido workspace API token. The provider picks it up automatically — no provider block configuration needed.
export ELIDO_API_TOKEN=ek_... - 3Declare a link
Write your first elido_link resource, run terraform plan to preview, then apply.
resource "elido_link" "spring_campaign" { workspace_id = 42 domain_id = 1 slug = "spring-2026" destination_url = "https://example.com/landing/spring" }
Authentication
API token — environment variable, never in state
Generate a workspace API token in /dashboard/api-keys with links:read links:write scopes. Export it as ELIDO_API_TOKEN in your shell or CI secret store. The provider reads this variable at runtime — the token is never written into Terraform state or plan output. You can rotate tokens without touching your HCL. Tokens are encrypted at rest with your workspace's KMS key on the Elido side.
For CI, store ELIDO_API_TOKEN as a masked/secret environment variable in your CI provider (GitHub Actions secret, Terraform Cloud variable set, Atlantis env). Never commit it to source control.
Frequently asked questions
Is terraform-provider-elido open source?+
Yes. The provider is published on the Terraform Registry under elidoapp/elido and the source is available on GitHub. Community contributions and issues are welcome.
Which Terraform and OpenTofu versions are supported?+
The provider targets Terraform >= 1.5 and OpenTofu >= 1.6. It uses the Terraform Plugin Framework (not the older SDK), so it is compatible with both. Pin ~> 0.1 in your required_providers block.
Can I import existing Elido links into Terraform state?+
Yes. Run terraform import elido_link.<name> <link_id> to pull an existing link into state without recreating it. The link ID appears in the Elido dashboard URL and in the API response.
How do I rotate the API token without destroying links?+
Generate a new workspace API token in /dashboard/api-keys, update the ELIDO_API_TOKEN environment variable in your CI/CD secret store, and re-run your pipeline. The token is not embedded in state — only the resource attributes are.
What happens if two Terraform runs race on the same slug?+
The Elido API returns HTTP 409 Conflict on duplicate slug within the same domain. Terraform will surface this as an apply error. Use unique slugs or a workspace-level namespace prefix to avoid collisions.
Stop managing links outside your infrastructure
Free plan included. No card required.