Starburst Galaxy

  •  Get started

  •  Working with data

  •  AI workflows

  •  Data engineering

  •  Developer tools

  •  Cluster administration

  •  Security and compliance

  •  Troubleshooting

  • Galaxy status

  •  Reference

  • Starburst Galaxy Terraform provider #

    The Starburst Galaxy Terraform provider allows you to programatically manage your Galaxy infrastructure objects, or resources in Terraform, as human-readable code. With the Galaxy Terraform provider, you can automate the creation and management of resources such as:

    • Clusters
    • Catalogs
    • Users, roles, and service accounts
    • Access control policies
    • Data products
    • Row filters and column masks
    • SQL jobs

    The Galaxy Terraform provider enables easier version control of infrastructure and helps maintains consistency across environments. It also allows for easy replication of configurations.

    Prerequisites #

    Before you begin using the Galaxy Terraform provider, you must have the following prerequisites:

    Install the Galaxy Terraform provider #

    The Galaxy Terraform provider is available in the Terraform registry. To use it, add the following to your Terraform configuration file:

    terraform {
      required_providers {
        galaxy = {
          source  = "hashicorp.com/starburstdata/galaxy"
          version = "~> 1.0"
        }
      }
    }
    

    Then run terraform init.

    Configure the Galaxy Terraform provider #

      1. Set the following values as environment variables:

    export GALAXY_CLIENT_ID="your-client-id"
    export GALAXY_CLIENT_SECRET="your-client-secret"
    export GALAXY_DOMAIN="https://your-galaxy-domain.starburstdata.com"
    

      2. Add the following line to your Terraform configuration file:

    provider "galaxy" {
      # Configuration is read from environment variables
    }
    

    Example usage #

    Create a cluster #

    resource "galaxy_cluster" "example" {
      name                 = "my-cluster"
      cloud_region_id      = "your-region-id"
      min_workers          = 1
      max_workers          = 10
      private_link_cluster = false
      catalog_refs         = []
      
      processing_mode          = "WarpSpeed"
      warp_resiliency_enabled  = true
      result_cache_enabled     = true
      
      idle_stop_minutes = 30
    }
    

    Create an Amazon S3 catalog: #

    resource "galaxy_s3_catalog" "data_lake" {
      name            = "data-lake"
      cloud_region_id = "your-region-id"
      
      s3_catalog_properties = {
        bucket_name           = "my-data-bucket"
        default_location      = "s3://my-data-bucket/data"
        region               = "us-east-1"
        aws_access_key_id    = var.aws_access_key
        aws_secret_access_key = var.aws_secret_key
      }
      
      cluster_id = galaxy_cluster.example.id
    }
    

    For more Galaxy Terraform provider configuration examples, see Examples.

    To learn more about the basics of Terraform configuration, see the Terraform Language documentation.