Skip to content

hoophq/terraform-provider-hoop

Repository files navigation

Terraform Provider Hoop

This provider leverages the hoop API to manage resources in the Hoop platform. It's a Terraform provider that allows you to create, read, update, and delete resources in Hoop.

Supported Resources

  • Connections
  • Plugin Connection

Documentation

Refer to ./docs or the Hoop Terraform Provider Documentation for detailed documentation on how to use the provider, including examples and configuration options.

Development

This provider is built using the Terraform Plugin Framework. It was scaffolded using the Terraform Provider Scaffolding template repository.

Requirements

Testing the Provider

To test the provider, you can run the following command:

make test
  1. To work with a live Hoop instance, spin up a local instance of the Hoop API server:
  1. Obtain the organization id to setup your API KEY.
  2. Restart your development server with the API KEY set
  3. Open a new terminal and use the script ./scripts/terraform to run the provider with the local Hoop API server.
mv ./dev/main/main.tf-sample ./dev/main/main.tf
./scripts/terraform plan -chdir=dev/main plan

The script will use the $HOME/go/bin folder by default to install the provider binary.

It will build and install the provider, and then run the plan command against the local Hoop API server. If you need to clean the state, remove the local files in this folder:

rm -rf ./dev/main/terraform.tfstate*

To clean up resources from the local Hoop API server, the command line could be used to manage the resources directly.

hoop admin delete conn bash-console

Updating Documentation

This project uses the tfplugindocs tool to generate documentation for the provider. The tfplugindocs tool will automatically include schema-based descriptions, if present in a data source, provider, or resource's schema. The schema.Schema type's Description field describes the data source, provider, or resource itself. Each attribute's or block's Description field describes that particular attribute or block. These descriptions should be tailored to practitioner usage and include any caveats or value expectations, such as special syntax.

To generate the documentation, you can run the following command:

make generate

Example File Documentation

The tfplugindocs tool will automatically include Terraform configuration examples from files with the following naming conventions:

  • Provider: examples/provider/provider.tf
  • Resources: examples/resources/TYPE/resource.tf
  • Data Sources: examples/data-sources/TYPE/data-source.tf
  • Functions: examples/functions/TYPE/function.tf

Replace TYPE with the name of the resource, data source, or function. For example: examples/resources/hoop_connection/resource.tf.

Example Import Documentation

The tfplugindocs tool automatically will include Terraform import examples for resources with the file naming convention examples/resources/TYPE/import.sh.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •