Skip to content

Commit 8cae435

Browse files
Describe the cloud access policy scopes needed for each resource (#1381)
Closes #1365
1 parent 5fb9e92 commit 8cae435

18 files changed

+114
-12
lines changed

docs/resources/cloud_access_policy.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@ page_title: "grafana_cloud_access_policy Resource - terraform-provider-grafana"
44
subcategory: "Cloud"
55
description: |-
66
Official documentation https://grafana.com/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/API documentation https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#create-an-access-policy
7+
Required access policy scopes:
8+
accesspolicies:readaccesspolicies:writeaccesspolicies:delete
79
---
810

911
# grafana_cloud_access_policy (Resource)
1012

1113
* [Official documentation](https://grafana.com/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/)
1214
* [API documentation](https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#create-an-access-policy)
1315

16+
Required access policy scopes:
17+
18+
* accesspolicies:read
19+
* accesspolicies:write
20+
* accesspolicies:delete
21+
1422
## Example Usage
1523

1624
```terraform

docs/resources/cloud_access_policy_token.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@ page_title: "grafana_cloud_access_policy_token Resource - terraform-provider-gra
44
subcategory: "Cloud"
55
description: |-
66
Official documentation https://grafana.com/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/API documentation https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#create-a-token
7+
Required access policy scopes:
8+
accesspolicies:readaccesspolicies:writeaccesspolicies:delete
79
---
810

911
# grafana_cloud_access_policy_token (Resource)
1012

1113
* [Official documentation](https://grafana.com/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/)
1214
* [API documentation](https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#create-a-token)
1315

16+
Required access policy scopes:
17+
18+
* accesspolicies:read
19+
* accesspolicies:write
20+
* accesspolicies:delete
21+
1422
## Example Usage
1523

1624
```terraform

docs/resources/cloud_api_key.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ description: |-
66
This resource is deprecated and will be removed in a future release. Please use grafanacloudaccess_policy instead.
77
Manages a single API key on the Grafana Cloud portal (on the organization level)
88
* API documentation https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#api-keys
9+
Required access policy scopes:
10+
api-keys:readapi-keys:writeapi-keys:delete
911
---
1012

1113
# grafana_cloud_api_key (Resource)
@@ -15,6 +17,12 @@ This resource is deprecated and will be removed in a future release. Please use
1517
Manages a single API key on the Grafana Cloud portal (on the organization level)
1618
* [API documentation](https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#api-keys)
1719

20+
Required access policy scopes:
21+
22+
* api-keys:read
23+
* api-keys:write
24+
* api-keys:delete
25+
1826
## Example Usage
1927

2028
```terraform

docs/resources/cloud_plugin_installation.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ subcategory: "Cloud"
55
description: |-
66
Manages Grafana Cloud Plugin Installations.
77
Plugin Catalog https://grafana.com/grafana/plugins/
8+
Required access policy scopes:
9+
stack-plugins:readstack-plugins:writestack-plugins:delete
810
---
911

1012
# grafana_cloud_plugin_installation (Resource)
@@ -13,6 +15,12 @@ Manages Grafana Cloud Plugin Installations.
1315

1416
* [Plugin Catalog](https://grafana.com/grafana/plugins/)
1517

18+
Required access policy scopes:
19+
20+
* stack-plugins:read
21+
* stack-plugins:write
22+
* stack-plugins:delete
23+
1624
## Example Usage
1725

1826
```terraform

docs/resources/cloud_stack.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,20 @@ page_title: "grafana_cloud_stack Resource - terraform-provider-grafana"
44
subcategory: "Cloud"
55
description: |-
66
Official documentation https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#stacks/
7+
Required access policy scopes:
8+
stacks:readstacks:writestacks:delete
79
---
810

911
# grafana_cloud_stack (Resource)
1012

1113
* [Official documentation](https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#stacks/)
1214

15+
Required access policy scopes:
16+
17+
* stacks:read
18+
* stacks:write
19+
* stacks:delete
20+
1321
## Example Usage
1422

1523
```terraform

docs/resources/cloud_stack_api_key.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ description: |-
66
Manages API keys of a Grafana Cloud stack using the Cloud API
77
This can be used to bootstrap a management API key for a new stack
88
HTTP API https://grafana.com/docs/grafana/latest/developers/http_api/auth/
9+
Required access policy scopes:
10+
stack-api-keys:write
911
!> Deprecated: please use grafana_cloud_stack_service_account and grafana_cloud_stack_service_account_token instead, see https://grafana.com/docs/grafana/next/administration/api-keys/#migrate-api-keys-to-grafana-service-accounts-using-terraform.
1012
---
1113

@@ -16,6 +18,10 @@ This can be used to bootstrap a management API key for a new stack
1618

1719
* [HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/auth/)
1820

21+
Required access policy scopes:
22+
23+
* stack-api-keys:write
24+
1925
!> Deprecated: please use `grafana_cloud_stack_service_account` and `grafana_cloud_stack_service_account_token` instead, see https://grafana.com/docs/grafana/next/administration/api-keys/#migrate-api-keys-to-grafana-service-accounts-using-terraform.
2026

2127

docs/resources/cloud_stack_service_account.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,25 @@
33
page_title: "grafana_cloud_stack_service_account Resource - terraform-provider-grafana"
44
subcategory: "Cloud"
55
description: |-
6-
Note: This resource is available only with Grafana 9.1+.
76
Manages service accounts of a Grafana Cloud stack using the Cloud API
87
This can be used to bootstrap a management service account for a new stack
98
Official documentation https://grafana.com/docs/grafana/latest/administration/service-accounts/HTTP API https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api
9+
Required access policy scopes:
10+
stack-service-accounts:write
1011
---
1112

1213
# grafana_cloud_stack_service_account (Resource)
1314

14-
**Note:** This resource is available only with Grafana 9.1+.
15-
1615
Manages service accounts of a Grafana Cloud stack using the Cloud API
1716
This can be used to bootstrap a management service account for a new stack
1817

1918
* [Official documentation](https://grafana.com/docs/grafana/latest/administration/service-accounts/)
2019
* [HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api)
2120

21+
Required access policy scopes:
22+
23+
* stack-service-accounts:write
24+
2225
## Example Usage
2326

2427
```terraform

docs/resources/cloud_stack_service_account_token.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,25 @@
33
page_title: "grafana_cloud_stack_service_account_token Resource - terraform-provider-grafana"
44
subcategory: "Cloud"
55
description: |-
6-
Note: This resource is available only with Grafana 9.1+.
76
Manages service account tokens of a Grafana Cloud stack using the Cloud API
87
This can be used to bootstrap a management service account token for a new stack
98
Official documentation https://grafana.com/docs/grafana/latest/administration/service-accounts/HTTP API https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api
9+
Required access policy scopes:
10+
stack-service-accounts:write
1011
---
1112

1213
# grafana_cloud_stack_service_account_token (Resource)
1314

14-
**Note:** This resource is available only with Grafana 9.1+.
15-
1615
Manages service account tokens of a Grafana Cloud stack using the Cloud API
1716
This can be used to bootstrap a management service account token for a new stack
1817

1918
* [Official documentation](https://grafana.com/docs/grafana/latest/administration/service-accounts/)
2019
* [HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api)
2120

21+
Required access policy scopes:
22+
23+
* stack-service-accounts:write
24+
2225
## Example Usage
2326

2427
```terraform

docs/resources/synthetic_monitoring_installation.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ description: |-
88
This resource cannot be imported but it can be used on an existing Synthetic Monitoring installation without issues.
99
Note that this resource must be used on a provider configured with Grafana Cloud credentials.
1010
Official documentation https://grafana.com/docs/grafana-cloud/monitor-public-endpoints/installation/API documentation https://github.com/grafana/synthetic-monitoring-api-go-client/blob/main/docs/API.md#apiv1registerinstall
11+
Required access policy scopes:
12+
stacks:read
1113
---
1214

1315
# grafana_synthetic_monitoring_installation (Resource)
@@ -21,6 +23,10 @@ This resource cannot be imported but it can be used on an existing Synthetic Mon
2123
* [Official documentation](https://grafana.com/docs/grafana-cloud/monitor-public-endpoints/installation/)
2224
* [API documentation](https://github.com/grafana/synthetic-monitoring-api-go-client/blob/main/docs/API.md#apiv1registerinstall)
2325

26+
Required access policy scopes:
27+
28+
* stacks:read
29+
2430
## Example Usage
2531

2632
```terraform

internal/resources/cloud/resource_cloud_access_policy.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ func ResourceAccessPolicy() *schema.Resource {
2020
Description: `
2121
* [Official documentation](https://grafana.com/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/)
2222
* [API documentation](https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#create-an-access-policy)
23+
24+
Required access policy scopes:
25+
26+
* accesspolicies:read
27+
* accesspolicies:write
28+
* accesspolicies:delete
2329
`,
2430

2531
CreateContext: CreateCloudAccessPolicy,

0 commit comments

Comments
 (0)