alicloud_pvtz_zone_attachment

Provides vpcs bound to Alicloud Private Zone resource.

Example Usage

Using vpc_ids to attach being in same region several vpc instances to a private zone

resource "alicloud_pvtz_zone" "zone" {
  zone_name = "foo.example.com"
}

resource "alicloud_vpc" "first" {
  vpc_name   = "the-first-vpc"
  cidr_block = "172.16.0.0/12"
}
resource "alicloud_vpc" "second" {
  vpc_name   = "the-second-vpc"
  cidr_block = "172.16.0.0/16"
}

resource "alicloud_pvtz_zone_attachment" "zone-attachment" {
  zone_id = alicloud_pvtz_zone.zone.id
  vpc_ids = [alicloud_vpc.first.id, alicloud_vpc.second.id]
}

Using vpcs to attach being in same region several vpc instances to a private zone

resource "alicloud_pvtz_zone" "zone" {
  zone_name = "foo.example.com"
}

resource "alicloud_vpc" "first" {
  vpc_name   = "the-first-vpc"
  cidr_block = "172.16.0.0/12"
}
resource "alicloud_vpc" "second" {
  vpc_name   = "the-second-vpc"
  cidr_block = "172.16.0.0/16"
}

resource "alicloud_pvtz_zone_attachment" "zone-attachment" {
  zone_id = alicloud_pvtz_zone.zone.id
  vpcs {
    vpc_id = alicloud_vpc.first.id
  }
  vpcs {
    vpc_id = alicloud_vpc.second.id
  }
}

Using vpcs to attach being in different regions several vpc instances to a private zone

resource "alicloud_pvtz_zone" "zone" {
  zone_name = "foo.example.com"
}

resource "alicloud_vpc" "first" {
  vpc_name   = "the-first-vpc"
  cidr_block = "172.16.0.0/12"
}
resource "alicloud_vpc" "second" {
  vpc_name   = "the-second-vpc"
  cidr_block = "172.16.0.0/16"
}

provider "alicloud" {
  alias  = "eu"
  region = "eu-central-1"
}

resource "alicloud_vpc" "third" {
  provider   = alicloud.eu
  vpc_name   = "the-third-vpc"
  cidr_block = "172.16.0.0/16"
}

resource "alicloud_pvtz_zone_attachment" "zone-attachment" {
  zone_id = alicloud_pvtz_zone.zone.id
  vpcs {
    vpc_id = alicloud_vpc.first.id
  }
  vpcs {
    vpc_id = alicloud_vpc.second.id
  }
  vpcs {
    region_id = "eu-central-1"
    vpc_id    = alicloud_vpc.third.id
  }
}

Argument Reference

The following arguments are supported:

vpcs

The vpcs support the following:

Timeouts

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

Attributes Reference

The following attributes are exported:

Import

Private Zone attachment can be imported using the id(same with zone_id), e.g.

$ terraform import alicloud_pvtz_zone_attachment.example abc123456