| page_title | configcat_webhook Resource - terraform-provider-configcat |
|---|---|
| subcategory | |
| description | Creates and manages a Webhook. What is a Webhook in ConfigCat? https://configcat.com/docs/advanced/notifications-webhooks/ |
Creates and manages a Webhook. What is a Webhook in ConfigCat?
variable "config_id" {
type = string
}
variable "environment_id" {
type = string
}
resource "configcat_webhook" "my_webhook" {
config_id = var.config_id
environment_id = var.environment_id
url = "https://example.com"
http_method = "post"
content = "The HTTP body content."
webhook_headers = [
{ "webhookheaderkey" = "webhookheadervalue" }
]
secure_webhook_headers = [
{ "securewebhookheaderkey" = "securewebhookheadervalue" }
]
}
output "webhook_id" {
value = configcat_webhook.my_webhook.id
}config_id(String) The ID of the Config.environment_id(String) The ID of the Environment.url(String) The URL of the Webhook.
content(String) The HTTP body content.http_method(String) The HTTP method. Available values:get|post. Default:getsecure_webhook_headers(Attributes List) List of secret HTTP headers. The value of a secret header is write-only, nobody will see it after saving the webhook. It won't appear in audit logs and on the webhook test UI either. It is important to note that webhooks containing secure webhook headers cannot be imported viaterraform import. Secure webhook headers can be managed via Terraform or via the ConfigCat Dashboard, but not both of them. If you manage your webhook with Terraform, and you change a secure webhook header on the ConfigCat Dashboard, Terraform will not be able to detect these changes. (see below for nested schema)webhook_headers(Attributes List) List of plain text HTTP headers. The value of a plain text header is always visible for everyone. It also appears in audit logs and on the webhook test UI. (see below for nested schema)
id(Number) The unique ID of the Webhook.
Required:
key(String) The HTTP header key.value(String, Sensitive) The HTTP header value.
Required:
key(String) The HTTP header key.value(String) The HTTP header value.
Import is supported using the following syntax:
# Webhooks can be imported using the WebhookId. Get the WebhookId using the [List Webhooks API](https://api.configcat.com/docs/index.html#tag/Webhooks/operation/get-webhooks) for example.
# It is important to note that webhooks containing secure webhook headers cannot be imported via `terraform import`.
# If you want to manage your webhooks that already contain secure webhook headers, you should create brand new configcat_webhook resources in Terraform without importing them. After they are created successfully and managed by Terraform, you can safely delete the old, non Terraform managed webhook from the ConfigCat Dashboard.
terraform import configcat_webhook.example 1234