From b58b482c1e8df0fe0e06d29a49259fe87929ce8d Mon Sep 17 00:00:00 2001 From: Srushti Patel <137830748+srushti-patl@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:08:33 -0700 Subject: [PATCH] CXF 100801 Adding Z-side VD service token creation and VD 2 Service Token Connection example (#148) * feat: Adding Zside VD based Service Token Example and VD 2 Service Token Connection Example * fix: Updating outputs for all examples * fix: Updating outputs for all examples based on module change * fix: Updating equinix provider version --- .../cloud-router-2-aws-connection/outputs.tf | 4 +- .../outputs.tf | 4 +- .../outputs.tf | 8 +- .../outputs.tf | 4 +- .../outputs.tf | 8 +- .../outputs.tf | 2 +- .../outputs.tf | 4 +- .../cloud-router-2-port-connection/outputs.tf | 4 +- .../outputs.tf | 4 +- .../outputs.tf | 2 +- .../outputs.tf | 4 +- .../cloud-router-2-wan-connection/outputs.tf | 4 +- .../outputs.tf | 4 +- .../cloud-router-routing-protocols/outputs.tf | 6 +- .../metal-nimf-2-aws-connection/outputs.tf | 4 +- .../metal-nimf-2-azure-connection/outputs.tf | 4 +- .../metal-nimf-2-google-connection/outputs.tf | 4 +- .../metal-nimf-2-ibm2-connection/outputs.tf | 4 +- .../metal-nimf-2-oracle-connection/outputs.tf | 4 +- .../metal-nimf-2-port-connection/outputs.tf | 4 +- .../outputs.tf | 4 +- examples/port-2-alibaba-connection/outputs.tf | 4 +- examples/port-2-aws-connection/outputs.tf | 4 +- examples/port-2-azure-connection/outputs.tf | 4 +- .../outputs.tf | 6 +- examples/port-2-google-connection/outputs.tf | 4 +- examples/port-2-ibm1-connection/outputs.tf | 4 +- examples/port-2-ibm2-connection/outputs.tf | 4 +- examples/port-2-oracle-connection/outputs.tf | 4 +- examples/port-2-port-connection/outputs.tf | 4 +- .../outputs.tf | 4 +- .../outputs.tf | 4 +- .../README.md | 11 ++ .../main.tf | 65 ++++++++ .../outputs.tf | 3 + .../terraform.tfvars.example | 44 +++++ .../variables.tf | 151 ++++++++++++++++++ .../versions.tf | 9 ++ .../outputs.tf | 2 +- .../outputs.tf | 4 +- .../outputs.tf | 4 +- .../outputs.tf | 4 +- .../README.md | 13 ++ .../main.tf | 22 +++ .../outputs.tf | 3 + .../terraform.tfvars.example | 13 ++ .../variables.tf | 50 ++++++ .../versions.tf | 9 ++ modules/cloud-router-connection/outputs.tf | 8 +- modules/cloud-router-route-filters/outputs.tf | 11 ++ .../cloud-router-routing-protocols/outputs.tf | 8 +- modules/metal-connection/outputs.tf | 4 +- modules/port-connection/main.tf | 18 +++ modules/port-connection/outputs.tf | 8 +- modules/port-connection/variables.tf | 6 + modules/service-token-connection/outputs.tf | 4 +- modules/virtual-device-connection/outputs.tf | 8 +- 57 files changed, 523 insertions(+), 95 deletions(-) create mode 100644 examples/service-token-for-zside-virtual-device/README.md create mode 100644 examples/service-token-for-zside-virtual-device/main.tf create mode 100644 examples/service-token-for-zside-virtual-device/outputs.tf create mode 100644 examples/service-token-for-zside-virtual-device/terraform.tfvars.example create mode 100644 examples/service-token-for-zside-virtual-device/variables.tf create mode 100644 examples/service-token-for-zside-virtual-device/versions.tf create mode 100644 examples/virtual-device-2-service-token-connection/README.md create mode 100644 examples/virtual-device-2-service-token-connection/main.tf create mode 100644 examples/virtual-device-2-service-token-connection/outputs.tf create mode 100644 examples/virtual-device-2-service-token-connection/terraform.tfvars.example create mode 100644 examples/virtual-device-2-service-token-connection/variables.tf create mode 100644 examples/virtual-device-2-service-token-connection/versions.tf diff --git a/examples/cloud-router-2-aws-connection/outputs.tf b/examples/cloud-router-2-aws-connection/outputs.tf index 7a19ade9..4aa11bc0 100644 --- a/examples/cloud-router-2-aws-connection/outputs.tf +++ b/examples/cloud-router-2-aws-connection/outputs.tf @@ -1,5 +1,5 @@ -output "aws_connection_id" { - value = module.cloud_router_aws_connection.primary_connection_id +output "aws_connection" { + value = module.cloud_router_aws_connection.primary_connection } output "aws_dx_gateway_id" { value = aws_dx_gateway.aws_gateway.id diff --git a/examples/cloud-router-2-azure-connection/outputs.tf b/examples/cloud-router-2-azure-connection/outputs.tf index e9a7b5bd..58cbd053 100644 --- a/examples/cloud-router-2-azure-connection/outputs.tf +++ b/examples/cloud-router-2-azure-connection/outputs.tf @@ -4,6 +4,6 @@ output "azurerm_resource_group_id" { output "azurerm_express_route_circuit" { value = azurerm_express_route_circuit.fcr2azure.id } -output "azure_connection_id" { - value = module.cloud_router_azure_connection.primary_connection_id +output "azure_connection" { + value = module.cloud_router_azure_connection.primary_connection } diff --git a/examples/cloud-router-2-azure-redundant-connection/outputs.tf b/examples/cloud-router-2-azure-redundant-connection/outputs.tf index 4967edb9..c73ea258 100644 --- a/examples/cloud-router-2-azure-redundant-connection/outputs.tf +++ b/examples/cloud-router-2-azure-redundant-connection/outputs.tf @@ -4,9 +4,9 @@ output "azurerm_resource_group_id" { output "azurerm_express_route_circuit" { value = azurerm_express_route_circuit.fcr2azure.id } -output "azure_primary_connection_id" { - value = module.cloud_router_azure_redundant_connection.primary_connection_id +output "azure_primary_connection" { + value = module.cloud_router_azure_redundant_connection.primary_connection } -output "azure_secondary_connection_id" { - value = var.secondary_connection_name != "" ? module.cloud_router_azure_redundant_connection.secondary_connection_id : null +output "azure_secondary_connection" { + value = module.cloud_router_azure_redundant_connection.secondary_connection } diff --git a/examples/cloud-router-2-google-connection/outputs.tf b/examples/cloud-router-2-google-connection/outputs.tf index d956a123..0fdf20cd 100644 --- a/examples/cloud-router-2-google-connection/outputs.tf +++ b/examples/cloud-router-2-google-connection/outputs.tf @@ -7,6 +7,6 @@ output "GCP_Router_Id" { output "GCP_Interconnect_Id" { value = google_compute_interconnect_attachment.cloud-router-google.id } -output "Google_Connection_Id" { - value = module.cloud_router_google_connection.primary_connection_id +output "Google_Connection" { + value = module.cloud_router_google_connection.primary_connection } diff --git a/examples/cloud-router-2-metal-nimf-connection/outputs.tf b/examples/cloud-router-2-metal-nimf-connection/outputs.tf index fff22bb9..41c6d28a 100644 --- a/examples/cloud-router-2-metal-nimf-connection/outputs.tf +++ b/examples/cloud-router-2-metal-nimf-connection/outputs.tf @@ -4,11 +4,11 @@ output "metal_vlan_id" { output "metal_connection_id" { value = equinix_metal_connection.metal-connection.id } -output "cloud_router_metal_connection_id" { - value = module.cloud_router_2_metal_connection.primary_connection_id +output "cloud_router_metal_connection" { + value = module.cloud_router_2_metal_connection.primary_connection } -output "cloud_router_routing_protocol_id" { - value = module.routing_protocols.direct_routing_protocol_id +output "cloud_router_routing_protocol" { + value = module.routing_protocols.direct_routing_protocol } output "metal_connection_status" { value = data.equinix_metal_connection.NIMF-test.status diff --git a/examples/cloud-router-2-oracle-connection/outputs.tf b/examples/cloud-router-2-oracle-connection/outputs.tf index cabc6235..b6d48350 100644 --- a/examples/cloud-router-2-oracle-connection/outputs.tf +++ b/examples/cloud-router-2-oracle-connection/outputs.tf @@ -1,3 +1,3 @@ -output "oracle_connection_id" { +output "oracle_connection" { value = module.cloud_router_oracle_connection.primary_connection_id } diff --git a/examples/cloud-router-2-port-connection-with-route-filters/outputs.tf b/examples/cloud-router-2-port-connection-with-route-filters/outputs.tf index e7b6aa98..ad00632b 100644 --- a/examples/cloud-router-2-port-connection-with-route-filters/outputs.tf +++ b/examples/cloud-router-2-port-connection-with-route-filters/outputs.tf @@ -1,3 +1,3 @@ -output "port_connection_id" { - value = module.cloud_router_port_connection.primary_connection_id +output "port_connection" { + value = module.cloud_router_port_connection.primary_connection } diff --git a/examples/cloud-router-2-port-connection/outputs.tf b/examples/cloud-router-2-port-connection/outputs.tf index e7b6aa98..ad00632b 100644 --- a/examples/cloud-router-2-port-connection/outputs.tf +++ b/examples/cloud-router-2-port-connection/outputs.tf @@ -1,3 +1,3 @@ -output "port_connection_id" { - value = module.cloud_router_port_connection.primary_connection_id +output "port_connection" { + value = module.cloud_router_port_connection.primary_connection } diff --git a/examples/cloud-router-2-service-profile-connection/outputs.tf b/examples/cloud-router-2-service-profile-connection/outputs.tf index 67f2270c..a560d567 100644 --- a/examples/cloud-router-2-service-profile-connection/outputs.tf +++ b/examples/cloud-router-2-service-profile-connection/outputs.tf @@ -1,3 +1,3 @@ -output "service_profile_connection_id" { - value = module.cloud_router_sp_connection.primary_connection_id +output "service_profile_connection" { + value = module.cloud_router_sp_connection.primary_connection } diff --git a/examples/cloud-router-2-virtual-device-connection/outputs.tf b/examples/cloud-router-2-virtual-device-connection/outputs.tf index 179a8e8b..ca320df7 100644 --- a/examples/cloud-router-2-virtual-device-connection/outputs.tf +++ b/examples/cloud-router-2-virtual-device-connection/outputs.tf @@ -1,3 +1,3 @@ output "FCR_VD_Connection" { - value = module.cloud_router_virtual_device_connection.primary_connection_id + value = module.cloud_router_virtual_device_connection.primary_connection } diff --git a/examples/cloud-router-2-virtual-device-redundant-connection/outputs.tf b/examples/cloud-router-2-virtual-device-redundant-connection/outputs.tf index 93c8a3ff..f27e6d4e 100644 --- a/examples/cloud-router-2-virtual-device-redundant-connection/outputs.tf +++ b/examples/cloud-router-2-virtual-device-redundant-connection/outputs.tf @@ -1,7 +1,7 @@ output "FCR_VD_Primary_Connection" { - value = module.cloud_router_virtual_device_redundant_connection.primary_connection_id + value = module.cloud_router_virtual_device_redundant_connection.primary_connection } output "FCR_VD_Secondary_Connection" { - value = module.cloud_router_virtual_device_redundant_connection.secondary_connection_id + value = module.cloud_router_virtual_device_redundant_connection.secondary_connection } diff --git a/examples/cloud-router-2-wan-connection/outputs.tf b/examples/cloud-router-2-wan-connection/outputs.tf index cedeaf6d..b3a140cb 100644 --- a/examples/cloud-router-2-wan-connection/outputs.tf +++ b/examples/cloud-router-2-wan-connection/outputs.tf @@ -1,3 +1,3 @@ -output "wan_connection_id" { - value = module.cloud_router_wan_connection.primary_connection_id +output "wan_connection" { + value = module.cloud_router_wan_connection.primary_connection } diff --git a/examples/cloud-router-marketplace-susbscription/outputs.tf b/examples/cloud-router-marketplace-susbscription/outputs.tf index 2873f5d9..b1eca169 100644 --- a/examples/cloud-router-marketplace-susbscription/outputs.tf +++ b/examples/cloud-router-marketplace-susbscription/outputs.tf @@ -1,3 +1,3 @@ -output "cloud_router_id" { - value = equinix_fabric_cloud_router.create_fcr_marketplace_subscription.id +output "cloud_router" { + value = equinix_fabric_cloud_router.create_fcr_marketplace_subscription } diff --git a/examples/cloud-router-routing-protocols/outputs.tf b/examples/cloud-router-routing-protocols/outputs.tf index 0342de89..b9ae653f 100644 --- a/examples/cloud-router-routing-protocols/outputs.tf +++ b/examples/cloud-router-routing-protocols/outputs.tf @@ -1,7 +1,7 @@ -output "direct_rp_id" { - value = module.routing_protocols.direct_routing_protocol_id +output "direct_rp" { + value = module.routing_protocols.direct_routing_protocol } output "bgp_rp_id" { - value = module.routing_protocols.bgp_routing_protocol_id + value = module.routing_protocols.bgp_routing_protocol } diff --git a/examples/metal-nimf-2-aws-connection/outputs.tf b/examples/metal-nimf-2-aws-connection/outputs.tf index 420849a4..a711979d 100644 --- a/examples/metal-nimf-2-aws-connection/outputs.tf +++ b/examples/metal-nimf-2-aws-connection/outputs.tf @@ -4,8 +4,8 @@ output "metal_vlan_id" { output "metal_connection_id" { value = equinix_metal_connection.metal-connection.id } -output "metal_aws_connection_id" { - value = module.metal_2_aws_connection.primary_connection_id +output "metal_aws_connection" { + value = module.metal_2_aws_connection.primary_connection } output "aws_dx_gateway_id" { value = aws_dx_gateway.aws_gateway.id diff --git a/examples/metal-nimf-2-azure-connection/outputs.tf b/examples/metal-nimf-2-azure-connection/outputs.tf index c62dd31c..5fb83c18 100644 --- a/examples/metal-nimf-2-azure-connection/outputs.tf +++ b/examples/metal-nimf-2-azure-connection/outputs.tf @@ -10,8 +10,8 @@ output "azurerm_resource_group_id" { output "azurerm_express_route_circuit" { value = azurerm_express_route_circuit.metal2azure.id } -output "metal_azure_connection_id" { - value = module.metal_2_azure_connection.primary_connection_id +output "metal_azure_connection" { + value = module.metal_2_azure_connection.primary_connection } output "metal_connection_status" { value = data.equinix_metal_connection.NIMF-test.status diff --git a/examples/metal-nimf-2-google-connection/outputs.tf b/examples/metal-nimf-2-google-connection/outputs.tf index d35aebfb..a0986a35 100644 --- a/examples/metal-nimf-2-google-connection/outputs.tf +++ b/examples/metal-nimf-2-google-connection/outputs.tf @@ -13,8 +13,8 @@ output "GCP_Router_Id" { output "GCP_Interconnect_Id" { value = google_compute_interconnect_attachment.metal-nimf-google.id } -output "Metal_Google_Connection_Id" { - value = module.metal_2_google_connection.primary_connection_id +output "Metal_Google_Connection" { + value = module.metal_2_google_connection.primary_connection } output "metal_connection_status" { value = data.equinix_metal_connection.NIMF-test.status diff --git a/examples/metal-nimf-2-ibm2-connection/outputs.tf b/examples/metal-nimf-2-ibm2-connection/outputs.tf index 5133e4c7..5eff9fab 100644 --- a/examples/metal-nimf-2-ibm2-connection/outputs.tf +++ b/examples/metal-nimf-2-ibm2-connection/outputs.tf @@ -4,8 +4,8 @@ output "metal_vlan_id" { output "metal_connection_id" { value = equinix_metal_connection.metal-connection.id } -output "Metal_IBM2_Connection_Id" { - value = module.metal_2_ibm2_connection.primary_connection_id +output "Metal_IBM2_Connection" { + value = module.metal_2_ibm2_connection.primary_connection } output "IBM_Gateway_Action_Id" { value = ibm_dl_gateway_action.test_dl_gateway_action.id diff --git a/examples/metal-nimf-2-oracle-connection/outputs.tf b/examples/metal-nimf-2-oracle-connection/outputs.tf index 5d426805..60d8997a 100644 --- a/examples/metal-nimf-2-oracle-connection/outputs.tf +++ b/examples/metal-nimf-2-oracle-connection/outputs.tf @@ -4,8 +4,8 @@ output "metal_vlan_id" { output "metal_connection_id" { value = equinix_metal_connection.metal-connection.id } -output "metal_oracle_connection_id" { - value = module.metal_2_oracle_connection.primary_connection_id +output "metal_oracle_connection" { + value = module.metal_2_oracle_connection.primary_connection } output "metal_connection_status" { value = data.equinix_metal_connection.NIMF-test.status diff --git a/examples/metal-nimf-2-port-connection/outputs.tf b/examples/metal-nimf-2-port-connection/outputs.tf index ea3c31dc..62f3fb51 100644 --- a/examples/metal-nimf-2-port-connection/outputs.tf +++ b/examples/metal-nimf-2-port-connection/outputs.tf @@ -4,8 +4,8 @@ output "metal_vlan_id" { output "metal_connection_id" { value = equinix_metal_connection.metal-connection.id } -output "metal_port_connection_id" { - value = module.metal_2_port_connection.primary_connection_id +output "metal_port_connection" { + value = module.metal_2_port_connection.primary_connection } output "metal_connection_status" { value = data.equinix_metal_connection.NIMF-test.status diff --git a/examples/metal-nimf-2-service-profile-connection/outputs.tf b/examples/metal-nimf-2-service-profile-connection/outputs.tf index dd40ada8..43a3cdf6 100644 --- a/examples/metal-nimf-2-service-profile-connection/outputs.tf +++ b/examples/metal-nimf-2-service-profile-connection/outputs.tf @@ -4,8 +4,8 @@ output "metal_vlan_id" { output "metal_connection_id" { value = equinix_metal_connection.metal-connection.id } -output "metal_service_profile_connection_id" { - value = module.metal_2_service_profile.primary_connection_id +output "metal_service_profile_connection" { + value = module.metal_2_service_profile.primary_connection } output "metal_connection_status" { value = data.equinix_metal_connection.NIMF-test.status diff --git a/examples/port-2-alibaba-connection/outputs.tf b/examples/port-2-alibaba-connection/outputs.tf index 99625f42..5e4ff6ac 100644 --- a/examples/port-2-alibaba-connection/outputs.tf +++ b/examples/port-2-alibaba-connection/outputs.tf @@ -1,3 +1,3 @@ -output "alibaba_connection_id" { - value = module.create_port_2_alibaba_connection.primary_connection_id +output "alibaba_connection" { + value = module.create_port_2_alibaba_connection.primary_connection } diff --git a/examples/port-2-aws-connection/outputs.tf b/examples/port-2-aws-connection/outputs.tf index e119ef71..3435a8e3 100644 --- a/examples/port-2-aws-connection/outputs.tf +++ b/examples/port-2-aws-connection/outputs.tf @@ -1,5 +1,5 @@ -output "aws_connection_id" { - value = module.port_2_aws_connection.primary_connection_id +output "aws_connection" { + value = module.port_2_aws_connection.primary_connection } output "aws_dx_gateway_id" { value = aws_dx_gateway.aws_gateway.id diff --git a/examples/port-2-azure-connection/outputs.tf b/examples/port-2-azure-connection/outputs.tf index 5e9392b8..85efc642 100644 --- a/examples/port-2-azure-connection/outputs.tf +++ b/examples/port-2-azure-connection/outputs.tf @@ -1,3 +1,3 @@ -output "azure_connection_id" { - value = module.create_port_2_azure_connection.primary_connection_id +output "azure_connection" { + value = module.create_port_2_azure_connection.primary_connection } diff --git a/examples/port-2-azure-redundant-connections/outputs.tf b/examples/port-2-azure-redundant-connections/outputs.tf index 9ae6a14e..ad6b650a 100644 --- a/examples/port-2-azure-redundant-connections/outputs.tf +++ b/examples/port-2-azure-redundant-connections/outputs.tf @@ -1,7 +1,7 @@ -output "azure_primary_connection_id" { - value = module.create_port_2_azure_connections.primary_connection_id +output "azure_primary_connection" { + value = module.create_port_2_azure_connections.primary_connection } output "azure_secondary_connection_id" { - value = module.create_port_2_azure_connections.secondary_connection_id + value = module.create_port_2_azure_connections.secondary_connection } diff --git a/examples/port-2-google-connection/outputs.tf b/examples/port-2-google-connection/outputs.tf index 7636633e..a7ee1474 100644 --- a/examples/port-2-google-connection/outputs.tf +++ b/examples/port-2-google-connection/outputs.tf @@ -7,6 +7,6 @@ output "GCP_Router_Id" { output "GCP_Interconnect_Id" { value = google_compute_interconnect_attachment.port-google.id } -output "google_connection_id" { - value = module.create_port_2_google_connection.primary_connection_id +output "google_connection" { + value = module.create_port_2_google_connection.primary_connection } diff --git a/examples/port-2-ibm1-connection/outputs.tf b/examples/port-2-ibm1-connection/outputs.tf index 55b35066..68e33df8 100644 --- a/examples/port-2-ibm1-connection/outputs.tf +++ b/examples/port-2-ibm1-connection/outputs.tf @@ -1,3 +1,3 @@ -output "ibm1_connection_id" { - value = module.create_port_2_ibm1_connection.primary_connection_id +output "ibm1_connection" { + value = module.create_port_2_ibm1_connection.primary_connection } diff --git a/examples/port-2-ibm2-connection/outputs.tf b/examples/port-2-ibm2-connection/outputs.tf index a4aa011c..7f4457ba 100644 --- a/examples/port-2-ibm2-connection/outputs.tf +++ b/examples/port-2-ibm2-connection/outputs.tf @@ -1,5 +1,5 @@ -output "ibm2_connection_id" { - value = module.create_port_2_ibm2_connection.primary_connection_id +output "ibm2_connection" { + value = module.create_port_2_ibm2_connection.primary_connection } output "IBM_Gateway_Action_Id" { value = ibm_dl_gateway_action.test_dl_gateway_action.id diff --git a/examples/port-2-oracle-connection/outputs.tf b/examples/port-2-oracle-connection/outputs.tf index 17ae5bb7..a9551011 100644 --- a/examples/port-2-oracle-connection/outputs.tf +++ b/examples/port-2-oracle-connection/outputs.tf @@ -1,3 +1,3 @@ -output "oracle_connection_id" { - value = module.create_port_2_oracle_connection.primary_connection_id +output "oracle_connection" { + value = module.create_port_2_oracle_connection.primary_connection } diff --git a/examples/port-2-port-connection/outputs.tf b/examples/port-2-port-connection/outputs.tf index 6fa8c968..4bc78d6e 100644 --- a/examples/port-2-port-connection/outputs.tf +++ b/examples/port-2-port-connection/outputs.tf @@ -1,3 +1,3 @@ -output "port_connection_id" { - value = module.create_port_2_port_connection.primary_connection_id +output "port_connection" { + value = module.create_port_2_port_connection.primary_connection } diff --git a/examples/port-2-private-service-profile-connection/outputs.tf b/examples/port-2-private-service-profile-connection/outputs.tf index 9365dcff..ac6627de 100644 --- a/examples/port-2-private-service-profile-connection/outputs.tf +++ b/examples/port-2-private-service-profile-connection/outputs.tf @@ -1,3 +1,3 @@ -output "private_sp_connection_id" { - value = module.create_port_2_private_sp_connection.primary_connection_id +output "private_sp_connection" { + value = module.create_port_2_private_sp_connection.primary_connection } diff --git a/examples/port-2-public-service-profile-connection/outputs.tf b/examples/port-2-public-service-profile-connection/outputs.tf index dfa9f5f6..555954c2 100644 --- a/examples/port-2-public-service-profile-connection/outputs.tf +++ b/examples/port-2-public-service-profile-connection/outputs.tf @@ -1,3 +1,3 @@ -output "public_sp_connection_id" { - value = module.create_port_2_public_sp_connection.primary_connection_id +output "public_sp_connection" { + value = module.create_port_2_public_sp_connection.primary_connection } diff --git a/examples/service-token-for-zside-virtual-device/README.md b/examples/service-token-for-zside-virtual-device/README.md new file mode 100644 index 00000000..b04633ab --- /dev/null +++ b/examples/service-token-for-zside-virtual-device/README.md @@ -0,0 +1,11 @@ +# Fabric Service Token for Zside Virtual Device Creation Example + +This example shows how to create Fabric Zside Virtual Device based Service Token. + +It leverages the Equinix Terraform Provider to setup the service token based on the parameters you have provided to this example; or based on the pattern +you see used in this example it will allow you to create a more specific use case for your own needs. + +See example usage below for details on how to use this example. + + + diff --git a/examples/service-token-for-zside-virtual-device/main.tf b/examples/service-token-for-zside-virtual-device/main.tf new file mode 100644 index 00000000..2c041809 --- /dev/null +++ b/examples/service-token-for-zside-virtual-device/main.tf @@ -0,0 +1,65 @@ +provider "equinix" { + client_id = var.equinix_client_id + client_secret = var.equinix_client_secret +} + +#Network Edge Module +resource "equinix_network_acl_template" "wan-acl-template" { + name = var.template_name + description = var.template_description + inbound_rule { + subnet = var.template_subnet + protocol = var.template_protocol + src_port = var.template_src_port + dst_port = var.template_dst_port + } +} + +resource "equinix_network_device" "C8KV-SV" { + name = var.ne_name + metro_code = var.ne_metro_code + type_code = var.ne_type_code + self_managed = true + byol = true + package_code = var.ne_package_code + notifications = var.ne_notifications + hostname = var.ne_hostname + account_number = var.ne_account_number + version = var.ne_version + core_count = var.ne_core_count + term_length = var.ne_term_length + + ssh_key { + username = var.ne_ssh_key_username + key_name = var.ne_ssh_key_name + } + acl_template_id = equinix_network_acl_template.wan-acl-template.id +} + +resource "equinix_fabric_service_token" "service-token" { + type = var.service_token_type + name = var.service_token_name + description = var.service_token_description + expiration_date_time = var.service_token_expiration_date_time + notifications { + type = var.notifications_type + emails = var.notifications_emails + } + + service_token_connection { + type = var.connection_type + supported_bandwidths = var.supported_bandwidths + z_side { + access_point_selectors { + type = var.zside_ap_type + virtual_device { + type = var.zside_vd_type + uuid = var.zside_vd_uuid + } + interface { + type = var.zside_interface_type + } + } + } + } +} diff --git a/examples/service-token-for-zside-virtual-device/outputs.tf b/examples/service-token-for-zside-virtual-device/outputs.tf new file mode 100644 index 00000000..f15faee7 --- /dev/null +++ b/examples/service-token-for-zside-virtual-device/outputs.tf @@ -0,0 +1,3 @@ +output "service-token" { + value = equinix_fabric_service_token.service-token +} diff --git a/examples/service-token-for-zside-virtual-device/terraform.tfvars.example b/examples/service-token-for-zside-virtual-device/terraform.tfvars.example new file mode 100644 index 00000000..44f2fc46 --- /dev/null +++ b/examples/service-token-for-zside-virtual-device/terraform.tfvars.example @@ -0,0 +1,44 @@ +equinix_client_id = "" +equinix_client_secret = "" + +#NE Acl Template +template_name = "test-wan-acl-template" +template_description = "WAN ACL template" +template_subnet = "172.16.25.0/24" +template_protocol = "TCP" +template_src_port = "any" +template_dst_port = "22" + +#Network Edge +ne_name = "Terra_Test_router" +ne_metro_code = "SV" +ne_type_code = "C8000V" +ne_package_code = "network-essentials" +ne_notifications = ["test@eq.com"] +ne_hostname = "C8KV" +ne_account_number = "182390403" +ne_version = "17.11.01a" +ne_core_count = 2 +ne_term_length = 1 + +ne_ssh_key_username = "" +ne_ssh_key_name = " + diff --git a/examples/virtual-device-2-service-token-connection/main.tf b/examples/virtual-device-2-service-token-connection/main.tf new file mode 100644 index 00000000..eaedaa30 --- /dev/null +++ b/examples/virtual-device-2-service-token-connection/main.tf @@ -0,0 +1,22 @@ +provider "equinix" { + client_id = var.equinix_client_id + client_secret = var.equinix_client_secret +} + +module "create_virtual_device_2_service_token_connection" { + source = "../../modules/virtual-device-connection" + + connection_name = var.connection_name + connection_type = var.connection_type + notifications_type = var.notifications_type + notifications_emails = var.notifications_emails + bandwidth = var.bandwidth + purchase_order_number = var.purchase_order_number + + # A-side + aside_vd_type = var.aside_vd_type + aside_vd_uuid = var.aside_vd_uuid + + # Z-side + zside_service_token_uuid = var.zside_service_token_uuid +} diff --git a/examples/virtual-device-2-service-token-connection/outputs.tf b/examples/virtual-device-2-service-token-connection/outputs.tf new file mode 100644 index 00000000..c3fd18ad --- /dev/null +++ b/examples/virtual-device-2-service-token-connection/outputs.tf @@ -0,0 +1,3 @@ +output "fabric_connection" { + value = module.create_virtual_device_2_service_token_connection.primary_connection +} diff --git a/examples/virtual-device-2-service-token-connection/terraform.tfvars.example b/examples/virtual-device-2-service-token-connection/terraform.tfvars.example new file mode 100644 index 00000000..2f66d352 --- /dev/null +++ b/examples/virtual-device-2-service-token-connection/terraform.tfvars.example @@ -0,0 +1,13 @@ +equinix_client_id = "" +equinix_client_secret = "" + +connection_name = "VD2Azure" +connection_type = "EVPL_VC" +notifications_type = "ALL" +notifications_emails = ["example@equinix.com"] +purchase_order_number = "1-323292" +bandwidth = 50 + +aside_vd_type = "EDGE" +aside_vd_uuid = "" +zside_service_token_uuid = "" diff --git a/examples/virtual-device-2-service-token-connection/variables.tf b/examples/virtual-device-2-service-token-connection/variables.tf new file mode 100644 index 00000000..61bf75cc --- /dev/null +++ b/examples/virtual-device-2-service-token-connection/variables.tf @@ -0,0 +1,50 @@ +variable "equinix_client_id" { + description = "Equinix client ID (consumer key), obtained after registering app in the developer platform" + type = string + sensitive = true +} +variable "equinix_client_secret" { + description = "Equinix client secret ID (consumer secret), obtained after registering app in the developer platform" + type = string + sensitive = true +} +variable "connection_name" { + description = "Connection name. An alpha-numeric 24 characters string which can include only hyphens and underscores" + type = string +} +variable "connection_type" { + description = "Defines the connection type like VG_VC, EVPL_VC, EPL_VC, EC_VC, IP_VC, ACCESS_EPL_VC" + type = string +} +variable "notifications_type" { + description = "Notification Type - ALL is the only type currently supported" + type = string + default = "ALL" +} +variable "notifications_emails" { + description = "Array of contact emails" + type = list(string) +} +variable "bandwidth" { + description = "Connection bandwidth in Mbps" + type = number + default = 50 +} +variable "purchase_order_number" { + description = "Purchase order number" + type = string +} +variable "aside_vd_type" { + description = "Virtual Device type - EDGE" + type = string + default = "" +} +variable "aside_vd_uuid" { + description = "Virtual Device UUID" + type = string + default = "" +} +variable "zside_service_token_uuid" { + description = "Service Token UUID" + type = string +} diff --git a/examples/virtual-device-2-service-token-connection/versions.tf b/examples/virtual-device-2-service-token-connection/versions.tf new file mode 100644 index 00000000..8df44b7a --- /dev/null +++ b/examples/virtual-device-2-service-token-connection/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_version = ">= 1.5.4" + required_providers { + equinix = { + source = "equinix/equinix" + version = ">= 2.10.0" + } + } +} diff --git a/modules/cloud-router-connection/outputs.tf b/modules/cloud-router-connection/outputs.tf index 99e899aa..4e6a20f8 100644 --- a/modules/cloud-router-connection/outputs.tf +++ b/modules/cloud-router-connection/outputs.tf @@ -1,6 +1,6 @@ -output "primary_connection_id" { - value = equinix_fabric_connection.primary_cloud_router_connection.id +output "primary_connection" { + value = equinix_fabric_connection.primary_cloud_router_connection } -output "secondary_connection_id" { - value = var.secondary_connection_name != "" ? equinix_fabric_connection.secondary_cloud_router_connection[0].id : null +output "secondary_connection" { + value = var.secondary_connection_name != "" ? equinix_fabric_connection.secondary_cloud_router_connection[0] : null } diff --git a/modules/cloud-router-route-filters/outputs.tf b/modules/cloud-router-route-filters/outputs.tf index e69de29b..f2ed9fb4 100644 --- a/modules/cloud-router-route-filters/outputs.tf +++ b/modules/cloud-router-route-filters/outputs.tf @@ -0,0 +1,11 @@ +output "route_filter" { + value = equinix_fabric_route_filter +} + +output "route_filter_rule" { + value = equinix_fabric_route_filter_rule +} + +output "connection_route_filter" { + value = equinix_fabric_connection_route_filter +} \ No newline at end of file diff --git a/modules/cloud-router-routing-protocols/outputs.tf b/modules/cloud-router-routing-protocols/outputs.tf index cc0205b0..195cac62 100644 --- a/modules/cloud-router-routing-protocols/outputs.tf +++ b/modules/cloud-router-routing-protocols/outputs.tf @@ -1,7 +1,7 @@ -output "direct_routing_protocol_id" { - value = equinix_fabric_routing_protocol.direct.id +output "direct_routing_protocol" { + value = equinix_fabric_routing_protocol.direct } -output "bgp_routing_protocol_id" { - value = var.bgp_rp_name != "" ? equinix_fabric_routing_protocol.bgp[0].id : null +output "bgp_routing_protocol" { + value = var.bgp_rp_name != "" ? equinix_fabric_routing_protocol.bgp[0] : null } diff --git a/modules/metal-connection/outputs.tf b/modules/metal-connection/outputs.tf index 17418135..db34b453 100644 --- a/modules/metal-connection/outputs.tf +++ b/modules/metal-connection/outputs.tf @@ -1,3 +1,3 @@ -output "primary_connection_id" { - value = equinix_fabric_connection.primary_metal_connection.id +output "primary_connection" { + value = equinix_fabric_connection.primary_metal_connection } diff --git a/modules/port-connection/main.tf b/modules/port-connection/main.tf index 7aaef12d..c62bc252 100644 --- a/modules/port-connection/main.tf +++ b/modules/port-connection/main.tf @@ -119,6 +119,15 @@ resource "equinix_fabric_connection" "primary_port_connection" { } } } + + dynamic "z_side" { + for_each = var.zside_service_token_uuid != "" ? [1] : [] + content { + service_token { + uuid = var.zside_service_token_uuid + } + } + } } resource "equinix_fabric_connection" "secondary_port_connection" { @@ -217,4 +226,13 @@ resource "equinix_fabric_connection" "secondary_port_connection" { } } } + + dynamic "z_side" { + for_each = var.zside_service_token_uuid != "" ? [1] : [] + content { + service_token { + uuid = var.zside_service_token_uuid + } + } + } } diff --git a/modules/port-connection/outputs.tf b/modules/port-connection/outputs.tf index 8c3b1f59..d3af11bc 100644 --- a/modules/port-connection/outputs.tf +++ b/modules/port-connection/outputs.tf @@ -1,7 +1,7 @@ -output "primary_connection_id" { - value = equinix_fabric_connection.primary_port_connection.id +output "primary_connection" { + value = equinix_fabric_connection.primary_port_connection } -output "secondary_connection_id" { - value = var.aside_secondary_port_name != "" ? equinix_fabric_connection.secondary_port_connection[0].id : null +output "secondary_connection" { + value = var.aside_secondary_port_name != "" ? equinix_fabric_connection.secondary_port_connection[0] : null } diff --git a/modules/port-connection/variables.tf b/modules/port-connection/variables.tf index ec388922..be739578 100644 --- a/modules/port-connection/variables.tf +++ b/modules/port-connection/variables.tf @@ -64,6 +64,7 @@ variable "aside_vlan_inner_tag" { variable "zside_ap_type" { description = "Access point type - VD, SP, COLO, CLOUD_ROUTER, NETWORK" type = string + default = "" } variable "zside_ap_authentication_key" { description = "Authentication key for provider based connections" @@ -114,6 +115,11 @@ variable "zside_network_uuid" { description = "Equinix Network UUID" default = "" } +variable "zside_service_token_uuid" { + description = "Service Token UUID" + type = string + default = "" +} variable "additional_info" { description = "Additional info parameters. It's a list of maps containing 'key' and 'value' keys with their corresponding values." type = list(object({ key = string, value = string })) diff --git a/modules/service-token-connection/outputs.tf b/modules/service-token-connection/outputs.tf index 46ef5a29..d479179b 100644 --- a/modules/service-token-connection/outputs.tf +++ b/modules/service-token-connection/outputs.tf @@ -1,3 +1,3 @@ -output "primary_connection_id" { - value = equinix_fabric_connection.service_token_connection.id +output "primary_connection" { + value = equinix_fabric_connection.service_token_connection } diff --git a/modules/virtual-device-connection/outputs.tf b/modules/virtual-device-connection/outputs.tf index 5caf1164..93f09232 100644 --- a/modules/virtual-device-connection/outputs.tf +++ b/modules/virtual-device-connection/outputs.tf @@ -1,6 +1,6 @@ -output "primary_connection_id" { - value = equinix_fabric_connection.virtual_device_connection.id +output "primary_connection" { + value = equinix_fabric_connection.virtual_device_connection } -output "secondary_connection_id" { - value = var.secondary_connection_name != "" ? equinix_fabric_connection.secondary_virtual_device_connection[0].id : null +output "secondary_connection" { + value = var.secondary_connection_name != "" ? equinix_fabric_connection.secondary_virtual_device_connection[0] : null }