From 00ff91ce6e18e8da93055df24542b162ca5364e1 Mon Sep 17 00:00:00 2001 From: kpdhulipala <84343462+kpdhulipala@users.noreply.github.com> Date: Thu, 10 Oct 2024 13:44:12 -0700 Subject: [PATCH 1/2] feat: Make ssh public key name optional in create virtual device request --- docs/resources/network_device.md | 2 +- equinix/resource_network_device.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/resources/network_device.md b/docs/resources/network_device.md index 87f99a01e..747b3c572 100644 --- a/docs/resources/network_device.md +++ b/docs/resources/network_device.md @@ -460,7 +460,7 @@ The `secondary_device` block supports the following arguments: The `ssh_key` block supports the following arguments: * `username` - (Required) username associated with given key. -* `name` - (Required) reference by name to previously provisioned public SSH key. +* `name` - (Optional) reference by name to previously provisioned public SSH key. ### Cluster Details diff --git a/equinix/resource_network_device.go b/equinix/resource_network_device.go index ef5aacfdf..26f5a7b1c 100644 --- a/equinix/resource_network_device.go +++ b/equinix/resource_network_device.go @@ -832,7 +832,7 @@ func createNetworkDeviceUserKeySchema() map[string]*schema.Schema { }, neDeviceUserKeySchemaNames["KeyName"]: { Type: schema.TypeString, - Required: true, + Optional: true, ValidateFunc: validation.StringIsNotEmpty, Description: neDeviceUserKeyDescriptions["KeyName"], }, From 4df9f258223c9950d459c8909ea99681f06a2510 Mon Sep 17 00:00:00 2001 From: kpdhulipala <84343462+kpdhulipala@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:58:48 -0800 Subject: [PATCH 2/2] feat: Provide examples for ZSCALER APPC and PSE devices --- docs/resources/network_device.md | 63 ++++++++++++++++++- .../equinix_network_device/zscaler_appc.tf | 27 ++++++++ .../equinix_network_device/zscaler_pse.tf | 27 ++++++++ templates/resources/network_device.md.tmpl | 7 ++- 4 files changed, 122 insertions(+), 2 deletions(-) create mode 100644 examples/resources/equinix_network_device/zscaler_appc.tf create mode 100644 examples/resources/equinix_network_device/zscaler_pse.tf diff --git a/docs/resources/network_device.md b/docs/resources/network_device.md index ebaea2d34..f00f40638 100644 --- a/docs/resources/network_device.md +++ b/docs/resources/network_device.md @@ -492,6 +492,66 @@ resource "equinix_network_device" "aviatrix-transit-edge-single" { } ``` +```terraform +# Create ZSCALER APPC device + +data "equinix_network_account" "sv" { + metro_code = "SV" +} + +resource "equinix_network_device" "zscaler-appc-single" { + name = "tf-zscaler-appc" + project_id = "XXXXXX" + metro_code = data.equinix_network_account.sv.metro_code + type_code = "ZSCALER-APPC" + self_managed = true + byol = true + connectivity = "PRIVATE" + package_code = "STD" + notifications = ["john@equinix.com", "marry@equinix.com", "fred@equinix.com"] + term_length = 12 + account_number = data.equinix_network_account.sv.number + version = "23.395.1" + interface_count = 1 + core_count = 4 + vendor_configuration = {"provisioningKey" = "XXXXXXXXXX", "hostname" = "XXXX"} + ssh_key { + username = "test" + key_name = "test-key" + } +} +``` + +```terraform +# Create ZSCALER APPC device + +data "equinix_network_account" "sv" { + metro_code = "SV" +} + +resource "equinix_network_device" "zscaler-pse-single" { + name = "tf-zscaler-pse" + project_id = "XXXXXX" + metro_code = data.equinix_network_account.sv.metro_code + type_code = "ZSCALER-PSE" + self_managed = true + byol = true + connectivity = "PRIVATE" + package_code = "STD" + notifications = ["john@equinix.com", "marry@equinix.com", "fred@equinix.com"] + term_length = 12 + account_number = data.equinix_network_account.sv.number + version = "23.395.1" + interface_count = 1 + core_count = 4 + vendor_configuration = {"provisioningKey" = "XXXXXXXXXX", "hostname" = "XXXX"} + ssh_key { + username = "test" + key_name = "test-key" + } +} +``` + ## Argument Reference The following arguments are supported: @@ -522,7 +582,7 @@ The following arguments are supported: * `additional_bandwidth` - (Optional) Additional Internet bandwidth, in Mbps, that will be allocated to the device (in addition to default 15Mbps). * `interface_count` - (Optional) Number of network interfaces on a device. If not specified, default number for a given device type will be used. * `wan_interafce_id` - (Optional) Specify the WAN/SSH interface id. If not specified, default WAN/SSH interface for a given device type will be used. -* `vendor_configuration` - (Optional) Map of vendor specific configuration parameters for a device (controller1, activationKey, managementType, siteId, systemIpAddress, privateAddress, privateCidrMask, privateGateway, licenseKey, licenseId, panoramaAuthKey, panoramaIpAddress) +* `vendor_configuration` - (Optional) Map of vendor specific configuration parameters for a device (controller1, activationKey, managementType, siteId, systemIpAddress, privateAddress, privateCidrMask, privateGateway, licenseKey, licenseId, panoramaAuthKey, panoramaIpAddress, provisioningKey) * `ssh-key` - (Optional) Definition of SSH key that will be provisioned on a device (max one key). See [SSH Key](#ssh-key) below for more details. * `secondary_device` - (Optional) Definition of secondary device for redundant device configurations. See [Secondary Device](#secondary-device) below for more details. * `cluster_details` - (Optional) An object that has the cluster details. See [Cluster Details](#cluster-details) below for more details. @@ -588,6 +648,7 @@ The `vendor_configuration` block supports the following arguments: * `root_password` - (Optional) The CLI password of the device. This field is relevant only for the Velocloud SDWAN cluster. * `panorama_ip_address` - (Optional) Panorama Server IP Address. This field is relevant only for the PA-VM firewall devices to have integration with Panorama Server. * `panorama_auth_key` - (Optional) Panorama Server Auth Key. This field is relevant only for the PA-VM firewall devices to have integration with Panorama Server. +* `provisioning_key` - (Optional) Provisioning Key. This field is relevant only for the ZSCALER APPC and ZSCALER PSE devices. ## Attributes Reference diff --git a/examples/resources/equinix_network_device/zscaler_appc.tf b/examples/resources/equinix_network_device/zscaler_appc.tf new file mode 100644 index 000000000..8554582c3 --- /dev/null +++ b/examples/resources/equinix_network_device/zscaler_appc.tf @@ -0,0 +1,27 @@ +# Create ZSCALER APPC device + +data "equinix_network_account" "sv" { + metro_code = "SV" +} + +resource "equinix_network_device" "zscaler-appc-single" { + name = "tf-zscaler-appc" + project_id = "XXXXXX" + metro_code = data.equinix_network_account.sv.metro_code + type_code = "ZSCALER-APPC" + self_managed = true + byol = true + connectivity = "PRIVATE" + package_code = "STD" + notifications = ["john@equinix.com", "marry@equinix.com", "fred@equinix.com"] + term_length = 12 + account_number = data.equinix_network_account.sv.number + version = "23.395.1" + interface_count = 1 + core_count = 4 + vendor_configuration = {"provisioningKey" = "XXXXXXXXXX", "hostname" = "XXXX"} + ssh_key { + username = "test" + key_name = "test-key" + } +} \ No newline at end of file diff --git a/examples/resources/equinix_network_device/zscaler_pse.tf b/examples/resources/equinix_network_device/zscaler_pse.tf new file mode 100644 index 000000000..4a9dfc474 --- /dev/null +++ b/examples/resources/equinix_network_device/zscaler_pse.tf @@ -0,0 +1,27 @@ +# Create ZSCALER APPC device + +data "equinix_network_account" "sv" { + metro_code = "SV" +} + +resource "equinix_network_device" "zscaler-pse-single" { + name = "tf-zscaler-pse" + project_id = "XXXXXX" + metro_code = data.equinix_network_account.sv.metro_code + type_code = "ZSCALER-PSE" + self_managed = true + byol = true + connectivity = "PRIVATE" + package_code = "STD" + notifications = ["john@equinix.com", "marry@equinix.com", "fred@equinix.com"] + term_length = 12 + account_number = data.equinix_network_account.sv.number + version = "23.395.1" + interface_count = 1 + core_count = 4 + vendor_configuration = {"provisioningKey" = "XXXXXXXXXX", "hostname" = "XXXX"} + ssh_key { + username = "test" + key_name = "test-key" + } +} \ No newline at end of file diff --git a/templates/resources/network_device.md.tmpl b/templates/resources/network_device.md.tmpl index cd8bc862e..307118b20 100644 --- a/templates/resources/network_device.md.tmpl +++ b/templates/resources/network_device.md.tmpl @@ -46,6 +46,10 @@ In addition to management modes, there are two software license modes available: {{tffile "examples/resources/equinix_network_device/Aviatrix_Transit_Edge.tf"}} +{{tffile "examples/resources/equinix_network_device/zscaler_appc.tf"}} + +{{tffile "examples/resources/equinix_network_device/zscaler_pse.tf"}} + ## Argument Reference The following arguments are supported: @@ -76,7 +80,7 @@ The following arguments are supported: * `additional_bandwidth` - (Optional) Additional Internet bandwidth, in Mbps, that will be allocated to the device (in addition to default 15Mbps). * `interface_count` - (Optional) Number of network interfaces on a device. If not specified, default number for a given device type will be used. * `wan_interafce_id` - (Optional) Specify the WAN/SSH interface id. If not specified, default WAN/SSH interface for a given device type will be used. -* `vendor_configuration` - (Optional) Map of vendor specific configuration parameters for a device (controller1, activationKey, managementType, siteId, systemIpAddress, privateAddress, privateCidrMask, privateGateway, licenseKey, licenseId, panoramaAuthKey, panoramaIpAddress) +* `vendor_configuration` - (Optional) Map of vendor specific configuration parameters for a device (controller1, activationKey, managementType, siteId, systemIpAddress, privateAddress, privateCidrMask, privateGateway, licenseKey, licenseId, panoramaAuthKey, panoramaIpAddress, provisioningKey) * `ssh-key` - (Optional) Definition of SSH key that will be provisioned on a device (max one key). See [SSH Key](#ssh-key) below for more details. * `secondary_device` - (Optional) Definition of secondary device for redundant device configurations. See [Secondary Device](#secondary-device) below for more details. * `cluster_details` - (Optional) An object that has the cluster details. See [Cluster Details](#cluster-details) below for more details. @@ -142,6 +146,7 @@ The `vendor_configuration` block supports the following arguments: * `root_password` - (Optional) The CLI password of the device. This field is relevant only for the Velocloud SDWAN cluster. * `panorama_ip_address` - (Optional) Panorama Server IP Address. This field is relevant only for the PA-VM firewall devices to have integration with Panorama Server. * `panorama_auth_key` - (Optional) Panorama Server Auth Key. This field is relevant only for the PA-VM firewall devices to have integration with Panorama Server. +* `provisioning_key` - (Optional) Provisioning Key. This field is relevant only for the ZSCALER APPC and ZSCALER PSE devices. ## Attributes Reference