| page_title | Quicknode Provider |
|---|---|
| description | Manage Quicknode RPC endpoints, security rules and rate limits with Terraform. |
Manage your Quicknode blockchain infrastructure as code: RPC endpoints, security
rules, and rate limits, through terraform plan and terraform apply.
The provider authenticates with a Quicknode API key, available on paid plans. Set it in the environment, not in a configuration file:
export QUICKNODE_API_KEY="your-api-key"terraform {
required_providers {
quicknode = {
source = "quicknode/quicknode"
version = "~> 0.4.0"
}
}
}
# Reads the API key from QUICKNODE_API_KEY. Set api_key here to override it.
provider "quicknode" {}- How to Manage Quicknode Infrastructure as Code with Terraform: a step-by-step walkthrough of setting up the provider and managing endpoints.
| Resource | Manages |
|---|---|
quicknode_endpoint |
the endpoint itself, its label, status, tags and which security mechanisms it enforces |
quicknode_endpoint_ip, _domain_mask, _referrer |
who is allowed to call it |
quicknode_endpoint_jwt |
signing keys, for authenticating without a token in the URL |
quicknode_endpoint_token |
additional auth tokens, so one consumer can be revoked without disturbing the rest |
quicknode_endpoint_request_filter |
which RPC methods it accepts |
quicknode_endpoint_rate_limits, _method_rate_limit |
how much traffic it accepts, overall and per method |
data.quicknode_endpoint, data.quicknode_endpoints |
endpoints created elsewhere |
data.quicknode_endpoint_urls |
an endpoint's working URLs, including every network of a multichain endpoint |
data.quicknode_chains |
every chain and network slug, for validating configuration at plan time |
A security mechanism is enabled on the endpoint and the entries it applies to are separate resources, so an entry added outside Terraform is left alone rather than deleted on the next apply.
The Admin API returns endpoint URLs with the auth token embedded in the path. The provider exposes two forms:
| Attribute | Sensitive | Where | Use it for |
|---|---|---|---|
http_url_with_token, wss_url_with_token |
yes | data.quicknode_endpoint_urls, quicknode_endpoint_token |
anything that makes RPC calls |
safe_http_url, safe_wss_url |
no | quicknode_endpoint and the data sources |
logging, display, anything that must not hold a credential |
The URL the Admin API returns carries one of the endpoint's tokens, and which
one changes as tokens are added and removed. So quicknode_endpoint only keeps
the safe form, and the working URLs are read from data.quicknode_endpoint_urls
or taken from the quicknode_endpoint_token that issued the credential.
The safe form carries the literal REPLACE_WITH_TOKEN where the credential belongs:
https://example-name.hype-testnet.quiknode.pro/REPLACE_WITH_TOKEN/evm
It keeps the real URL's shape, so substituting a token reproduces a working address on every chain:
replace(quicknode_endpoint.api.safe_http_url, "REPLACE_WITH_TOKEN", var.token)Do not assemble a URL from parts instead. The token is not always the last path segment — some chains append a suffix after it, as above — so a hand-built URL works on Ethereum and breaks elsewhere.
Token values are written to Terraform state. Use encrypted remote state.
api_key(String, Sensitive) Quicknode API key. Defaults to theQUICKNODE_API_KEYenvironment variable. Prefer the environment variable so the key stays out of configuration and state.base_url(String) Quicknode API base URL. Defaults tohttps://api.quicknode.com.requests_per_second(Number) Throttle applied to Quicknode API calls. A large workspace bursts many calls during one apply, so the provider paces itself.