Giter VIP home page Giter VIP logo

terraform-provider-singlestoredb's Introduction

Terraform Provider for SingleStoreDB Cloud

Unit Integration Go Report Card codecov License

terraform-provider-singlestoredb is a Terraform provider for managing resources on SingleStoreDB Cloud. This provider enables you to manage resources such as Workspace Groups and Workspaces seamlessly with your Terraform workflow.

Important: This Terraform provider is currently in the preview phase and is subject to change.

Prerequisites

To use this provider, ensure you have the following:

Provider Setup

To set up the provider, first export the generated API key to the SINGLESTOREDB_API_KEY environment variable:

export SINGLESTOREDB_API_KEY="paste your generated SingleStoreDB API key here"

Then, to specify the SingleStoreDB provider for use in your Terraform configuration, you will need to add a required_providers block. The easiest way to get the correct required_providers block is to visit the SingleStoreDB provider page on the Terraform Registry. Click the "USE PROVIDER" button to see and copy the required_providers block with the latest version of the provider. Paste this block into your Terraform configuration file.

Here is a general template of how the required_providers block and provider block might look in your Terraform configuration:

terraform {
  required_providers {
    singlestoredb = {
      source = "singlestore-labs/singlestoredb"
      # Visit the link above to get the latest version.
    }
  }
}

provider "singlestoredb" {
  # Configuration options.
}

The required_providers block specifies that your configuration will be using the SingleStoreDB provider, and the provider block is where you can specify any necessary configuration options for the provider.

Example Usage

The provider offers a variety of data sources and resources for managing SingleStoreDB. Here's a sample usage that demonstrates creating and managing a workspace:

provider "singlestoredb" {
  // The SingleStoreDB Terraform provider uses the SINGLESTOREDB_API_KEY environment variable for authentication.
  // Please set this environment variable with your SingleStore Management API key.
  // You can generate this key from the SingleStore Portal at https://portal.singlestore.com/organizations/org-id/api-keys.
}

data "singlestoredb_regions" "all" {}

resource "singlestoredb_workspace_group" "example" {
  name            = "group"
  firewall_ranges = ["0.0.0.0/0"] // Ensure restrictive ranges for production environments.
  expires_at      = "2222-01-01T00:00:00Z"
  region_id       = data.singlestoredb_regions.all.regions.0.id // Prefer specifying the explicit region ID in production environments as the list of regions may vary.
}

resource "singlestoredb_workspace" "this" {
  name               = "workspace"
  workspace_group_id = singlestoredb_workspace_group.example.id
  size               = "S-00"
  suspended          = false
}

output "endpoint" {
  value = singlestoredb_workspace.this.endpoint
}

output "admin_password" {
  value     = singlestoredb_workspace_group.example.admin_password
  sensitive = true
}

To try this example, follow these steps:

  1. Create the workspace:

    terraform apply
  2. Connect to the new workspace:

    export endpoint=$(terraform output -raw endpoint)
    export admin_password=$(terraform output -raw admin_password)
    mysql -u admin -h $endpoint -P 3306 --default-auth=mysql_native_password --password=$admin_password -e 'select 1'
  3. Terminate the workspace:

    terraform destroy

Documentation

For more detailed information about terraform-provider-singlestoredb, including advanced usage and configuration options, check out our official documentation.

Contributing

Contributions from the community are welcomed and appreciated! See our DEVELOPMENT.md guide for information on how to get started.

Code of Conduct

We strive to ensure a safe and positive environment for our community. Please review and adhere to our Code of Conduct.

License

terraform-provider-singlestoredb is released under the Apache 2.0 license. For more information, see the LICENSE file.

terraform-provider-singlestoredb's People

Contributors

noprysk-ua avatar actions-user avatar unnamedjk avatar michel94 avatar pbr0ck3r avatar robnorman avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.