Skip to content

Commit

Permalink
feat: Nfv 29975 - make ssh public key name optional in Create Virtual…
Browse files Browse the repository at this point in the history
… device request (#796)

feat: Nfv 29975 - make ssh public key name optional in Create Virtual
device request
  • Loading branch information
kpdhulipala authored Oct 11, 2024
1 parent c4df27a commit 37cd736
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/resources/network_device.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 3 additions & 6 deletions equinix/resource_network_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func resourceNetworkDevice() *schema.Resource {
UpdateContext: resourceNetworkDeviceUpdate,
DeleteContext: resourceNetworkDeviceDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
StateContext: schema.ImportStatePassthroughContext,
},
Schema: createNetworkDeviceSchema(),
Timeouts: &schema.ResourceTimeout{
Expand All @@ -248,10 +248,7 @@ func createNetworkDeviceSchema() map[string]*schema.Schema {
Type: schema.TypeString,
Required: true,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
if old == new+"-Node0" {
return true
}
return false
return old == new+"-Node0"
},
ValidateFunc: validation.StringLenBetween(3, 50),
Description: neDeviceDescriptions["Name"],
Expand Down Expand Up @@ -832,7 +829,7 @@ func createNetworkDeviceUserKeySchema() map[string]*schema.Schema {
},
neDeviceUserKeySchemaNames["KeyName"]: {
Type: schema.TypeString,
Required: true,
Optional: true,
ValidateFunc: validation.StringIsNotEmpty,
Description: neDeviceUserKeyDescriptions["KeyName"],
},
Expand Down
2 changes: 1 addition & 1 deletion templates/resources/network_device.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,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

Expand Down

0 comments on commit 37cd736

Please sign in to comment.