Skip to content

Commit

Permalink
azurerm_machine_learning_compute_instance `azurerm_machine_learning…
Browse files Browse the repository at this point in the history
…_compute_cluster` - `node_public_ip_enabled`
  • Loading branch information
ms-henglu committed May 9, 2023
1 parent 40f6f0f commit 957045f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ func resourceComputeCluster() *pluginsdk.Resource {
ForceNew: true,
},

"node_public_ip_enabled": {
Type: pluginsdk.TypeBool,
Optional: true,
Default: true,
ForceNew: true,
},

"ssh_public_access_enabled": {
Type: pluginsdk.TypeBool,
Optional: true,
Expand Down Expand Up @@ -181,6 +188,7 @@ func resourceComputeClusterCreate(d *pluginsdk.ResourceData, meta interface{}) e
VMPriority: &vmPriority,
ScaleSettings: expandScaleSettings(d.Get("scale_settings").([]interface{})),
UserAccountCredentials: expandUserAccountCredentials(d.Get("ssh").([]interface{})),
EnableNodePublicIP: utils.Bool(d.Get("node_public_ip_enabled").(bool)),
}

computeClusterAmlComputeProperties.RemoteLoginPortPublicAccess = utils.ToPtr(machinelearningcomputes.RemoteLoginPortPublicAccessDisabled)
Expand Down Expand Up @@ -270,6 +278,7 @@ func resourceComputeClusterRead(d *pluginsdk.ResourceData, meta interface{}) err
d.Set("vm_priority", string(pointer.From(props.VMPriority)))
d.Set("scale_settings", flattenScaleSettings(props.ScaleSettings))
d.Set("ssh", flattenUserAccountCredentials(props.UserAccountCredentials))
d.Set("node_public_ip_enabled", props.EnableNodePublicIP)
if props.Subnet != nil {
d.Set("subnet_resource_id", props.Subnet.Id)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ resource "azurerm_machine_learning_compute_cluster" "test" {
type = "SystemAssigned"
}
node_public_ip_enabled = true
ssh_public_access_enabled = false
ssh {
admin_username = "adminuser"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ func resourceComputeInstance() *pluginsdk.Resource {
ForceNew: true,
},

"node_public_ip_enabled": {
Type: pluginsdk.TypeBool,
Optional: true,
Default: true,
ForceNew: true,
},

"ssh": {
Type: pluginsdk.TypeList,
Optional: true,
Expand Down Expand Up @@ -188,6 +195,7 @@ func resourceComputeInstanceCreate(d *pluginsdk.ResourceData, meta interface{})

computeInstance := &machinelearningcomputes.ComputeInstance{
Properties: &machinelearningcomputes.ComputeInstanceProperties{
EnableNodePublicIP: utils.Bool(d.Get("node_public_ip_enabled").(bool)),
VMSize: utils.String(d.Get("virtual_machine_size").(string)),
Subnet: subnet,
SshSettings: expandComputeSSHSetting(d.Get("ssh").([]interface{})),
Expand Down Expand Up @@ -266,6 +274,7 @@ func resourceComputeInstanceRead(d *pluginsdk.ResourceData, meta interface{}) er
}
d.Set("description", props.Description)
if props.Properties != nil {
d.Set("node_public_ip_enabled", props.Properties.EnableNodePublicIP)
d.Set("virtual_machine_size", props.Properties.VMSize)
if props.Properties.Subnet != nil {
d.Set("subnet_resource_id", props.Properties.Subnet.Id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ resource "azurerm_machine_learning_compute_instance" "test" {
ssh {
public_key = var.ssh_key
}
subnet_resource_id = azurerm_subnet.test.id
description = "this is desc"
subnet_resource_id = azurerm_subnet.test.id
description = "this is desc"
node_public_ip_enabled = true
tags = {
Label1 = "Value1"
}
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/machine_learning_compute_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ The following arguments are supported:

* `local_auth_enabled` - (Optional) Whether local authentication methods is enabled. Defaults to `true`. Changing this forces a new Machine Learning Compute Cluster to be created.

* `node_public_ip_enabled` - (Optional) Whether to enable public IP address on nodes. Defaults to `true`. Changing this forces a new Machine Learning Compute Cluster to be created.

* `ssh_public_access_enabled` - (Optional) A boolean value indicating whether enable the public SSH port. Changing this forces a new Machine Learning Compute Cluster to be created.

* `subnet_resource_id` - (Optional) The ID of the Subnet that the Compute Cluster should reside in. Changing this forces a new Machine Learning Compute Cluster to be created.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ The following arguments are supported:

* `local_auth_enabled` - (Optional) Whether local authentication methods is enabled. Defaults to `true`. Changing this forces a new Machine Learning Compute Instance to be created.

* `node_public_ip_enabled` - (Optional) Whether public IP is enabled. Defaults to `true`. Changing this forces a new Machine Learning Compute Instance to be created.

* `ssh` - (Optional) A `ssh` block as defined below. Specifies policy and settings for SSH access. Changing this forces a new Machine Learning Compute Instance to be created.

* `subnet_resource_id` - (Optional) Virtual network subnet resource ID the compute nodes belong to. Changing this forces a new Machine Learning Compute Instance to be created.
Expand Down

0 comments on commit 957045f

Please sign in to comment.