Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Terraform Grafana provider

License

NotificationsYou must be signed in to change notification settings

grafana/terraform-provider-grafana

Terraform Provider for Grafana

Acceptance TestsUnit TestsCloud Acceptance Tests

Requirements

Development

If you're new to provider development, a good place to start is theExtendingTerraform docs.

Set up your local environment by installingGo. AlsoDocker can be used for running tests.

Local Development with Grafana

If you develop the provider and want to test locally with your grafana provider

  1. create a.terraformrc file in your operating system user directory and paste the following
provider_installation {   dev_overrides {      "grafana/grafana" = "/path/to/your/terraform-provider-grafana" # this path is the directory where the binary is built  }  # 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 {}}
  1. Rungo build in this directory to get the binary, Terraform will use the binary you just built for every terraform plan/apply (it should print out a warning). No need to run terraform init.

Running Tests

Acceptance tests require a running instance of Grafana. You can either handlerunning an instance of Grafana yourself or usedocker-compose.

If you choosedocker-compose, runmake testacc-docker. This is the simplestoption, but often not the quickest.

Alternatively you can use thetestacc target which will use your localgoinstallation:

# Assuming Grafana was run with:# docker run --rm -p 3000:3000 grafana/grafanaGRAFANA_URL=http://localhost:3000 \GRAFANA_AUTH=admin:admin \make testacc

Running enterprise tests

To run tests for resources which are available only for Grafana Enterprise, running instance of Grafana Enterprise is required.It is only possible to run tests for Grafana Enterprise using local environment.

# Assuming Grafana was run with:# docker run --rm -p 3000:3000 grafana/grafanaGRAFANA_URL=http://localhost:3000 \GRAFANA_AUTH=admin:admin \make testacc-enterprise

Documentation

Documentation is generated withtfplugindocs. Generatedfiles are indocs/ and should not be updated manually. They are derived from:

Usego generate to update generated docs.

Releasing

Builds and releases are automated with GitHub Actions andGoReleaser.

Currently there are a few manual steps to this:

  1. Kick off the release:

    RELEASE_VERSION=v... \make release
  2. Publish release:

    The Action creates the release, but leaves it in "draft" state. Open it up inabrowserand if all looks well, click theAuto-generate release notes button and mash the publish button.


[8]ページ先頭

©2009-2025 Movatter.jp