A terraform provider which integrates the Mirantis Launchpad tooling to natively install/remove the Mirantis container products as terraform resources.
Primarily, the provider provides resource types which will accept cluster and product configuration, which is used to configure launchpad to run. Launchpad executions are implemented using golang imports, not through shell commands, so no local environment constraints exist, other than terraform requirements.
This provider is developed internally, and comes with no warranty. Use it at your own risk.
- Terraform >= 1.4
- Go >= 1.20
- GoReleaser : If you want to use it locally
- Clone the repository
- Enter the repository directory
- Build the provider using the
make localcommand (uses goreleaser)
$/> make localThis provider uses Go modules. Please see the Go documentation for the most up to date information about using Go modules.
To add a new dependency github.com/author/dependency to your Terraform provider:
go get github.com/author/dependency
go mod tidyThen commit the changes to go.mod and go.sum.
The provider, once installed properly can be used in any terraform root/chart.
Go to the terraform registry page and follow the instructions for declaring the provider version in your chart/module
@see https://registry.terraform.io/providers/Mirantis/launchpad/latest
The make local target will use goreleaser to build the provider, and
then provide instructions on how to configure terraform to use the
provider locally,
You can develop the provider locally, and test the development version by building
the plugin locally, and then configuring terraform to use the local version as a
dev_override for the production version.
To build the local plugin:
make local
It is recommended that you use the dev_override by using a special TF config file
and running terraform with an environment variable telling it to use the special file.
This avoids using the development version globally, preventing simple mistakes.
First create a file like my_tf_config_file:
provider_installation {
# This disables the version and checksum verifications for this provider
# and forces Terraform to look for the launchpad provider plugin in the
# given directory.
dev_overrides {
"mirantis/launchpad" = "path/to/this/repo/dist/terraform-provider-launchpad_linux_amd64_v1"
}
# 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 {}
}
@NOTE that you mus replace linux and amd64 if you are on a Mac/Windows machine
or not on a 64bit intel/amd processor. See go env GOOS and go env GOARCH for
the correct values.
then run terraform with a config file override pointing to the new file:
$/> TF_CLI_CONFIG_FILE=my_tf_config_file terraform plan
(or use an environment variable export)
To generate or update documentation, run go generate.
In order to run the testing mode unit test suite:
make test
In order to run the full suite of Acceptance tests, run make testacc.
Note: Acceptance tests require that you have an environment set up for testing that launchpad can use.
make testaccNo requirements.
No providers.
No modules.
No resources.
No inputs.
No outputs.