All Projects → spacelift-io → terraform-provider-spacelift

spacelift-io / terraform-provider-spacelift

Licence: MIT license
Terraform provider to interact with Spacelift

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to terraform-provider-spacelift

terraform-provider-boundary
Manage Boundary's identity-based access controls for resources provisioned with Terraform. This provider is maintained internally by the HashiCorp Boundary team.
Stars: ✭ 87 (+234.62%)
Mutual labels:  terraform-provider
terraform-provider-ignition
Terraform Ignition provider
Stars: ✭ 37 (+42.31%)
Mutual labels:  terraform-provider
terraform-aws-kinesis-firehose
This code creates a Kinesis Firehose in AWS to send CloudWatch log data to S3.
Stars: ✭ 25 (-3.85%)
Mutual labels:  terraform-provider
terraform-provider-akamai
Terraform Akamai provider
Stars: ✭ 75 (+188.46%)
Mutual labels:  terraform-provider
terraform-provider-rediscloud
Terraform Redis Enterprise Cloud Pro Provider: Deploy, update, and manage Redis Enterprise Cloud Pro databases as code through HashiCorp Terraform
Stars: ✭ 24 (-7.69%)
Mutual labels:  terraform-provider
terraform-provider-qingcloud
Terraform QingCloud Provider
Stars: ✭ 34 (+30.77%)
Mutual labels:  terraform-provider
terraform-provider-auth0
Please see https://github.com/alexkappa/terraform-provider-auth0
Stars: ✭ 28 (+7.69%)
Mutual labels:  terraform-provider
terraform-provider-twilio
Terraform provider for Twilio. 🌎☎️ Preserved for archaeological fun. Please see the official Twilio TF provider @ https://github.com/twilio/terraform-provider-twilio.
Stars: ✭ 32 (+23.08%)
Mutual labels:  terraform-provider
terraform-provider-signalfx
Terraform SignalFx provider
Stars: ✭ 26 (+0%)
Mutual labels:  terraform-provider
terraform-provider-honeycombio
A Terraform provider for Honeycomb.io
Stars: ✭ 37 (+42.31%)
Mutual labels:  terraform-provider
terraform-provider-phpipam
Terrform provider for PHPIPAM
Stars: ✭ 45 (+73.08%)
Mutual labels:  terraform-provider
terraform-provider-opc
Terraform Oracle Public Cloud provider
Stars: ✭ 29 (+11.54%)
Mutual labels:  terraform-provider
terraform-provider-kite
Terraform provider for managing long term portfolio with Zerodha Kite
Stars: ✭ 21 (-19.23%)
Mutual labels:  terraform-provider
terraform-provider-gotemplate
a custom terraform provider to use go text/template language instead of terraform's
Stars: ✭ 20 (-23.08%)
Mutual labels:  terraform-provider
terraform-provider-bitbucketserver
Terraform provider for Bitbucket Server Management
Stars: ✭ 26 (+0%)
Mutual labels:  terraform-provider
terraform-provider-akamai
An Akamai GTM Terraform provider
Stars: ✭ 14 (-46.15%)
Mutual labels:  terraform-provider
terraform-provider-nexus
Terraform provider for Sonatype Nexus
Stars: ✭ 74 (+184.62%)
Mutual labels:  terraform-provider
terraform-provider-nix
terraform provider that manages nix builds and nixos machines.
Stars: ✭ 105 (+303.85%)
Mutual labels:  terraform-provider
terraform-provider-checkly
Terraform provider for the Checkly monitoring service
Stars: ✭ 37 (+42.31%)
Mutual labels:  terraform-provider
terraform-provider-sumologic
Terraform provider for Sumo Logic
Stars: ✭ 24 (-7.69%)
Mutual labels:  terraform-provider

Spacelift Terraform Provider

The Spacelift Terraform provider is used to programmatically interact with its GraphQL API, allowing Spacelift to declaratively manage itself 🤯

Documentation

You can browse documentation on the Terraform provider registry.

Using the Provider

Terraform 0.13 and Above

You can use the provider via the Terraform provider registry.

Terraform 0.12 or Manual Installation

