Add Your First Integration

Guess what? It's Slack.


Here, we'll be doing two important things:

  1. Declaring our first integration as a Terraform resource
  2. Using that integration to declare a destination for error messages

Declaring the Slack Integration

Remember that Slack app we installed? To use it, we'll have to link it to the rest of our workflow using a sym_integration:

resource "sym_integration" "slack" {
  type = "slack"
  name = "${var.environment_name}-slack"

  external_id = var.slack_workspace_id

Note that we're also using a few variables from terraform.tfvars to help us out. Be sure to set slack_workspace_id to the same workspace ID you used to install the Sym Slack app:

slack_workspace_id = "CHANGEME"
environment_name   = "main"

Declaring the Error Logger

Now that we have a Slack Integration set up, we can use it to declare a sym_error_logger. When used by a Flow, the sym_error_logger will output any warnings or errors that occur during execution to a specified channel in Slack:

# Send errors during Flow execution to a shared logging channel
resource "sym_error_logger" "slack" {
  integration_id =  # Use the integration we just created!
  destination    = var.error_channel_name

The destination above can be any Slack channel name in the workspace that the integration points to. Set it to whatever works best for your organization in terraform.tfvars:

error_channel_name = "#sym-errors"

One Extra Variable

If you're following along with the quickstart, you may have noticed there's one Slack-related variable we haven't talked about yet. We'll talk about flow_variables soon, but for now just note that the request_channel is where your Sym requests will show up.

flow_variables = {
  request_channel = "#sym-requests"  # Slack Channel where requests should go

Next steps

Now that Slack is all set, we can finalize the core setup.

  1. Install Sym's Slack app
  2. Set up Sym's Terraform Provider
  3. Configure your Terraform to work with Sym ← you are here
  4. Implement your first Flow

Did this page help you?