Skip to content

Latest commit

 

History

History
126 lines (88 loc) · 3.57 KB

CONTRIBUTING.md

File metadata and controls

126 lines (88 loc) · 3.57 KB

Contributing to Terraform - Coralogix Provider

Thank you for your interest in contributing to the Coralogix provider. We welcome your contributions. Here you'll find information to help you get started with provider development.

You are contributing under the terms and conditions of the Contributor License Agreement (CLA).

For a set of general guidelines, see the CONTRIBUTING.md page in the main Terraform repository.

Documentation

Hashicorp provider development documentation provides a good start into developing an understanding of provider development. It's the best entry point if you are new to contributing to this provider.

To learn more about how to create issues and pull requests in this repository, and what happens after they are created, you may refer to the resources below:

Building the provider

Requirements

  • Terraform 1.x.x
  • Go 1.23.x (to build the provider plugin)

Steps

Check If GOPATH is set

$ echo $GOPATH

If GOPATH is empty set it

$ export GOPATH=$HOME/go

Clone the repository locally.

$ mkdir -p $GOPATH/src/github.com/hashicorp; cd $GOPATH/src/github.com/hashicorp
$ git clone [email protected]:coralogix/terraform-provider-coralogix

Navigate to the provider directory and build the provider. Inside the Makefile, change "OS_ARCH=darwin_arm64" to "OS_ARCH=darwin_amd64" if needed (Line 7).

$ cd $GOPATH/src/github.com/hashicorp/terraform-provider-coralogix
$ make install

Running examples

Navigate to one of the example directories or create your own terraform file, and initialize the Terraform configuration files. For running the build provider, change the source of the provider to locally/debug/coralogix (source = "locally/debug/coralogix").

$ cd examples/rules_group
$ terraform init

Add your api-key at the main.tf file (instead of the commented api_key), or add it as environment variable.

$ export CORALOGIX_API_KEY="<your api-key>"

Change to the desired Coralogix-Environment at the main.tf file (instead of the existed env), or add it as environment variable.

$ export CORALOGIX_ENV="<desired Coralogix-Environment>" 

You can see the planed resource that will be created.

$ terraform plan

Create the resource.

$ terraform apply -auto-approve

Destroy the resource.

$ terraform destroy -auto-approve

Running tests

In order to run the full suite of Acceptance tests, run make testacc.

Note: Acceptance tests create real resources and in a case of failure some resources may not be removed.

$ make testacc

Tests

In general, adding test coverage (unit tests and acceptance tests) to new features or bug fixes in your PRs, and sharing the logs of a successful test run on your branch will greatly speed up the acceptance of your PR.

Documentations

We use terraform-plugin-docs for generating documentations automatically. In order to generate docs automatically, simply run make generate.

Note: The generated documentation overrides the existing one, so be sure to add only the desired changes.

$ make generate