Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@
ForceNew: true,
},

"root_access_enabled": {
Type: schema.TypeBool,

Check failure on line 157 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

undefined: schema

Check failure on line 157 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / detect

undefined: schema

Check failure on line 157 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / tflint

undefined: schema

Check failure on line 157 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / tflint

undefined: schema

Check failure on line 157 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

undefined: schema
Optional: true,
Default: false,
},

"tags": commonschema.TagsForceNew(),
},
}
Expand Down Expand Up @@ -247,6 +253,10 @@
props.Properties.ComputeInstanceAuthorizationType = pointer.To(machinelearningcomputes.ComputeInstanceAuthorizationType(v.(string)))
}

if v, ok := d.GetOk("root_access_enabled"); ok {
props.Properties.EnableRootAccess = pointer.To(v.(bool))

Check failure on line 257 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

props.Properties.EnableRootAccess undefined (type *machinelearningcomputes.ComputeInstanceProperties has no field or method EnableRootAccess)

Check failure on line 257 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / detect

props.Properties.EnableRootAccess undefined (type *machinelearningcomputes.ComputeInstanceProperties has no field or method EnableRootAccess)

Check failure on line 257 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / tflint

props.Properties.EnableRootAccess undefined (type *machinelearningcomputes.ComputeInstanceProperties has no field or method EnableRootAccess)

Check failure on line 257 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / tflint

props.Properties.EnableRootAccess undefined (type *machinelearningcomputes.ComputeInstanceProperties has no field or method EnableRootAccess)

Check failure on line 257 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

props.Properties.EnableRootAccess undefined (type *machinelearningcomputes.ComputeInstanceProperties has no field or method EnableRootAccess)
}

parameters.Properties = props

future, err := client.ComputeCreateOrUpdate(ctx, id, parameters)
Expand Down Expand Up @@ -328,6 +338,10 @@
d.Set("node_public_ip_enabled", enableNodePublicIP)
}

if v, ok := resp.Properties["enableRootAccess"].(bool); ok {

Check failure on line 341 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / document-lint

resp.Properties undefined (type machinelearningcomputes.ComputeGetOperationResponse has no field or method Properties)

Check failure on line 341 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / detect

resp.Properties undefined (type machinelearningcomputes.ComputeGetOperationResponse has no field or method Properties)

Check failure on line 341 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / tflint

resp.Properties undefined (type machinelearningcomputes.ComputeGetOperationResponse has no field or method Properties)

Check failure on line 341 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / tflint

resp.Properties undefined (type machinelearningcomputes.ComputeGetOperationResponse has no field or method Properties)

Check failure on line 341 in internal/services/machinelearning/machine_learning_compute_instance_resource.go

View workflow job for this annotation

GitHub Actions / compatibility-32bit-test

resp.Properties undefined (type machinelearningcomputes.ComputeGetOperationResponse has no field or method Properties)
d.Set("root_access_enabled", v)
}

return tags.FlattenAndSet(d, resp.Model.Tags)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,32 @@
})
}

func TestAccAzureRMMachineLearningComputeInstance_rootAccessEnabled(t *testing.T) {
resource.Test(t, resource.TestCase{

Check failure on line 110 in internal/services/machinelearning/machine_learning_compute_instance_resource_test.go

View workflow job for this annotation

GitHub Actions / tflint

undefined: resource

Check failure on line 110 in internal/services/machinelearning/machine_learning_compute_instance_resource_test.go

View workflow job for this annotation

GitHub Actions / tflint

undefined: resource
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,

Check failure on line 112 in internal/services/machinelearning/machine_learning_compute_instance_resource_test.go

View workflow job for this annotation

GitHub Actions / tflint

undefined: testAccProviders
CheckDestroy: testCheckAzureRMMachineLearningComputeInstanceDestroy,

Check failure on line 113 in internal/services/machinelearning/machine_learning_compute_instance_resource_test.go

View workflow job for this annotation

GitHub Actions / tflint

undefined: testCheckAzureRMMachineLearningComputeInstanceDestroy
Steps: []resource.TestStep{
{
Config: testAccAzureRMMachineLearningComputeInstance_rootAccessEnabled,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMMachineLearningComputeInstanceExists("azurerm_machine_learning_compute_instance.test"),
resource.TestCheckResourceAttr("azurerm_machine_learning_compute_instance.test", "root_access_enabled", "true"),
),
},
},
})
}

const testAccAzureRMMachineLearningComputeInstance_rootAccessEnabled = `
resource "azurerm_machine_learning_compute_instance" "test" {
name = "acctestmlci-%d"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
root_access_enabled = true
}
`

func (r ComputeInstanceResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) {
computeClient := client.MachineLearning.MachineLearningComputes
id, err := machinelearningcomputes.ParseComputeID(state.ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ The following arguments are supported:

* `tags` - (Optional) A mapping of tags which should be assigned to the Machine Learning Compute Instance. Changing this forces a new Machine Learning Compute Instance to be created.

* `root_access_enabled` - (Optional) Specifies whether root access is enabled for the compute instance. Defaults to `false`.

---

An `identity` block supports the following:
Expand Down
Loading