Resource: aws_cloudwatch_event_connection

Provides an EventBridge connection resource.

Example Usage

resource "aws_cloudwatch_event_connection" "test" {
  name               = "ngrok-connection"
  description        = "A connection description"
  authorization_type = "API_KEY"

  auth_parameters {
    api_key {
      key   = "x-signature"
      value = "1234"
    }
  }
}

Example Usage Basic Authorization

resource "aws_cloudwatch_event_connection" "test" {
  name               = "ngrok-connection"
  description        = "A connection description"
  authorization_type = "BASIC"

  auth_parameters {
    basic {
      username = "user"
      password = "Pass1234!"
    }
  }
}

Example Usage OAuth Authorization

resource "aws_cloudwatch_event_connection" "test" {
  name               = "ngrok-connection"
  description        = "A connection description"
  authorization_type = "OAUTH_CLIENT_CREDENTIALS"

  auth_parameters {
    oauth {
      authorization_endpoint = "https://auth.url.com/endpoint"
      http_method            = "GET"

      client_parameters {
        client_id     = "1234567890"
        client_secret = "Pass1234!"
      }

      oauth_http_parameters {
        body {
          key             = "body-parameter-key"
          value           = "body-parameter-value"
          is_value_secret = false
        }

        header {
          key             = "header-parameter-key"
          value           = "header-parameter-value"
          is_value_secret = false
        }

        query_string {
          key             = "query-string-parameter-key"
          value           = "query-string-parameter-value"
          is_value_secret = false
        }
      }
    }
  }
}

Example Usage Invocation Http Parameters

resource "aws_cloudwatch_event_connection" "test" {
  name               = "ngrok-connection"
  description        = "A connection description"
  authorization_type = "BASIC"

  auth_parameters {
    basic {
      username = "user"
      password = "Pass1234!"
    }

    invocation_http_parameters {
      body {
        key             = "body-parameter-key"
        value           = "body-parameter-value"
        is_value_secret = false
      }

      body {
        key             = "body-parameter-key2"
        value           = "body-parameter-value2"
        is_value_secret = true
      }

      header {
        key             = "header-parameter-key"
        value           = "header-parameter-value"
        is_value_secret = false
      }

      query_string {
        key             = "query-string-parameter-key"
        value           = "query-string-parameter-value"
        is_value_secret = false
      }
    }
  }
}

Argument Reference

This resource supports the following arguments:

auth_parameters support the following:

api_key support the following:

basic support the following:

oauth support the following:

invocation_http_parameters and oauth_http_parameters support the following:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import EventBridge connection using the name. For example:

import {
  to = aws_cloudwatch_event_connection.test
  id = "ngrok-connection"
}

Using terraform import, import EventBridge EventBridge connection using the name. For example:

% terraform import aws_cloudwatch_event_connection.test ngrok-connection