The Backstage Provider allows Terraform to manage Backstage resources.
Official documentation on how to use this provider can be found on the Terraform Registry. In case of specific questions, please raise a GitHub issue in this repository.
The remainder of this document will focus on the development aspects of the provider.
Below is a list of open-source Terraform modules that utilize this provider:
- terraform-backstage-metadata-module - a metadata wrapper module to fetch metadata for an entity from Backstage and compile a list of resource labels as output.
The repository and code is based on Terraform Provider Scaffolding (Terraform Plugin Framework), therefore most of the official documentation on developing this provider is also applicable.
git clone
this repository andcd
into its directory.go instal .
to build install the provider into your$GOPATH/bin
directory.
To be able to run the local version of the provider, please follow the official Terraform documentation.
In order to test the provider, run the following command:
make testacc
This will run acceptance tests against the provider , actually spawning terraform and the provider, using https://demo.backstage.io
as the Backstage instance. The instance can
be changed by setting the BACKSTAGE_BASE_URL
environment variable, e.g.:
BACKSTAGE_BASE_URL=https://localhost:3000 make testacc
The project contains a docker-compose.yml
file that can be used to spin up a local instance of Backstage, which can be used for testing. To do so, run:
docker-compose up -d
Some tests (i.e. resource tests) do not work with the public demo instance of Backstage, as they modify the data. To skip those tests while using the demo instance, run:
ACCTEST_SKIP_RESOURCE_TEST=1 make testacc
This provider uses terraform-plugin-docs to generate documentation and store it in the docs/
directory.
Once a release is cut, the Terraform Registry will download the documentation from docs/
and associate it with the release version.
Read more about how this works on the official page.
The release process is automated via GitHub Actions, and it's defined in the workflow file release.yml
.
Each release is cut by creating a GitHub release (with corresponding changelog) and pushing a semantically versioned tag to the default branch.
Contributions to the project are welcome. If you are interested in making a contribution, please review open issues or open a new issue to propose a new feature or bug fix. Please ensure to follow the code of conduct. Any contributions that align with the project goals and vision are appreciated. Thank you for your interest in improving the project.
This provider is distributed under the Mozilla Public License v2.0 license found in the LICENSE
file.