You can download a pre-built binary from the releases page, these are built using goreleaser (the configuration is in the repo). You can verify the signature using this key.

If you want to build from source, you can simply use go build in the root of the repository.

Development

Tools

To develop the provider locally you need the following tools:

Generating the Documentation

To generate the documentation, run the following command:

go generate

Using a Local Build of the Provider

Sometimes as well as running unit tests, you want to be able to run a local build of the provider against Spacelift. This involves the following steps:

  1. Building a copy of the provider using GoReleaser.
  2. Updating your .terraformrc file to point at your local build.
  3. Generating an API key in Spacelift.
  4. Running Terraform locally.

Building the Provider Using GoReleaser

To build the provider, run the following command:

goreleaser build --rm-dist --snapshot

This will produce a number of binaries in subfolders of the dist folder for each supported architecture and OS:

dist
|-- artifacts.json
|-- config.yaml
|-- metadata.json
|-- terraform-provider-spacelift_darwin_amd64_v1
|   `-- terraform-provider-spacelift_v0.1.11-SNAPSHOT-bb215e9
|-- terraform-provider-spacelift_darwin_arm64
|   `-- terraform-provider-spacelift_v0.1.11-SNAPSHOT-bb215e9
|-- terraform-provider-spacelift_linux_amd64_v1
|   `-- terraform-provider-spacelift_v0.1.11-SNAPSHOT-bb215e9
|-- terraform-provider-spacelift_linux_arm64
|   `-- terraform-provider-spacelift_v0.1.11-SNAPSHOT-bb215e9
|-- terraform-provider-spacelift_windows_amd64_v1
|   `-- terraform-provider-spacelift_v0.1.11-SNAPSHOT-bb215e9.exe
`-- terraform-provider-spacelift_windows_arm64
    `-- terraform-provider-spacelift_v0.1.11-SNAPSHOT-bb215e9.exe

Updating your .terraformrc file

The next step is telling Terraform to use your local build, rather than a copy from the Terraform registry. You can do this by specifying dev_overrides in your .terraformrc file.

To do this, edit or create a .terraformrc in your home folder, and add the following contents:

provider_installation {
  dev_overrides {
    "spacelift.io/spacelift-io/spacelift" = "<absolute-path-to-repo>/dist/terraform-provider-spacelift_<OS>_<arch>"
  }

  direct {}
}

Make sure to replace <absolute-path-to-repo>, <OS>, and <arch> with the correct values, for example:

"spacelift.io/spacelift-io/spacelift" = "/home/my-user/github.com/spacelift-io/terraform-provider-spacelift/dist/terraform-provider-spacelift_linux_amd64_v1"

Generating an API Key

Follow the information in our API documentation page to generate an API key. Please make sure to generate an admin key since admin permissions are required for most operations you will be using the provider for.

Running Spacelift Terraform Provider Locally

To test your local build, just create the relevant Terraform files needed to test your changes, and run terraform plan, terraform apply, etc as normal. The main difference when running the provider locally rather than within Spacelift is that you need to tell it how to authenticate with your Spacelift account. Here's a minimal example:

terraform {
  required_providers {
    spacelift = {
      source = "spacelift.io/spacelift-io/spacelift"
    }
  }
}

provider "spacelift" {
  api_key_endpoint = "https://<account-name>.app.spacelift.io"
  api_key_id       = "<api-key-id>"
  api_key_secret   = "<api-key-secret"
}

data "spacelift_account" "this" {
}

output "account_name" {
  value = data.spacelift_account.this.name
}

Make sure to replace <account-name>, <api-key-id> and <api-key-secret> with the relevant values.

Releasing New Versions of the Provider

In order to release a new version of the provider one should follow those simple steps:

  • Merge the production deploy PR.
  • Create a new tag for the latest commit on tha main branch git tag vX.Y.Z -m "Release"
  • Push the tag git push origin vX.Y.Z
  • Pushing a tag will start a new CI job that will create a new GitHub release draft. Wait until it completes.
  • Edit description of the release - GitHub can automatically generate most of the changelog, just make sure it makes sense and doesn't include merge commits.
  • Save & Publish the release. It might take a few minutes for the registry to pick up the new version.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].