Skip to content

Latest commit

 

History

History
130 lines (105 loc) · 5.46 KB

File metadata and controls

130 lines (105 loc) · 5.46 KB
page_title configcat_integration Resource - terraform-provider-configcat
subcategory
description Creates and manages an Integration. Read more about Integrations in ConfigCat https://configcat.com/docs/integrations/overview/

configcat_integration (Resource)

Creates and manages an Integration. Read more about Integrations in ConfigCat

Example Usage

variable "product_id" {
  type = string
}

variable "config_id" {
  type = string
}

variable "environment_id" {
  type = string
}

# Configure connected configs and environments
resource "configcat_integration" "slack_integration_with_configs_and_environments" {
  product_id       = var.product_id
  integration_type = "slack"
  name             = "Slack integration"
  parameters = {
    "incoming_webhook.url" = "https://mycompany.slack.com/services/B0000000000"
  }

  configs      = [var.config_id]
  environments = [var.environment_id]
}

# Slack integration (https://configcat.com/docs/integrations/slack/)
resource "configcat_integration" "slack_integration" {
  product_id       = var.product_id
  integration_type = "slack"
  name             = "Slack integration"
  parameters = {
    "incoming_webhook.url" = "https://mycompany.slack.com/services/B0000000000" # The incoming webhook URL where the integration should post messages. Read more at https://api.slack.com/messaging/webhooks.
    "includeSensitiveData" = "true"                                             # Set to "true" to include sensitive (hashed) comparison values. By default, the integration will mask these values in the posted messages. We recommend hiding sensitive comparison values for shared or public Slack channels. Read more at https://configcat.com/docs/targeting/targeting-rule/user-condition/#confidential-text-comparators.
  }
}

# Datadog integration (https://configcat.com/docs/integrations/datadog/)
resource "configcat_integration" "datadog_integration" {
  product_id       = var.product_id
  integration_type = "dataDog"
  name             = "Datadog integration"
  parameters = {
    "apikey" = ""   # Datadog API key. Read more at https://docs.datadoghq.com/account_management/api-app-keys/#api-keys
    "site"   = "Us" # Optional. Datadog site. Available values: Us, Eu, Us1Fed, Us3, Us5. Default: Us. Read more at https://docs.datadoghq.com/getting_started/site/.
  }
}

# Amplitude integration (https://configcat.com/docs/integrations/amplitude/#annotations)
resource "configcat_integration" "amplitude_integration" {
  product_id       = var.product_id
  integration_type = "amplitude"
  name             = "Amplitude integration"
  parameters = {
    "apikey"    = "" # Amplitude API Key. Read more at https://amplitude.com/docs/apis/authentication.
    "secretKey" = "" # Amplitude Secret Key. Read more at https://amplitude.com/docs/apis/authentication.
  }
}

# Mixpanel integration (https://configcat.com/docs/integrations/mixpanel/#annotations)
resource "configcat_integration" "mixpanel_integration" {
  product_id       = var.product_id
  integration_type = "mixPanel"
  name             = "Mixpanel integration"
  parameters = {
    "serviceAccountUserName" = ""               # Mixpanel Service Account Username.
    "serviceAccountSecret"   = ""               # Mixpanel Service Account Secret.
    "projectId"              = ""               # Mixpanel Project ID.
    "server"                 = "StandardServer" # Mixpanel Server. Available values: StandardServer, EUResidencyServer. Default: StandardServer. Read more at https://docs.mixpanel.com/docs/privacy/eu-residency.
  }
}

# Segment integration (https://configcat.com/docs/integrations/segment/#changeevents)
resource "configcat_integration" "mixpanel_integration" {
  product_id       = var.product_id
  integration_type = "segment"
  name             = "Mixpanel integration"
  parameters = {
    "writeKey" = ""               # Twilio Segment Write Key.
    "server"   = "StandardServer" # Twilio Segment Server. Available values: Us, Eu. Default: Us. Read more at https://segment.com/docs/guides/regional-segment/.
  }
}

output "slack_integration_id" {
  value = configcat_integration.slack_integration.id
}

Schema

Required

  • integration_type (String) The integration type of the Integration. Possible values: dataDog, slack, amplitude, mixPanel, segment, pubNub.
  • name (String) The name of the Integration.
  • product_id (String) The ID of the Product.

Optional

  • configs (Set of String) List of Config IDs that are connected with this Integration. If the list is empty, all of the Configs are connected.
  • environments (Set of String) List of Environment IDs that are connected with this Integration. If the list is empty, all of the Environments are connected.
  • parameters (Map of String) Parameters of the integration. The Parameters dictionary differs for each IntegrationType. See available options per integration type at the Example usage section.

Read-Only

  • id (String) The unique ID of the Integration.

Import

Import is supported using the following syntax:

# Integrations can be imported using the IntegrationId. Get the IntegrationId using the [List Integrations API](https://api.configcat.com/docs/index.html#tag/Integrations/operation/get-integrations) for example.

terraform import configcat_integration.example 08d86d63-2726-47cd-8bfc-59608ecb91e2