Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property for hbi_enabled with machine learning workspace #7703

Merged
merged 4 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion azurerm/internal/services/machinelearning/client/client.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package client

import (
"github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices"
"github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2018-09-01/containerregistry"
"github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2019-11-01/machinelearningservices"
"github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices"
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-04-01/storage"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
Expand Down Expand Up @@ -139,6 +139,11 @@ func resourceArmMachineLearningWorkspace() *schema.Resource {
},

"tags": tags.Schema(),

"hbi_workspace": {
Type: schema.TypeBool,
Optional: true,
},
},
}
}
Expand Down Expand Up @@ -197,6 +202,10 @@ func resourceArmMachineLearningWorkspaceCreate(d *schema.ResourceData, meta inte
workspace.ContainerRegistry = utils.String(v.(string))
}

if v, ok := d.GetOk("hbi_workspace"); ok {
workspace.HbiWorkspace = utils.Bool(v.(bool))
}

accountsClient := meta.(*clients.Client).Storage.AccountsClient
if err := validateStorageAccount(ctx, accountsClient, storageAccountId); err != nil {
return fmt.Errorf("Error creating Machine Learning Workspace %q (Resource Group %q): %+v", name, resGroup, err)
Expand Down Expand Up @@ -267,6 +276,7 @@ func resourceArmMachineLearningWorkspaceRead(d *schema.ResourceData, meta interf
d.Set("container_registry_id", props.ContainerRegistry)
d.Set("description", props.Description)
d.Set("friendly_name", props.FriendlyName)
d.Set("hbi_workspace", props.HbiWorkspace)
}

if err := d.Set("identity", flattenArmMachineLearningWorkspaceIdentity(resp.Identity)); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func TestAccAzureRMMachineLearningWorkspace_complete(t *testing.T) {
resource.TestCheckResourceAttr(data.ResourceName, "description", "Test machine learning workspace"),
resource.TestCheckResourceAttr(data.ResourceName, "sku_name", "Enterprise"),
resource.TestCheckResourceAttr(data.ResourceName, "tags.%", "1"),
resource.TestCheckResourceAttr(data.ResourceName, "hbi_workspace", "true"),
),
},
data.ImportStep(),
Expand All @@ -121,6 +122,7 @@ func TestAccAzureRMMachineLearningWorkspace_completeUpdate(t *testing.T) {
resource.TestCheckResourceAttr(data.ResourceName, "description", "Test machine learning workspace"),
resource.TestCheckResourceAttr(data.ResourceName, "sku_name", "Enterprise"),
resource.TestCheckResourceAttr(data.ResourceName, "tags.%", "1"),
resource.TestCheckResourceAttr(data.ResourceName, "hbi_workspace", "true"),
),
},
data.ImportStep(),
Expand Down Expand Up @@ -261,6 +263,7 @@ resource "azurerm_machine_learning_workspace" "test" {
storage_account_id = azurerm_storage_account.test.id
container_registry_id = azurerm_container_registry.test.id
sku_name = "Enterprise"
hbi_workspace = true

identity {
type = "SystemAssigned"
Expand Down Expand Up @@ -298,6 +301,7 @@ resource "azurerm_machine_learning_workspace" "test" {
storage_account_id = azurerm_storage_account.test.id
container_registry_id = azurerm_container_registry.test.id
sku_name = "Enterprise"
hbi_workspace = true

identity {
type = "SystemAssigned"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading