Skip to content

G-PORTAL/terraform-provider-gpcore

Repository files navigation

Terraform Provider GPCore

This repository is a Terraform provider for GPCore. It is intended to allow an Infrastructure-as-Code definition of the GPCore services.

Implemented Resources:

  • gpcore_node - The gpcore Node resource
  • gpcore_project - The gpcore Project resource
  • gpcore_project_image - The gpcore Project Image resource (Custom image)
  • gpcore_sshkey - The gpcore SSH-Key resource
  • gpcore_billing_profile - The gpcore Billing Profile resource

Implemented Data sources:

  • gpcore_project - The gpcore Project data source (read-only)
  • gpcore_flavour - The gpcore Flavour data source
  • gpcore_datacenter - The gpcore Datacenter data source
  • gpcore_image - The gpcore Image data source (Official images)

Requirements

Building The GPCore Provider manually

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

Using the provider

This provider is published on the Terraform Registry.

To use the gpcore Terraform Provider, all you need to do is to reference the published provider inside your terraform configuration.

terraform {
  required_providers {
    gpcore = {
      source = "G-PORTAL/gpcore"
      # Ensure to use the latest version of the provider
      version = "0.1.4"
    }
  }
}

The full documentation for the provider can be found here or inside the docs/ directory.

Developing the Provider

If you wish to contribute to the gpcore Terraform Provider, you'll first need Go installed on your machine (see Requirements above).

To compile the provider, run go install. This will build the provider and put the provider binary in the $GOPATH/bin directory.

To reference the custom version of the provider built instead of the hosted one, setting dev_override inside the $HOME/.terraformrc file becomes useful:

provider_installation {
  dev_overrides {
    "registry.terraform.io/g-portal/gpcore" = "~/go/bin"
  }
  direct {}
}

To generate or update documentation, run go generate.