Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

ElephantSQL/terraform-provider-elephantsql

Repository files navigation

Terraform provider for ElephantSQL

Setup your ElephantSQL cluster with Terraform. Create your account at https://customer.elephantsql.com/ to get an API key.

Warning

The ElephantSQL service will reach its End of Life on January 27, 2025.

Example

terraform {
  required_providers {
    elephantsql = {
      source = "elephantsql/elephantsql"
    }
  }
}

resource "elephantsql_instance" "sql_hippo" {
  name   = "terraform-provider-test"
  plan   = "hippo"
  region = "amazon-web-services::us-east-1"
}

output "psql_url" {
  sensitive = true
  value = elephantsql_instance.sql_hippo.url
}
export ELEPHANTSQL_APIKEY=<your-key>

terraform init

# Create the database instance
terraform apply -auto-approve

# View the database URL
terraform output -raw psql_url

Use from source

git clone https://github.com/ElephantSQL/terraform-provider-elephantsql.git
cd terraform-provider-elephantsql
make local-install

You can use dev_overrides to make Terraform use your local build:

# save as $HOME/elephantsql-provider-dev.tfrc
provider_installation {
  dev_overrides {
    "elephantsql/elephantsql" = "/home/foo/terraform-provider-elephantsql"
  }
}
TERRAFORM_CONFIG=$HOME/elephantsql-provider-dev.tfrc terraform apply -auto-approve

About

Terraform provider for ElephantSQL

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 8