alicloud_event_bridge_connection

Provides a Event Bridge Connection resource.

For information about Event Bridge Connection and how to use it, see What is Connection.

Example Usage

Basic Usage

provider "alicloud" {
  region = var.region
}

variable "region" {
  default = "cn-chengdu"
}

variable "name" {
  default = "terraform-example"
}

data "alicloud_zones" "default" {
}

resource "alicloud_vpc" "default" {
  vpc_name   = var.name
  cidr_block = "172.16.0.0/16"
}

resource "alicloud_vswitch" "default" {
  vpc_id       = alicloud_vpc.default.id
  cidr_block   = "172.16.0.0/24"
  zone_id      = data.alicloud_zones.default.zones[0].id
  vswitch_name = var.name
}

resource "alicloud_security_group" "default" {
  name   = var.name
  vpc_id = alicloud_vswitch.default.vpc_id
}

resource "alicloud_event_bridge_connection" "default" {
  connection_name = var.name
  description     = "test-connection-basic-pre"
  network_parameters {
    network_type      = "PublicNetwork"
    vpc_id            = alicloud_vpc.default.id
    vswitche_id       = alicloud_vswitch.default.id
    security_group_id = alicloud_security_group.default.id
  }
  auth_parameters {
    authorization_type = "BASIC_AUTH"
    api_key_auth_parameters {
      api_key_name  = "Token"
      api_key_value = "Token-value"
    }
    basic_auth_parameters {
      username = "admin"
      password = "admin"
    }
    oauth_parameters {
      authorization_endpoint = "http://127.0.0.1:8080"
      http_method            = "POST"
      client_parameters {
        client_id     = "ClientId"
        client_secret = "ClientSecret"
      }
      oauth_http_parameters {
        header_parameters {
          key             = "name"
          value           = "name"
          is_value_secret = "true"
        }
        body_parameters {
          key             = "name"
          value           = "name"
          is_value_secret = "true"
        }
        query_string_parameters {
          key             = "name"
          value           = "name"
          is_value_secret = "true"
        }
      }
    }
  }
}

Argument Reference

The following arguments are supported:

network_parameters

The network_parameters supports the following:

auth_parameters

The auth_parameters supports the following:

auth_parameters-api_key_auth_parameters

The api_key_auth_parameters supports the following:

auth_parameters-basic_auth_parameters

The basic_auth_parameters supports the following:

auth_parameters-oauth_parameters

The oauth_parameters supports the following:

auth_parameters-oauth_parameters-client_parameters

The client_parameters supports the following:

auth_parameters-oauth_parameters-oauth_http_parameters

The oauth_http_parameters supports the following:

auth_parameters-oauth_parameters-oauth_http_parameters-header_parameters

The header_parameters supports the following:

auth_parameters-oauth_parameters-oauth_http_parameters-body_parameters

The body_parameters supports the following:

auth_parameters-oauth_parameters-oauth_http_parameters-query_string_parameters

The query_string_parameters supports the following:

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Event Bridge Connection can be imported using the id, e.g.

$ terraform import alicloud_event_bridge_connection.example <id>