Elido
← Integrations
Beta

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

Links live in your repo
Declare short links as HCL resources alongside your infrastructure. PRs, code review, blame history, and rollback all work exactly like for any other Terraform resource.
Plan before you change
terraform plan shows what will be created, updated, or destroyed — including destination URL changes — before a single redirect is modified in production.
CI/CD native
Drop into any Terraform Cloud, Atlantis, or GitHub Actions pipeline. The provider reads ELIDO_API_TOKEN from the environment — no extra setup in CI.
No competitor ships one
Bitly, Short.io, Rebrandly, and Dub have no Terraform provider. If your team manages infrastructure as code, Elido is the only link-shortener that fits the workflow.

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.

HCL resourceelido_link.tfterraform applyprovider calls REST APIElido APIlink created / updatedEdge live<5 s
1
Write HCL

elido_link resource with slug + destination_url

2
terraform plan

Preview creates, updates, and destroys before applying

3
terraform apply

Provider calls REST API; redirect goes live at edge

Setup guide

Three steps to your first managed link

  1. 1
    Pin 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"
        }
      }
    }
  2. 2
    Configure auth

    Export your Elido workspace API token. The provider picks it up automatically — no provider block configuration needed.

    export ELIDO_API_TOKEN=ek_...
  3. 3
    Declare 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.

Terraform + Elido — Manage short links as infrastructure code · Elido