Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions docs/resources/contact_point.md
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,12 @@ Optional:
- `basic_auth_password` (String, Sensitive) The username to use in basic auth headers attached to the request. If omitted, basic auth will not be used.
- `basic_auth_user` (String) The username to use in basic auth headers attached to the request. If omitted, basic auth will not be used.
- `disable_resolve_message` (Boolean) Whether to disable sending resolve messages. Defaults to `false`.
- `headers` (Map of String) Custom headers to attach to the request.
- `http_config` (Block Set, Max: 1) Common HTTP client options. (see [below for nested schema](#nestedblock--webhook--http_config))
- `http_method` (String) The HTTP method to use in the request. Defaults to `POST`.
- `max_alerts` (Number) The maximum number of alerts to send in a single request. This can be helpful in limiting the size of the request body. The default is 0, which indicates no limit.
- `message` (String) Custom message. You can use template variables.
- `payload` (Block Set, Max: 1) Optionally provide a templated payload. Overrides 'Message' and 'Title' field. (see [below for nested schema](#nestedblock--webhook--payload))
- `settings` (Map of String, Sensitive) Additional custom properties to attach to the notifier. Defaults to `map[]`.
- `title` (String) Templated title of the message.
- `tls_config` (Map of String, Sensitive) Allows configuring TLS for the webhook notifier.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it misses hmacConfig

Expand All @@ -534,6 +537,65 @@ Read-Only:

- `uid` (String) The UID of the contact point.

<a id="nestedblock--webhook--http_config"></a>
### Nested Schema for `webhook.http_config`

Optional:

- `oauth2` (Block Set, Max: 1) OAuth2 configuration options. (see [below for nested schema](#nestedblock--webhook--http_config--oauth2))

<a id="nestedblock--webhook--http_config--oauth2"></a>
### Nested Schema for `webhook.http_config.oauth2`

Required:

- `client_id` (String) Client ID to use when authenticating.
- `client_secret` (String, Sensitive) Client secret to use when authenticating.
- `token_url` (String) URL for the access token endpoint.

Optional:

- `endpoint_params` (Map of String) Optional parameters to append to the access token request.
- `proxy_config` (Block Set, Max: 1) Optional proxy configuration for OAuth2 requests. (see [below for nested schema](#nestedblock--webhook--http_config--oauth2--proxy_config))
- `scopes` (List of String) Optional scopes to request when obtaining an access token.
- `tls_config` (Block Set, Max: 1) Optional TLS configuration options for OAuth2 requests. (see [below for nested schema](#nestedblock--webhook--http_config--oauth2--tls_config))

<a id="nestedblock--webhook--http_config--oauth2--proxy_config"></a>
### Nested Schema for `webhook.http_config.oauth2.proxy_config`

Optional:

- `no_proxy` (String) Comma-separated list of addresses that should not use a proxy.
- `proxy_connect_header` (Map of String) Optional headers to send to proxies during CONNECT requests.
- `proxy_from_environment` (Boolean) Use environment HTTP_PROXY, HTTPS_PROXY and NO_PROXY to determine proxies. Defaults to `false`.
- `proxy_url` (String) HTTP proxy server to use to connect to the targets.


<a id="nestedblock--webhook--http_config--oauth2--tls_config"></a>
### Nested Schema for `webhook.http_config.oauth2.tls_config`

Optional:

- `ca_certificate` (String, Sensitive) Certificate in PEM format to use when verifying the server's certificate chain.
- `client_certificate` (String, Sensitive) Client certificate in PEM format to use when connecting to the server.
- `client_key` (String, Sensitive) Client key in PEM format to use when connecting to the server.
- `insecure_skip_verify` (Boolean) Do not verify the server's certificate chain and host name. Defaults to `false`.




<a id="nestedblock--webhook--payload"></a>
### Nested Schema for `webhook.payload`

Required:

- `template` (String) Custom payload template.

Optional:

- `vars` (Map of String) Optionally provide a variables to be used in the payload template. They will be available in the template as `.Vars.<variable_name>`.



<a id="nestedblock--wecom"></a>
### Nested Schema for `wecom`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
resource "grafana_contact_point" "receiver_types" {
name = "Receiver Types since v12.0"

webhook {
url = "http://my-url"
headers = {
Content-Type = "test-content-type"
X-Test-Header = "test-header-value"
}
payload {
template = "{{ .Receiver }}: {{ .Vars.var1 }}"
vars = {
var1 = "variable value"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
resource "grafana_contact_point" "receiver_types" {
name = "Receiver Types since v12.1"

webhook {
url = "http://my-url"
http_method = "POST"
basic_auth_user = "user"
basic_auth_password = "password"
max_alerts = 100
message = "Custom message"
title = "Custom title"
tls_config = {
insecure_skip_verify = true
ca_certificate = "ca.crt"
client_certificate = "client.crt"
client_key = "client.key"
}
http_config {
oauth2 {
client_id = "client_id"
client_secret = "client_secret"
token_url = "http://oauth2-token-url"
scopes = ["scope1", "scope2"]
endpoint_params = {
"param1" = "value1"
"param2" = "value2"
}
proxy_config {
proxy_url = "http://proxy-url"
proxy_from_environment = false
no_proxy = "localhost"
proxy_connect_header = {
"X-Proxy-Header" = "proxy-value"
}
}
tls_config {
insecure_skip_verify = true
ca_certificate = <<EOF
-----BEGIN CERTIFICATE-----
MIGrMF+gAwIBAgIBATAFBgMrZXAwADAeFw0yNDExMTYxMDI4MzNaFw0yNTExMTYx
MDI4MzNaMAAwKjAFBgMrZXADIQCf30GvRnHbs9gukA3DLXDK6W5JVgYw6mERU/60
2M8+rjAFBgMrZXADQQCGmeaRp/AcjeqmJrF5Yh4d7aqsMSqVZvfGNDc0ppXyUgS3
WMQ1+3T+/pkhU612HR0vFd3vyFhmB4yqFoNV8RML
-----END CERTIFICATE-----
EOF
client_certificate = <<EOF
-----BEGIN CERTIFICATE-----
MIIBhTCCASugAwIBAgIQIRi6zePL6mKjOipn+dNuaTAKBggqhkjOPQQDAjASMRAw
DgYDVQQKEwdBY21lIENvMB4XDTE3MTAyMDE5NDMwNloXDTE4MTAyMDE5NDMwNlow
EjEQMA4GA1UEChMHQWNtZSBDbzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABD0d
7VNhbWvZLWPuj/RtHFjvtJBEwOkhbN/BnnE8rnZR8+sbwnc/KhCk3FhnpHZnQz7B
5aETbbIgmuvewdjvSBSjYzBhMA4GA1UdDwEB/wQEAwICpDATBgNVHSUEDDAKBggr
BgEFBQcDATAPBgNVHRMBAf8EBTADAQH/MCkGA1UdEQQiMCCCDmxvY2FsaG9zdDo1
NDUzgg4xMjcuMC4wLjE6NTQ1MzAKBggqhkjOPQQDAgNIADBFAiEA2zpJEPQyz6/l
Wf86aX6PepsntZv2GYlA5UpabfT2EZICICpJ5h/iI+i341gBmLiAFQOyTDT+/wQc
6MF9+Yw1Yy0t
-----END CERTIFICATE-----
EOF
client_key = <<EOF
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIIrYSSNQFaA2Hwf1duRSxKtLYX5CB04fSeQ6tF1aY/PuoAoGCCqGSM49
AwEHoUQDQgAEPR3tU2Fta9ktY+6P9G0cWO+0kETA6SFs38GecTyudlHz6xvCdz8q
EKTcWGekdmdDPsHloRNtsiCa697B2O9IFA==
-----END EC PRIVATE KEY-----
EOF
}
}
}
}
}
Loading
Loading