diff --git a/.github/workflows/terratests-fcr-prod-suite.yaml b/.github/workflows/terratests-fcr-prod-suite.yaml index 3b5035b8..5a8d3ee2 100644 --- a/.github/workflows/terratests-fcr-prod-suite.yaml +++ b/.github/workflows/terratests-fcr-prod-suite.yaml @@ -16,6 +16,7 @@ jobs: TEST_DATA_PROD_CLOUD_ROUTER_2_PORT_ROUTING_PROTOCOL_CONNECTION: ${{secrets.TEST_DATA_PROD_CLOUD_ROUTER_2_PORT_ROUTING_PROTOCOL_CONNECTION}} TEST_DATA_PROD_CLOUD_ROUTER_2_SERVICE_PROFILE_CONNECTION: ${{secrets.TEST_DATA_PROD_CLOUD_ROUTER_2_SERVICE_PROFILE_CONNECTION}} TEST_DATA_PROD_CLOUD_ROUTER_2_WAN_CONNECTION: ${{secrets.TEST_DATA_PROD_CLOUD_ROUTER_2_WAN_CONNECTION}} + TEST_DATA_PROD_CLOUD_ROUTER_2_VIRTUAL_DEVICE_CONNECTION: ${{secrets.TEST_DATA_PROD_CLOUD_ROUTER_2_VIRTUAL_DEVICE_CONNECTION}} steps: - name: Check out code into the Go module directory @@ -56,7 +57,8 @@ jobs: jq --arg timestamp "$TIMESTAMP" '.connection_name = ($timestamp + "_" + .connection_name)' ./examples/cloud-router-2-service-profile-connection/terraform.tfvars.json > ./examples/cloud-router-2-service-profile-connection/tmp.test.json && mv ./examples/cloud-router-2-service-profile-connection/tmp.test.json ./examples/cloud-router-2-service-profile-connection/terraform.tfvars.json echo $TEST_DATA_PROD_CLOUD_ROUTER_2_WAN_CONNECTION >> "./examples/cloud-router-2-wan-connection/terraform.tfvars.json" jq --arg timestamp "$TIMESTAMP" '.connection_name = ($timestamp + "_" + .connection_name)' ./examples/cloud-router-2-wan-connection/terraform.tfvars.json > ./examples/cloud-router-2-wan-connection/tmp.test.json && mv ./examples/cloud-router-2-wan-connection/tmp.test.json ./examples/cloud-router-2-wan-connection/terraform.tfvars.json - + echo $TEST_DATA_PROD_CLOUD_ROUTER_2_VIRTUAL_DEVICE_CONNECTION >> "./examples/cloud-router-2-virtual-device-connection/terraform.tfvars.json" + jq --arg timestamp "$TIMESTAMP" '.connection_name = ($timestamp + "_" + .connection_name)' ./examples/cloud-router-2-virtual-device-connection/terraform.tfvars.json > ./examples/cloud-router-2-virtual-device-connection/tmp.test.json && mv ./examples/cloud-router-2-virtual-device-connection/tmp.test.json ./examples/cloud-router-2-virtual-device-connection/terraform.tfvars.json - name: Run Go Tests run: go test ./tests/prod/cloud-router -v -coverprofile coverage_prod_modules.txt -covermode=atomic -count 1 -parallel 8 -run "(DIGP)" -timeout 180m diff --git a/.github/workflows/terratests-prod-suite-all.yaml b/.github/workflows/terratests-prod-suite-all.yaml index edd839ea..1fb8eac4 100644 --- a/.github/workflows/terratests-prod-suite-all.yaml +++ b/.github/workflows/terratests-prod-suite-all.yaml @@ -26,6 +26,7 @@ jobs: TEST_DATA_PROD_CLOUD_ROUTER_2_PORT_ROUTING_PROTOCOL_CONNECTION: ${{secrets.TEST_DATA_PROD_CLOUD_ROUTER_2_PORT_ROUTING_PROTOCOL_CONNECTION}} TEST_DATA_PROD_CLOUD_ROUTER_2_SERVICE_PROFILE_CONNECTION: ${{secrets.TEST_DATA_PROD_CLOUD_ROUTER_2_SERVICE_PROFILE_CONNECTION}} TEST_DATA_PROD_CLOUD_ROUTER_2_WAN_CONNECTION: ${{secrets.TEST_DATA_PROD_CLOUD_ROUTER_2_WAN_CONNECTION}} + TEST_DATA_PROD_CLOUD_ROUTER_2_VIRTUAL_DEVICE_CONNECTION: ${{secrets.TEST_DATA_PROD_CLOUD_ROUTER_2_VIRTUAL_DEVICE_CONNECTION}} TEST_DATA_PROD_VIRTUAL_DEVICE_2_WAN_CONNECTION: ${{ secrets.TEST_DATA_PROD_VIRTUAL_DEVICE_2_WAN_CONNECTION }} TEST_DATA_PROD_VIRTUAL_DEVICE_2_AZURE_CONNECTION: ${{secrets.TEST_DATA_PROD_VIRTUAL_DEVICE_2_AZURE_CONNECTION}} TEST_DATA_PROD_VIRTUAL_DEVICE_2_PORT_CONNECTION: ${{secrets.TEST_DATA_PROD_VIRTUAL_DEVICE_2_PORT_CONNECTION}} @@ -94,6 +95,8 @@ jobs: jq --arg timestamp "$TIMESTAMP" '.connection_name = ($timestamp + "_" + .connection_name)' ./tests/examples-without-external-providers/virtual-device-2-azure-connection/terraform.tfvars.json > ./tests/examples-without-external-providers/virtual-device-2-azure-connection/tmp.test.json && mv ./tests/examples-without-external-providers/virtual-device-2-azure-connection/tmp.test.json ./tests/examples-without-external-providers/virtual-device-2-azure-connection/terraform.tfvars.json echo $TEST_DATA_PROD_VIRTUAL_DEVICE_2_PORT_CONNECTION >> "./tests/examples-without-external-providers/virtual-device-2-port-connection/terraform.tfvars.json" jq --arg timestamp "$TIMESTAMP" '.connection_name = ($timestamp + "_" + .connection_name)' ./tests/examples-without-external-providers/virtual-device-2-port-connection/terraform.tfvars.json > ./tests/examples-without-external-providers/virtual-device-2-port-connection/tmp.test.json && mv ./tests/examples-without-external-providers/virtual-device-2-port-connection/tmp.test.json ./tests/examples-without-external-providers/virtual-device-2-port-connection/terraform.tfvars.json + echo $TEST_DATA_PROD_CLOUD_ROUTER_2_VIRTUAL_DEVICE_CONNECTION >> "./examples/cloud-router-2-virtual-device-connection/terraform.tfvars.json" + jq --arg timestamp "$TIMESTAMP" '.connection_name = ($timestamp + "_" + .connection_name)' ./examples/cloud-router-2-virtual-device-connection/terraform.tfvars.json > ./examples/cloud-router-2-virtual-device-connection/tmp.test.json && mv ./examples/cloud-router-2-virtual-device-connection/tmp.test.json ./examples/cloud-router-2-virtual-device-connection/terraform.tfvars.json - name: Run Go Tests run: diff --git a/.github/workflows/terratests-uat-suite.yaml b/.github/workflows/terratests-uat-suite.yaml index 9e481b4b..b33a4002 100644 --- a/.github/workflows/terratests-uat-suite.yaml +++ b/.github/workflows/terratests-uat-suite.yaml @@ -72,6 +72,7 @@ jobs: TEST_DATA_UAT_CLOUD_ROUTER_2_PORT_ROUTING_PROTOCOL_CONNECTION: ${{secrets.TEST_DATA_UAT_CLOUD_ROUTER_2_PORT_ROUTING_PROTOCOL_CONNECTION}} TEST_DATA_UAT_CLOUD_ROUTER_2_SERVICE_PROFILE_CONNECTION: ${{secrets.TEST_DATA_UAT_CLOUD_ROUTER_2_SERVICE_PROFILE_CONNECTION}} TEST_DATA_UAT_CLOUD_ROUTER_2_WAN_CONNECTION: ${{secrets.TEST_DATA_UAT_CLOUD_ROUTER_2_WAN_CONNECTION}} + TEST_DATA_UAT_CLOUD_ROUTER_2_VIRTUAL_DEVICE_CONNECTION: ${{secrets.TEST_DATA_UAT_CLOUD_ROUTER_2_VIRTUAL_DEVICE_CONNECTION}} steps: - name: Check out code into the Go module directory @@ -108,6 +109,7 @@ jobs: echo $TEST_DATA_UAT_CLOUD_ROUTER_2_PORT_ROUTING_PROTOCOL_CONNECTION >> "./tests/examples-without-external-providers/cloud-router-2-port-routing-protocol-connection/terraform.tfvars.json" echo $TEST_DATA_UAT_CLOUD_ROUTER_2_SERVICE_PROFILE_CONNECTION >> "./examples/cloud-router-2-service-profile-connection/terraform.tfvars.json" echo $TEST_DATA_UAT_CLOUD_ROUTER_2_WAN_CONNECTION >> "./examples/cloud-router-2-wan-connection/terraform.tfvars.json" + echo $TEST_DATA_UAT_CLOUD_ROUTER_2_VIRTUAL_DEVICE_CONNECTION >> "./examples/cloud-router-2-virtual-device-connection/terraform.tfvars.json" - name: Run Go Tests run: diff --git a/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/main.tf b/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/main.tf new file mode 100644 index 00000000..bba5380c --- /dev/null +++ b/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/main.tf @@ -0,0 +1,25 @@ +provider "equinix" { + client_id = var.equinix_client_id + client_secret = var.equinix_client_secret +} + +module "cloud_router_virtual_device_connection" { + source = "../../../modules/cloud-router-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 + + #Aside + aside_fcr_uuid = var.aside_fcr_uuid + + #Zside + zside_ap_type = var.zside_ap_type + zside_vd_type = var.zside_vd_type + zside_vd_uuid = var.zside_vd_uuid + zside_interface_type = var.zside_interface_type + zside_interface_id = var.zside_interface_id +} diff --git a/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/outputs.tf b/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/outputs.tf new file mode 100644 index 00000000..179a8e8b --- /dev/null +++ b/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/outputs.tf @@ -0,0 +1,3 @@ +output "FCR_VD_Connection" { + value = module.cloud_router_virtual_device_connection.primary_connection_id +} diff --git a/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/terraform.tfvars.example b/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/terraform.tfvars.example new file mode 100644 index 00000000..7341c47e --- /dev/null +++ b/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/terraform.tfvars.example @@ -0,0 +1,17 @@ +equinix_client_id = "" +equinix_client_secret = "" + +notifications_type = "ALL" +notifications_emails = ["example@equinix.com", "test1@equinix.com"] +purchase_order_number = "1-323292" +connection_name = "fcr_2_vd" +connection_type = "IP_VC" +bandwidth = 50 + +aside_fcr_uuid = "" + +zside_ap_type = "VD" +zside_vd_type = "EDGE" +zside_vd_uuid = "" +zside_interface_type = "NETWORK" +zside_interface_id = 5 diff --git a/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/variables.tf b/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/variables.tf new file mode 100644 index 00000000..83ec928f --- /dev/null +++ b/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/variables.tf @@ -0,0 +1,63 @@ +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 +} +variable "purchase_order_number" { + description = "Purchase order number" + type = string + default = "" +} +variable "aside_fcr_uuid" { + description = "Equinix-assigned Fabric Cloud Router identifier" + type = string +} +variable "zside_ap_type" { + description = "Access point type - COLO, VD, VG, SP, IGW, SUBNET, GW" + type = string + default = "VD" +} +variable "zside_vd_type" { + description = "Virtual Device type - EDGE" + type = string +} +variable "zside_vd_uuid" { + description = "Virtual Device UUID" + type = string +} +variable "zside_interface_type" { + description = "Virtual Device Interface type - CLOUD, NETWORK" + type = string + default = "" +} +variable "zside_interface_id" { + description = "Interface Id" + type = number + default = null +} diff --git a/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/versions.tf b/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/versions.tf new file mode 100644 index 00000000..d2005c3a --- /dev/null +++ b/tests/examples-without-external-providers/cloud-router-2-virtual-device-connection/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_version = ">= 1.5.4" + required_providers { + equinix = { + source = "equinix/equinix" + version = ">= 1.31.0" + } + } +} diff --git a/tests/prod/prod_sanity_suite_test.go b/tests/prod/prod_sanity_suite_test.go index 046701fc..4dd0937b 100644 --- a/tests/prod/prod_sanity_suite_test.go +++ b/tests/prod/prod_sanity_suite_test.go @@ -326,3 +326,17 @@ func TestVirtualDevice2PortCreateConnection_DIGP(t *testing.T) { }) terraform.Apply(t, terraformOptions) } + +func TestCloudRouter2VirtualDeviceCreateConnection_DIGP(t *testing.T) { + + terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ + TerraformDir: "../../tests/examples-without-external-providers/cloud-router-2-virtual-device-connection", + }) + + defer terraform.Destroy(t, terraformOptions) + t.Parallel() + + terraform.InitAndApply(t, terraformOptions) + output := terraform.Output(t, terraformOptions, "FCR_VD_Connection") + assert.NotNil(t, output) +} diff --git a/tests/uat/uat_sanity_suite_test.go b/tests/uat/uat_sanity_suite_test.go index bda51003..48f46f3d 100644 --- a/tests/uat/uat_sanity_suite_test.go +++ b/tests/uat/uat_sanity_suite_test.go @@ -201,3 +201,17 @@ func TestVirtualDevice2PortCreateConnection_PNFV(t *testing.T) { output := terraform.Output(t, terraformOptions, "port_connection_id") assert.NotNil(t, output) } + +func TestCloudRouter2VirtualDeviceCreateConnection_PFCR(t *testing.T) { + + terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ + TerraformDir: "../../tests/examples-without-external-providers/cloud-router-2-virtual-device-connection", + }) + + defer terraform.Destroy(t, terraformOptions) + t.Parallel() + + terraform.InitAndApply(t, terraformOptions) + output := terraform.Output(t, terraformOptions, "FCR_VD_Connection") + assert.NotNil(t, output) +}