Skip to content

aptible/terraform-provider-aptible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

835b662 · Mar 5, 2025
Mar 5, 2025
Feb 28, 2025
Feb 11, 2025
Jul 3, 2024
Apr 8, 2020
Jul 3, 2024
Feb 28, 2025
Jul 22, 2022
Feb 28, 2025
Feb 28, 2025
Mar 1, 2023
Feb 28, 2025
Feb 28, 2025
Sep 28, 2020
Jul 3, 2024
Mar 4, 2022

Repository files navigation

Aptible Terraform Provider

The provider is available on the Terraform Registry and can be installed using the normal Terraform configuration process.

To create an app:

  • Create a file named main.tf
  • Add your app's metadata.
    • You can see an example in examples/demo.tf

Developing the provider

Create a main.tf file in the root of the project with the local provider defined:

terraform {
  required_providers {
    aptible = {
      source  = "aptible.com/aptible/aptible"
      version = "0.0.0+local"
    }
  }
}

# Add your resources below
resource "aptible_environment" {
  ...
}

Whenever a change is made:

  • Install the plugin locally: make local-install
  • Initialize the plugin: terraform init
    • Your old provider lockfile may need to be removed: rm .terraform.lock.hcl
  • See what changes will be made: terraform plan
  • Apply the changes: terraform apply

Testing with an unreleased version of aptible-api-go

The redirect directive can be used in go.mod to redirect to a local checkout of the client:

replace github.com/aptible/aptible-api-go => ../aptible-api-go

Alternatively, an unreleased version of aptible-api-go can be checked out from the repo by running:

go get github.com/aptible/aptible-api-go@COMMIT
go mod vendor

Replacing COMMIT with the commit you want to test. The specified version will be pulled and you can start testing with it. A branch or tag can be used instead of a commit, however, if the branch or tag is updated, go will cache the download and subsequent go get commands will not update the package.

When testing is complete and the new version of the package is release, go.mod can be updated with the desired version, then:

go mod tidy
go mod vendor

will pull the correct package version and update the vendored packages.

Manual Installation

If you are using a Terraform version that cannot install the provider from the registry, then you may attempt a local installation. However, we do not test this process and cannot ensure it works.

Verifying the Releases

All of the precompiled binaries available on the release page have checksums published to verify the integrity of the zip archives. To verify the checksums, we have signed them with a GPG key.

The public key ID is 0xa1b845b9417ca47a02dd7457fb0996ce6372f7ad and it is available at the SKS server pool

Once you have the public key, you can use it to verify the checksums and then, in turn, use those to verify the binaries. For example:

gpg --keyserver keyserver.ubuntu.com --recv-key 0xa1b845b9417ca47a02dd7457fb0996ce6372f7ad
gpg --verify terraform-provider-aptible_${VERSION}_SHA256SUMS.sig
sha256sum -c --ignore-missing terraform-provider-aptible_0.1_SHA256SUMS

The exact commands may vary on different systems.