gridscale / terraform-provider-gridscale

Terraform gridscale provider
https://registry.terraform.io/providers/gridscale/gridscale/latest/docs
Mozilla Public License 2.0
12 stars 11 forks source link
gridscale terraform terraform-provider

Terraform gridscale Provider

Build status GitHub tag (latest SemVer) Gitter chat

Maintainers

This provider plugin is maintained by the Terraform team at gridscale.

Requirements

Building the Provider

Clone repository to: $GOPATH/src/github.com/gridscale/terraform-provider-gridscale

$ mkdir -p $GOPATH/src/github.com/gridscale; cd $GOPATH/src/github.com/gridscale
$ git clone git@github.com:gridscale/terraform-provider-gridscale.git

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/gridscale/terraform-provider-gridscale
$ make build

Using the Provider

See the gridscale provider documentation to get started on using the gridscale provider.

Alternatively, this documentation can also be found within this repository. Check out website/docs/index.html.markdown to get started. Documentation on how to create resources like servers, storages and networks can be found in website/docs/r. Documentation on how to add resources like storages, networks and IP addresses to servers, check out the documentation on datasources found in website/docs/d.

Available Features

Feature Availability Test
Server (CRUD) :heavy_check_mark: Build status
Server dependency (link/unlink) :heavy_check_mark: Build status
Load balancer (CRUD) :heavy_check_mark: Build status
PaaS (CRUD) :heavy_check_mark: Build status
K8S (CRUD) :heavy_check_mark: Build status
MySQL (CRUD) :heavy_check_mark: Build status
MSSQL (CRUD) :heavy_check_mark: Build status
MariaDB (CRUD) :heavy_check_mark: Build status
Postgres (CRUD) :heavy_check_mark: Build status
Memcached (CRUD) :heavy_check_mark: Build status
Redis cache (CRUD) :heavy_check_mark: Build status
Redis store (CRUD) :heavy_check_mark: Build status
Storage (CRUD) :heavy_check_mark: Build status
SSL Cert (CRUD) :heavy_check_mark: Build status
Object storage (CRUD) :heavy_check_mark: Build status
IP address (CRUD) :heavy_check_mark: Build status
Network (CRUD) :heavy_check_mark: Build status
Firewall (CRUD) :heavy_check_mark: Build status
SSH key (CRUD) :heavy_check_mark: Build status
ISO Image (CRUD) :heavy_check_mark: Build status
Snapshot (CRUD) :heavy_check_mark: Build status
Snapshot rollback :heavy_check_mark: Build status
Snapshot to S3 :heavy_check_mark: Build status
Snapshot schedule (CRUD) :heavy_check_mark: Build status
Template (CRUD) :heavy_check_mark: Build status
Multiple project support (Workaround) :x:
Marketplace :heavy_check_mark: Build status

Development

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.13+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

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

$ make build

To test the provider, simply run

$ make test

To run the full suite of acceptance tests execute make testacc you will need to set GRIDSCALE_UUID, GRIDSCALE_TOKEN, and GRIDSCALE_URL environment variables to point to an existing project when running acceptance tests.

Note: acceptance tests create real resources and often cost money to run.

$ make testacc

To run a specific acceptance test, use TESTARGS.

$ make testacc \
    TEST=./gridscale \
    TESTARGS='-run=TestAccResourceGridscaleLoadBalancerBasic'

Override local terraform provider for development

Create local-dev.tfrc with this content and change YOUR_USERNAME:

provider_installation {
  # Use /Users/YOUR_USERNAME/github/terraform-provider-gridscale as an overridden package directory
  # for the hashicorp/null provider. This disables the version and checksum
  # verifications for this provider and forces Terraform to look for the
  # null provider plugin in the given directory.
  dev_overrides {
    "gridscale/gridscale" = "/Users/YOUR_USERNAME/github/terraform-provider-gridscale/"
  }
  # For all other providers, install them directly from their origin provider
  # registries as normal. If you omit this, Terraform will _only_ use
  # the dev_overrides block, and so no other providers will be available.
  direct {}
}

export TF_CLI_CONFIG_FILE=./local-dev.tfrc

Build the binary: go build -o terraform-provider-gridscale

Now you can run terraform plan/apply and terraform will tell you that you are using a local version of that provider:

> terraform apply
╷
│ Warning: Provider development overrides are in effect
│
│ The following provider development overrides are set in the CLI configuration:
│  - gridscale/gridscale in /Users/YOUR_USERNAME/github/terraform-provider-gridscale
│
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published
│ releases.
╵

Releasing the Provider

A GoReleaser configuration is provided that produces build artifacts matching the layout required to publish the provider in the Terraform Registry.

Releases will appear as drafts. Once marked as published on the GitHub Releases page, they will become available via the Terraform Registry. Releases are signed with key ID (long) 4841EC2F6BC7BD4515F60C10047EC899C2DC3656.

Jump to the Release Checklist for details.

Known Issues

The following issues are known to us: