terraform-provider-ona

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

README

Terraform Provider Ona

CI Release

Terraform provider for managing Gitpod resources on ona.com.

Requirements

  • Terraform >= 1.6.0
  • Go >= 1.26 (for building from source)

Supported Types

Resources:

  • ona_project
  • ona_runner

Data sources:

  • ona_authenticated_identity
  • ona_project
  • ona_runner
  • ona_runner_environment_classes

Using the Provider

terraform {
  required_providers {
    ona = {
      source  = "combor/ona"
      version = ">= 0.1.0"
    }
  }
}

provider "ona" {
  api_key = var.ona_api_key
}

Example

resource "ona_runner" "example" {
  name              = "my-runner"
  provider_type     = "RUNNER_PROVIDER_MANAGED"
  runner_manager_id = "<your-runner-manager-id>"

  spec = {
    variant = "RUNNER_VARIANT_STANDARD"
    configuration = {
      region                           = "eu-central-1"
      auto_update                      = true
      devcontainer_image_cache_enabled = true
      release_channel                  = "RUNNER_RELEASE_CHANNEL_STABLE"
      log_level                        = "LOG_LEVEL_INFO"
    }
  }
}

data "ona_runner_environment_classes" "example" {
  runner_id = ona_runner.example.id
}

data "ona_authenticated_identity" "current" {}

resource "ona_project" "example" {
  name = "terraform-provider-ona"

  initializer = {
    specs = [
      {
        git = {
          remote_uri = "https://github.com/combor/terraform-provider-ona"
        }
      }
    ]
  }

  prebuild_configuration = {
    enabled = true
    environment_class_ids = [
      for environment_class in data.ona_runner_environment_classes.example.environment_classes :
      environment_class.id
    ]
    executor = {
      id        = data.ona_authenticated_identity.current.id
      principal = data.ona_authenticated_identity.current.principal
    }
  }
}

data "ona_project" "example" {
  id = ona_project.example.id
}

data "ona_runner" "example" {
  id = ona_runner.example.id
}

See examples/main.tf for the integration-test configuration and docs/resources/project.md, docs/resources/runner.md, docs/data-sources/authenticated_identity.md, docs/data-sources/project.md, docs/data-sources/runner.md, and docs/data-sources/runner_environment_classes.md for the generated schema docs.

Development

# Build
go build -o terraform-provider-ona .

# Run tests
go test ./...

# Run the local CI checks used in day-to-day development
act push -j build -j test -s GITPOD_API_KEY=<your-key>

To test the provider locally, create a ~/.terraformrc with dev overrides:

provider_installation {
  dev_overrides {
    "combor/ona" = "/path/to/terraform-provider-ona"
  }
  direct {}
}

Contributing

Bug reports and feature requests should go to GitHub Issues. Code changes should be proposed through pull requests.

Before opening a pull request, run:

  • gofmt -w on changed Go files
  • go test ./...
  • act push -j build -j test -s GITPOD_API_KEY=<your-key>

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL