Skip to content

Commit

Permalink
Merge branch 'main' into oncall-integration-zendesk
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyorlando authored Nov 27, 2024
2 parents bee205c + 9fb1148 commit d51aee2
Show file tree
Hide file tree
Showing 15 changed files with 274 additions and 72 deletions.
1 change: 1 addition & 0 deletions docs/data-sources/team.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ to the team. Note: users specified here must already exist in Grafana.
- `team_sync` (List of Object) Sync external auth provider groups with this Grafana team. Only available in Grafana Enterprise.
* [Official documentation](https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-team-sync/)
* [HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/team_sync/) (see [below for nested schema](#nestedatt--team_sync))
- `team_uid` (String) The team uid assigned to this team by Grafana.

<a id="nestedatt--preferences"></a>
### Nested Schema for `preferences`
Expand Down
34 changes: 17 additions & 17 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,22 @@ resource "grafana_cloud_provider_aws_cloudwatch_scrape_job" "test" {

### Managing Connections

#### Obtaining Connections access token

Before using the Terraform Provider to manage Grafana Connections resources, such as metrics endpoint scrape jobs, you need to create an access policy token on the Grafana Cloud Portal. This token is used to authenticate the provider to the Grafana Connections API.
[These docs](https://grafana.com/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/authorize-services/#create-an-access-policy-for-a-stack) will guide you on how to create
an access policy. The required permissions, or scopes, are `integration-management:read`, `integration-management:write` and `stacks:read`.

Also, by default the Access Policies UI will not show those scopes, instead, search for it using the `Add Scope` textbox, as shown in the following image:

<img src="https://grafana.com/media/docs/grafana-cloud/connections/connections-terraform-access-policy-create.png" width="700"/>

1. Use the `Add Scope` textbox to search for the permissions you need to add to the access policy: `integration-management:read`, `integration-management:write` and `stacks:read`.
1. Once done, you should see the scopes selected with checkboxes.

Having created an Access Policy, you can now create a token that will be used to authenticate the provider to the Connections API. You can do so just after creating the access policy, following
the in-screen instructions, of following [this guide](https://grafana.com/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/authorize-services/#create-one-or-more-access-policy-tokens).

#### Obtaining Connections API hostname

Having created the token, we can find the correct Connections API hostname by running the following script, that requires `curl` and [`jq`](https://jqlang.github.io/jq/) installed:
Expand All @@ -377,22 +393,6 @@ For example, in the following response, the correct hostname for the `examplesta
]
```

#### Obtaining Connections access token

Before using the Terraform Provider to manage Grafana Connections resources, such as metrics endpoint scrape jobs, you need to create an access policy token on the Grafana Cloud Portal. This token is used to authenticate the provider to the Grafana Connections API.
[These docs](https://grafana.com/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/authorize-services/#create-an-access-policy-for-a-stack) will guide you on how to create
an access policy. The required permissions, or scopes, are `integration-management:read`, `integration-management:write` and `stacks:read`.

Also, by default the Access Policies UI will not show those scopes, instead, search for it using the `Add Scope` textbox, as shown in the following image:

<img src="https://grafana.com/media/docs/grafana-cloud/connections/connections-terraform-access-policy-create.png" width="700"/>

1. Use the `Add Scope` textbox (1) to search for the permissions you need to add to the access policy.
1. Make sure that you configure the three required scopes. Once done, you'll see the selected scopes as in (2).

Having created an Access Policy, you can now create a token that will be used to authenticate the provider to the Connections API. You can do so just after creating the access policy, following
the in-screen instructions, of following [this guide](https://grafana.com/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/authorize-services/#create-one-or-more-access-policy-tokens).

#### Configuring the Provider to use the Connections API

Once you have the token and Connections API hostname, you can configure the provider as follows:
Expand Down Expand Up @@ -436,4 +436,4 @@ To create one, follow the instructions in the [obtaining cloud provider access t

An access policy token created on the [Grafana Cloud Portal](https://grafana.com/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/authorize-services/) to manage
connections resources, such as Metrics Endpoint jobs.
For guidance on creating one, see section [obtaining connections access token](#obtaining-connections-access-token)
For guidance on creating one, see section [obtaining connections access token](#obtaining-connections-access-token).
5 changes: 5 additions & 0 deletions docs/resources/machine_learning_job.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ page_title: "grafana_machine_learning_job Resource - terraform-provider-grafana"
subcategory: "Machine Learning"
description: |-
A job defines the queries and model parameters for a machine learning task.
See the Grafana Cloud docs https://grafana.com/docs/grafana-cloud/alerting-and-irm/machine-learning/forecasts/models/ for more information
on available hyperparameters for use in the hyper_params field.
---

# grafana_machine_learning_job (Resource)

A job defines the queries and model parameters for a machine learning task.

See [the Grafana Cloud docs](https://grafana.com/docs/grafana-cloud/alerting-and-irm/machine-learning/forecasts/models/) for more information
on available hyperparameters for use in the `hyper_params` field.

## Example Usage

### Basic Forecast
Expand Down
12 changes: 11 additions & 1 deletion docs/resources/rule_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ Optional:
- `is_paused` (Boolean) Sets whether the alert should be paused or not. Defaults to `false`.
- `labels` (Map of String) Key-value pairs to attach to the alert rule that can be used in matching, grouping, and routing. Defaults to `map[]`.
- `no_data_state` (String) Describes what state to enter when the rule's query returns No Data. Options are OK, NoData, KeepLast, and Alerting. Defaults to `NoData`.
- `notification_settings` (Block List, Max: 1) Notification settings for the rule. If specified, it overrides the notification policies. Available since Grafana 10.4, requires feature flag 'alertingSimplifiedRouting' enabled. (see [below for nested schema](#nestedblock--rule--notification_settings))
- `notification_settings` (Block List, Max: 1) Notification settings for the rule. If specified, it overrides the notification policies. Available since Grafana 10.4, requires feature flag 'alertingSimplifiedRouting' to be enabled. (see [below for nested schema](#nestedblock--rule--notification_settings))
- `record` (Block List, Max: 1) Settings for a recording rule. Available since Grafana 11.2, requires feature flag 'grafanaManagedRecordingRules' to be enabled. (see [below for nested schema](#nestedblock--rule--record))

Read-Only:

Expand Down Expand Up @@ -189,6 +190,15 @@ Optional:
- `mute_timings` (List of String) A list of mute timing names to apply to alerts that match this policy.
- `repeat_interval` (String) Minimum time interval for re-sending a notification if an alert is still firing. Default is 4 hours.


<a id="nestedblock--rule--record"></a>
### Nested Schema for `rule.record`

Required:

- `from` (String) The ref id of the query node in the data field to use as the source of the metric.
- `metric` (String) The name of the metric to write to.

## Import

Import is supported using the following syntax:
Expand Down
1 change: 1 addition & 0 deletions docs/resources/team.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ to the team. Note: users specified here must already exist in Grafana.

- `id` (String) The ID of this resource.
- `team_id` (Number) The team id assigned to this team by Grafana.
- `team_uid` (String) The team uid assigned to this team by Grafana.

<a id="nestedblock--preferences"></a>
### Nested Schema for `preferences`
Expand Down
20 changes: 10 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ require (
github.com/go-openapi/strfmt v0.23.0
github.com/grafana/amixr-api-go-client v0.0.16 // main branch
github.com/grafana/grafana-com-public-clients/go/gcom v0.0.0-20240807172819-ac10800522a3
github.com/grafana/grafana-openapi-client-go v0.0.0-20240723170622-ae2c94b7c9a3
github.com/grafana/grafana-openapi-client-go v0.0.0-20241113095943-9cb2bbfeb8a3
github.com/grafana/machine-learning-go-client v0.8.2
github.com/grafana/slo-openapi-client/go/slo v0.0.0-20240807172758-1b7d00838fc7
github.com/grafana/synthetic-monitoring-agent v0.29.3
github.com/grafana/synthetic-monitoring-agent v0.29.5
github.com/grafana/synthetic-monitoring-api-go-client v0.8.0
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/go-retryablehttp v0.7.7
Expand All @@ -35,8 +35,8 @@ require (
github.com/tmccombs/hcl2json v0.6.4
github.com/urfave/cli/v2 v2.27.5
github.com/zclconf/go-cty v1.15.0
golang.org/x/exp v0.0.0-20241004190924-225e2abe05e6
golang.org/x/text v0.19.0
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c
golang.org/x/text v0.20.0
gopkg.in/yaml.v2 v2.4.0
)

Expand Down Expand Up @@ -159,18 +159,18 @@ require (
go.opentelemetry.io/otel/sdk v1.29.0 // indirect
go.opentelemetry.io/otel/trace v1.29.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
golang.org/x/tools v0.26.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/grpc v1.68.0 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect
gopkg.in/validator.v2 v2.0.1 // indirect
Expand Down
Loading

0 comments on commit d51aee2

Please sign in to comment.