Docs: add pinning of terraform for migration (#88528)

* Docs: update with terraform version

* added the terraform version pinning

* formatting

* Update docs/sources/administration/api-keys/index.md

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>

* formatting

---------

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
This commit is contained in:
Eric Leijonmarck 2024-06-02 12:30:15 +01:00 committed by GitHub
parent 9e82c85849
commit 221e036233
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -182,6 +182,25 @@ curl --request GET --url http://localhost:3000/api/folders --header 'Authorizati
### Migrate API keys to Grafana service accounts in Terraform
{{< admonition type="note" >}}
The terraform resource `api_key` is removed from the Grafana Terraform Provider in v3.0.0.
Before you migrate and remove the use of the resource, you should pin your terraform version to a version less-than or equal-to v2.19.0.
For more information, refer to the [Grafana Terraform Provider release notes](https://github.com/grafana/terraform-provider-grafana/releases/tag/v3.0.0).
{{< /admonition >}}
To pin the Grafana Terraform Provider to v2.19.0:
```hcl
terraform {
required_providers {
grafana = {
source = "grafana/grafana"
version = "2.19.0"
}
}
}
```
This section shows you how to migrate your Terraform configuration for API keys to Grafana service accounts. For resources, see [Grafana Service Accounts in Terraform](https://registry.terraform.io/providers/grafana/grafana/latest/docs/resources/service_account_token).
For migration your cloud stack api keys, use the `grafana_cloud_stack_service_account` and `gafana_cloud_stack_service_account_token` resources see [Grafana Cloud Stack Service Accounts in Terraform](https://registry.terraform.io/providers/grafana/grafana/latest/docs/resources/cloud_stack_service_account).