Skip to content

jmtx1020/terraform-provider-quicknode

Repository files navigation

Terraform Provider QuickNode

Using the provider

Configuring the Provider

terraform {
  required_providers {
    quicknode = {
      source = "jmtx1020/quicknode"
      version = "0.0.1"
    }
  }
}

provider "quicknode" {
  host  = "https://api.quicknode.com"
  token = "TOKEN_VALUE"
}

The provider can also read environment variables for those values, if you configure it like this:

provider "quicknode" {}

Then run the terraform as follows:

QUICKNODE_API_HOST='https://api.quicknode.com' \
QUICKNODE_API_TOKEN='<TOKEN_VALUE>' \
terraform apply

Associated documentation for all resources and datasources can be found here on the terraform registry.

Creating Resources

resource "quicknode_destination" "destination" {
  name         = "dest"
  to           = var.endpoint_url
  webhook_type = "POST"
  service      = "webhook"
  payload_type = 1
}

# retrieves one destination by id
data "quicknode_destination" "dest" {
  id = resource.quicknode_destination.destination.id
}

# retrieves all destinations
data "quicknode_notifications" "dests" {}


resource "quicknode_notification" "test" {
  name            = var.notification_name
  network         = "ethereum-mainnet"
  expression      = "dHhfdG8gPT0gJzB4ZDhkYTZiZjI2OTY0YWY5ZDdlZWQ5ZTAzZTUzNDE1ZDM3YWE5NjA0Nic="
  destination_ids = [resource.quicknode_destination.destination.id]
  enabled         = true
}

# retrieves one destination by id
data "quicknode_notification" "notification" {
  id = resource.quicknode_notification.test.id
}

# gets all notifications
data "quicknode_notifications" "notifications" {}

# creates a gateway
resource "quicknode_gateway" "gateway" {
  name    = var.gateway_name
  private = true
  enabled = false
}

# gets one one gateway by name
data "quicknode_gateway" "gateway" {
  name = resource.quicknode_gateway.gateway.name
}

# gets all gateways
data "quicknode_gateways" "gateways" {}

Requirements

Building The Provider

  1. Clone the repository
  2. Enter the repository directory
  3. Build the provider using the Go install command:
go install

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages