confluent_peering Resource

General Availability

confluent_peering provides a Peering resource that enables creating, editing, and deleting Peerings on Confluent Cloud.

Example Usage

Example Peering on AWS

resource "confluent_environment" "development" {
  display_name = "Development"
}

resource "confluent_network" "aws-peering" {
  display_name     = "AWS Peering Network"
  cloud            = "AWS"
  region           = "us-east-2"
  cidr             = "10.10.0.0/16"
  connection_types = ["PEERING"]
  environment {
    id = confluent_environment.development.id
  }

  lifecycle {
    prevent_destroy = true
  }
}

resource "confluent_peering" "aws" {
  display_name = "AWS Peering"
  aws {
    account         = "012345678901"
    vpc             = "vpc-abcdef0123456789a"
    routes          = ["172.31.0.0/16"]
    customer_region = "us-east-2"
  }
  environment {
    id = confluent_environment.development.id
  }
  network {
    id = confluent_network.aws-peering.id
  }

  lifecycle {
    prevent_destroy = true
  }
}

Example Peering on Azure

resource "confluent_environment" "development" {
  display_name = "Development"
}

resource "confluent_network" "azure-peering" {
  display_name     = "Azure Peering Network"
  cloud            = "AZURE"
  region           = "centralus"
  cidr             = "10.10.0.0/16"
  connection_types = ["PEERING"]
  environment {
    id = confluent_environment.development.id
  }

  lifecycle {
    prevent_destroy = true
  }
}

resource "confluent_peering" "azure" {
  display_name = "Azure Peering"
  azure {
    tenant          = "1111tttt-1111-1111-1111-111111tttttt"
    vnet            = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Network/virtualNetworks/my-vnet"
    customer_region = "centralus"
  }
  environment {
    id = confluent_environment.development.id
  }
  network {
    id = confluent_network.azure-peering.id
  }

  lifecycle {
    prevent_destroy = true
  }
}

Example Peering on GCP

resource "confluent_environment" "development" {
  display_name = "Development"

  lifecycle {
    prevent_destroy = true
  }
}

resource "confluent_network" "gcp-peering" {
  display_name = "GCP Peering Network"
  cloud = "GCP"
  region = "us-west4"
  cidr = "10.10.0.0/16"
  connection_types = ["PEERING"]
  environment {
    id = confluent_environment.development.id
  }

  lifecycle {
    prevent_destroy = true
  }
}

resource "confluent_peering" "gcp" {
  display_name = "GCP Peering"
  gcp {
    project = "temp-gear-123456"
    vpc_network = "customer-test-vpc-network"
    customer_region = "us-west4"
  }
  environment {
    id = confluent_environment.development.id
  }
  network {
    id = confluent_network.gcp-peering.id
  }

  lifecycle {
    prevent_destroy = true
  }
}

Argument Reference

The following arguments are supported:

Attributes Reference

In addition to the preceding arguments, the following attributes are exported:

Import

You can import a Peering by using Environment ID and Peering ID, in the format <Environment ID>/<Peering ID>. The following example shows how to import a Peering:

$ export CONFLUENT_CLOUD_API_KEY="<cloud_api_key>"
$ export CONFLUENT_CLOUD_API_SECRET="<cloud_api_secret>"
$ terraform import confluent_peering.my_peer env-abc123/peer-abc123

Getting Started

The following end-to-end examples might help to get started with confluent_peering resource: