~> 弃用通知 Equinix Metal 将于2026年6月30日停止服务。所有 Metal 资源将在该提供程序的 5.0.0 版本中移除。如需继续使用,请使用该提供程序的 4.x 版本直至服务终止。更多信息,请访问 https://docs.equinix.com/metal/。
equinix_metal_connection(资源)
使用此资源请求创建互连资产,以便使用 Equinix Fabric - 软件定义互连 与其他方连接。
用法示例
Fabric 计费共享虚拟连接 - 从您自己的 Equinix Fabric 端口到 Equinix Metal 的非冗余连接
resource "equinix_metal_vlan" "example" {
project_id = "<metal_project_id>"
metro = "FR"
}
resource "equinix_metal_connection" "example" {
name = "tf-metal-from-port"
project_id = "<metal_project_id>"
type = "shared"
redundancy = "primary"
metro = "FR"
speed = "200Mbps"
service_token_type = "z_side"
contact_email = "username@example.com"
vlans = [equinix_metal_vlan.example.vxlan]
}
data "equinix_fabric_ports" "a_side" {
filters {
name = "<name_of_port||port_prefix>"
}
}
resource "equinix_fabric_connection" "example" {
name = "tf-metal-from-port"
type = "EVPL_VC"
bandwidth = "200"
notifications {
type = "ALL"
emails = ["username@example.com"]
}
order { purchase_order_number = "1-323292" }
project { project_id = "<fabric_project_id>" }
a_side {
access_point {
type = "COLO"
port {
uuid = data.equinix_fabric_ports.a_side.data.0.uuid
}
link_protocol {
type = "DOT1Q"
vlan_tag = 1234
}
}
}
z_side {
service_token {
uuid = equinix_metal_connection.example.service_tokens.0.id
}
}
}
-> 注意:有一个 Equinix Fabric L2 连接到 Equinix Metal Terraform 模块,其中包含从 Fabric 端口、网络边缘设备或服务令牌进行连接的完整示例。请查看 使用 Z 端服务令牌进行共享连接的示例。
Fabric 计费共享虚拟连接 - 从您自己的网络边缘设备到 Equinix Metal 的非冗余连接
resource "equinix_metal_vrf" "example" {
name = "tf-metal-from-ne"
metro = "FR"
local_asn = "65001"
ip_ranges = ["10.99.1.0/24"]
project_id = equinix_metal_project.test.id
}
resource "equinix_metal_connection" "example" {
name = "tf-metal-from-ne"
project_id = "<metal_project_id>"
type = "shared"
redundancy = "primary"
metro = "FR"
speed = "200Mbps"
service_token_type = "z_side"
contact_email = "username@example.com"
vrfs = [equinix_metal_vrf.example.vxlan]
}
resource "equinix_fabric_connection" "example" {
name = "tf-metal-from-ne"
type = "EVPL_VC"
bandwidth = "200"
notifications {
type = "ALL"
emails = ["username@example.com"]
}
order { purchase_order_number = "1-323292" }
project { project_id = "<fabric_project_id>" }
a_side {
access_point {
type = "VD"
virtual_device {
type = "EDGE"
uuid = equinix_network_device.example.id
}
}
}
z_side {
service_token {
uuid = equinix_metal_connection.example.service_tokens.0.id
}
}
}
Fabric 计费共享虚拟连接 - 从 Equinix Fabric 云路由器到 Equinix Metal 的非冗余连接
resource "equinix_metal_vlan" "example1" {
project_id = "<metal_project_id>"
metro = "SV"
}
resource "equinix_metal_connection" "example" {
name = "tf-metal-from-fcr"
project_id = "<metal_project_id>"
metro = "SV"
redundancy = "primary"
type = "shared_port_vlan"
contact_email = "username@example.com"
speed = "200Mbps"
vlans = [equinix_metal_vlan.example1.vxlan]
}
resource "equinix_fabric_connection" "example" {
name = "tf-metal-from-fcr"
type = "IP_VC"
bandwidth = "200"
notifications {
type = "ALL"
emails = ["username@example.com"]
}
project { project_id = "<fabric_project_id>" }
a_side {
access_point {
type = "CLOUD_ROUTER"
router {
uuid = equinix_fabric_cloud_router.example.id
}
}
}
z_side {
access_point {
type = "METAL_NETWORK"
authentication_key = equinix_metal_connection.example.authorization_code
}
}
}
金属计费共享虚拟连接 - 从 Equinix Metal 到云服务提供商的冗余连接
resource "equinix_metal_connection" "example" {
name = "tf-metal-2-azure"
project_id = "<metal_project_id>"
type = "shared"
redundancy = "redundant"
metro = "SV"
speed = "1Gbps"
service_token_type = "a_side"
contact_email = "username@example.com"
}
data "equinix_fabric_service_profiles" "zside" {
filter {
property = "/name"
operator = "="
values = ["Azure ExpressRoute"]
}
}
resource "equinix_fabric_connection" "example_primary" {
name = "tf-metal-2-azure-pri"
type = "EVPL_VC"
bandwidth = azurerm_express_route_circuit.example.bandwidth_in_mbps
redundancy { priority = "PRIMARY" }
notifications {
type = "ALL"
emails = ["username@example.com"]
}
project { project_id = "<fabric_project_id>" }
a_side {
service_token {
uuid = equinix_metal_connection.example.service_tokens.0.id
}
}
z_side {
access_point {
type = "SP"
authentication_key = azurerm_express_route_circuit.example.service_key
profile {
type = "L2_PROFILE"
uuid = data.equinix_fabric_service_profiles.zside.id
}
location {
metro_code = "SV"
}
}
}
}
resource "equinix_fabric_connection" "example_secondary" {
name = "tf-metal-2-azure-sec"
type = "EVPL_VC"
bandwidth = azurerm_express_route_circuit.example.bandwidth_in_mbps
redundancy {
priority = "SECONDARY"
group = one(equinix_fabric_connection.example_primary.redundancy).group
}
notifications {
type = "ALL"
emails = ["username@example.com"]
}
project { project_id = "<fabric_project_id>" }
a_side {
service_token {
uuid = equinix_metal_connection.example.service_tokens.1.id
}
}
z_side {
access_point {
type = "SP"
authentication_key = azurerm_express_route_circuit.example.service_key
profile {
type = "L2_PROFILE"
uuid = data.equinix_fabric_service_profiles.zside.id
}
location {
metro_code = "SV"
}
}
}
}
-> 注意:有多个 Equinix Fabric L2 连接 Terraform 模块 可用,其中包含从 Fabric 端口、网络边缘设备或服务令牌连接到大多数主流云服务提供商的完整示例。请查看包含 A 端服务令牌的 Equinix Metal 共享连接示例:AWS、Azure、[Google Cloud、[IBM Cloud、[Oracle Cloud、[Alibaba Cloud。
金属计费共享虚拟连接 - 从 Equinix Metal 到您自己的 Equinix Fabric 端口的非冗余连接
resource "equinix_metal_connection" "example" {
name = "tf-metal-2-port"
project_id = "<metal_project_id>"
type = "shared"
redundancy = "redundant"
metro = "FR"
speed = "1Gbps"
service_token_type = "a_side"
contact_email = "username@example.com"
}
data "equinix_fabric_ports" "a_side" {
filters {
name = "<name_of_port||port_prefix>"
}
}
resource "equinix_fabric_connection" "example" {
name = "tf-metal-2-port"
type = "EVPL_VC"
notifications {
type = "ALL"
emails = ["username@example.com"]
}
project {
project_id = "<fabric_project_id>"
}
bandwidth = "100"
order {
purchase_order_number = "1-323292"
}
a_side {
service_token {
uuid = equinix_metal_connection.example.service_tokens.0.id
}
}
z_side {
access_point {
type = "COLO"
port {
uuid = data.equinix_fabric_ports.a_side.data.0.uuid
}
link_protocol {
type = "DOT1Q"
vlan_tag = 1234
}
}
}
}
模式
需要
name(字符串)连接资源的名称redundancy(字符串)连接冗余 - 冗余或主连接type(字符串)连接类型 - 专用、共享或共享端口 VLAN
可选
contact_email(字符串)用于 Equinix Fabric 互连通信和通知的首选电子邮件地址description(字符串)连接资源的描述facility(字符串,已弃用)将要创建连接的设施metro(字符串)将要建立连接的地铁线路mode(字符串)IBX 设施中专用类型连接的模式 - 标准或隧道organization_id(字符串)负责连接的组织的 ID。适用于类型“专用”project_id(字符串)连接作用域所指向的项目的 ID。类型为“shared”时为必填项。service_token_type(字符串)仅用于共享连接。用于连接的服务令牌类型,a_side 或 z_side。speed(字符串)连接速度 - 值必须采用“Mbps”或“ 例如,Gbps 可以是“100Mbps”或“50Gbps”。实际支持的值取决于连接类型以及连接是否使用 VLAN 或 VRF。 tags(字符串列表)附加到连接的标签vlans(数字列表)仅用于共享连接。要附加的 VLAN。主连接/单连接传递一个 VLAN,冗余连接传递两个 VLAN。vrfs(字符串列表)仅用于共享连接。要附加的 VRF。主连接/单连接传递一个 VRF,冗余连接传递两个 VRF。
只读
authorization_code(字符串)仅用于 Fabric 共享连接。Fabric 使用此令牌在 Fabric 内部查看资源时,能够提供有关网络 Metal 端的更详细信息。id(字符串)资源的唯一标识符ports(对象列表)连接端口列表 - 主端口 (ports[0]) 和辅助端口 (ports[1])(有关嵌套模式,请参见下面的嵌套模式)service_tokens(对象列表)仅用于共享连接。继续使用 equinix_fabric_connection 或从 [Equinix Fabric Portal 获取设置过程所需的服务令牌列表(有关嵌套架构,请参见下文)。status(字符串)连接资源的状态token(字符串,已弃用)仅用于共享连接。需要 Fabric Token 才能通过 equinix_fabric_connection 或 [Equinix Fabric Portal 继续设置过程。
ports 的嵌套模式
只读:
id(字符串)link_status(字符串)name(字符串)role(字符串)speed(数字)status(字符串)virtual_circuit_ids(字符串列表)
service_tokens 的嵌套模式
只读:
expires_at(字符串)id(字符串)max_allowed_speed(字符串)role(字符串)state(字符串)type(字符串)