[ Web Proxy ]
URL:
Viewing: https://docs.digitalocean.com/reference/terraform/reference/data-sources/vpc_peering/ [Back]  [Original]

digitalocean_vpc_peering | DigitalOcean Documentation

For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).

digitalocean_vpc_peering

Generated on 18 Aug 2026 from Terraform version v2.100.0

Copy page as Markdown View page as Markdown

Retrieve information about a VPC Peering for use in other resources.

This data source provides all of the VPC Peering’s properties as configured on your DigitalOcean account. This is useful if the VPC Peering in question is not managed by Terraform or you need to utilize any of the VPC Peering’s data.

VPC Peerings may be looked up by id or name.

Example Usage

VPC Peering By Id

data "digitalocean_vpc_peering" "example" {
  id = "example-id"
}

Reuse the data about a VPC Peering in other resources:

data "digitalocean_vpc_peering" "example" {
  id = "example-id"
}

resource "digitalocean_droplet" "example" {
  name     = "example-01"
  size     = "s-1vcpu-1gb"
  image    = "ubuntu-18-04-x64"
  region   = "nyc3"
  vpc_uuid = data.digitalocean_vpc_peering.example.vpc_ids[0]
}

VPC Peering By Name

data "digitalocean_vpc_peering" "example" {
  name = "example-peering"
}

Reuse the data about a VPC Peering in other resources:

data "digitalocean_vpc_peering" "example" {
  name = "example-peering"
}

resource "digitalocean_droplet" "example" {
  name     = "example-01"
  size     = "s-1vcpu-1gb"
  image    = "ubuntu-18-04-x64"
  region   = "nyc3"
  vpc_uuid = data.digitalocean_vpc_peering.example.vpc_ids[0]
}

Argument Reference

The following arguments are supported and are mutually exclusive:

Attributes Reference

In this article...


We can't find any results for your search.

Try using different keywords or simplifying your search terms.


Web Proxy Viewer  |  New URL  |  Original Page