Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CXF 100801 Adding Z-side VD service token creation and VD 2 Service Token Connection example #148

Merged
merged 5 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/cloud-router-2-aws-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/cloud-router-2-azure-connection/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
8 changes: 4 additions & 4 deletions examples/cloud-router-2-azure-redundant-connection/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions examples/cloud-router-2-google-connection/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
8 changes: 4 additions & 4 deletions examples/cloud-router-2-metal-nimf-connection/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/cloud-router-2-oracle-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
output "oracle_connection_id" {
output "oracle_connection" {
value = module.cloud_router_oracle_connection.primary_connection_id
}
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 2 additions & 2 deletions examples/cloud-router-2-port-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 2 additions & 2 deletions examples/cloud-router-2-service-profile-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
}

4 changes: 2 additions & 2 deletions examples/cloud-router-2-wan-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 2 additions & 2 deletions examples/cloud-router-marketplace-susbscription/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
6 changes: 3 additions & 3 deletions examples/cloud-router-routing-protocols/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 2 additions & 2 deletions examples/metal-nimf-2-aws-connection/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/metal-nimf-2-azure-connection/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/metal-nimf-2-google-connection/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/metal-nimf-2-ibm2-connection/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/metal-nimf-2-oracle-connection/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/metal-nimf-2-port-connection/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/metal-nimf-2-service-profile-connection/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/port-2-alibaba-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 2 additions & 2 deletions examples/port-2-aws-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/port-2-azure-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
6 changes: 3 additions & 3 deletions examples/port-2-azure-redundant-connections/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 2 additions & 2 deletions examples/port-2-google-connection/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions examples/port-2-ibm1-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 2 additions & 2 deletions examples/port-2-ibm2-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/port-2-oracle-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 2 additions & 2 deletions examples/port-2-port-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 2 additions & 2 deletions examples/port-2-private-service-profile-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 2 additions & 2 deletions examples/port-2-public-service-profile-connection/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
11 changes: 11 additions & 0 deletions examples/service-token-for-zside-virtual-device/README.md
Original file line number Diff line number Diff line change
@@ -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.

<!-- BEGIN_TF_DOCS -->
<!-- END_TF_DOCS -->
65 changes: 65 additions & 0 deletions examples/service-token-for-zside-virtual-device/main.tf
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
}
3 changes: 3 additions & 0 deletions examples/service-token-for-zside-virtual-device/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "service-token" {
value = equinix_fabric_service_token.service-token
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
equinix_client_id = "<MyEquinixClientId>"
equinix_client_secret = "<MyEquinixSecret>"

#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 = ["[email protected]"]
ne_hostname = "C8KV"
ne_account_number = "182390403"
ne_version = "17.11.01a"
ne_core_count = 2
ne_term_length = 1

ne_ssh_key_username = "<SSH_Key_Username>"
ne_ssh_key_name = "<SSH_Key_Name"

#network_ssh_key
network_public_key_name = "<Public_SSH_Key_Name>"
network_public_key = "<Public_SSH_Key>"

#Service Token
service_token_type = "VC_TOKEN"
service_token_name = "Terra_Test_Token"
service_token_description = "Zside VD Token Test"
service_token_expiration_date_time = "2024-12-29T06:43:49.980Z"
notifications_type = "ALL"
notifications_emails = ["[email protected]"]
connection_type = "EVPL_VC"
supported_bandwidths = [50,100, 500, 1000]
zside_ap_type = "VD"
zside_vd_type = "EDGE"
zside_vd_uuid = "<Virtual_Device_UUID>"
zside_interface_type = "NETWORK"
zside_interface_id = "3"
Loading
Loading