forked from hashicorp/terraform-provider-azurerm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
azurerm_machine_learning_compute_cluster
- subnet_resource_id
doe…
…s not have to be specified when `node_public_ip_enabled` is `false` (hashicorp#28673) * azurerm_machine_learning_compute_cluster - subnet_resource_id does not have to be specified when node_public_ip_enabled is false * Address review * Fix O+C message * address doc fix
- Loading branch information
1 parent
09a3da3
commit c3c2634
Showing
3 changed files
with
61 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,21 @@ func TestAccComputeCluster_complete(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestAccComputeCluster_subnetResourceId(t *testing.T) { | ||
data := acceptance.BuildTestData(t, "azurerm_machine_learning_compute_cluster", "test") | ||
r := ComputeClusterResource{} | ||
|
||
data.ResourceTest(t, r, []acceptance.TestStep{ | ||
{ | ||
Config: r.noSubnetResourceId(data), | ||
Check: acceptance.ComposeTestCheckFunc( | ||
check.That(data.ResourceName).ExistsInAzure(r), | ||
), | ||
}, | ||
data.ImportStep(), | ||
}) | ||
} | ||
|
||
func TestAccComputeCluster_recreateVmSize(t *testing.T) { | ||
data := acceptance.BuildTestData(t, "azurerm_machine_learning_compute_cluster", "test") | ||
r := ComputeClusterResource{} | ||
|
@@ -235,6 +250,48 @@ resource "azurerm_machine_learning_compute_cluster" "test" { | |
`, template, data.RandomIntOfLength(8)) | ||
} | ||
|
||
func (r ComputeClusterResource) noSubnetResourceId(data acceptance.TestData) string { | ||
template := r.template_complete(data) | ||
return fmt.Sprintf(` | ||
%s | ||
variable "ssh_key" { | ||
default = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt [email protected]" | ||
} | ||
resource "azurerm_machine_learning_compute_cluster" "test" { | ||
name = "CC-%d" | ||
location = azurerm_resource_group.test.location | ||
vm_priority = "LowPriority" | ||
vm_size = "STANDARD_DS2_V2" | ||
machine_learning_workspace_id = azurerm_machine_learning_workspace.test.id | ||
node_public_ip_enabled = false | ||
description = "Machine Learning" | ||
tags = { | ||
environment = "test" | ||
} | ||
scale_settings { | ||
min_node_count = 0 | ||
max_node_count = 1 | ||
scale_down_nodes_after_idle_duration = "PT30S" # 30 seconds | ||
} | ||
identity { | ||
type = "SystemAssigned" | ||
} | ||
ssh_public_access_enabled = false | ||
ssh { | ||
admin_username = "adminuser" | ||
key_value = var.ssh_key | ||
} | ||
depends_on = [ | ||
azurerm_subnet_network_security_group_association.test, | ||
azurerm_private_endpoint.test, | ||
] | ||
} | ||
`, template, data.RandomIntOfLength(8)) | ||
} | ||
|
||
func (r ComputeClusterResource) recreateVmSize(data acceptance.TestData) string { | ||
template := r.template_basic(data) | ||
return fmt.Sprintf(` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters