Skip to content

Commit

Permalink
azurerm_security_center_server_vulnerability_assessment and `azurer…
Browse files Browse the repository at this point in the history
…m_security_center_server_vulnerability_assessment_virtual_machine` - adding pricing tier in test config

Relates-to: hashicorp#14736
  • Loading branch information
ziyeqf authored and leesutcliffe committed Nov 24, 2022
1 parent 36c34e3 commit 9843e2e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ func TestAccServerVulnerabilityAssessment_basic(t *testing.T) {
),
},
data.ImportStep(),
{
// reset pricing to free
Config: SecurityCenterSubscriptionPricingResource{}.tier("Free", "VirtualMachines"),
},
})
}

Expand All @@ -42,6 +46,10 @@ func TestAccServerVulnerabilityAssessment_requiresImport(t *testing.T) {
),
},
data.RequiresImportErrorStep(r.requiresImport),
{
// reset pricing to free
Config: SecurityCenterSubscriptionPricingResource{}.tier("Free", "VirtualMachines"),
},
})
}

Expand Down Expand Up @@ -124,8 +132,15 @@ resource "azurerm_linux_virtual_machine" "test" {
network_interface_ids = [azurerm_network_interface.test.id]
}
resource "azurerm_security_center_subscription_pricing" "test" {
tier = "Standard"
resource_type = "VirtualMachines"
subplan = "P2"
}
resource "azurerm_security_center_server_vulnerability_assessment" "test" {
virtual_machine_id = azurerm_linux_virtual_machine.test.id
depends_on = [azurerm_security_center_subscription_pricing.test]
}
`, data.RandomInteger, data.Locations.Primary)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ func TestAccServerVulnerabilityAssessmentVirtualMachine_basic(t *testing.T) {
),
},
data.ImportStep(),
{
// reset pricing to free
Config: SecurityCenterSubscriptionPricingResource{}.tier("Free", "VirtualMachines"),
},
})
}

Expand All @@ -42,6 +46,10 @@ func TestAccServerVulnerabilityAssessmentVirtualMachine_requiresImport(t *testin
),
},
data.RequiresImportErrorStep(r.requiresImport),
{
// reset pricing to free
Config: SecurityCenterSubscriptionPricingResource{}.tier("Free", "VirtualMachines"),
},
})
}

Expand Down Expand Up @@ -121,8 +129,15 @@ resource "azurerm_linux_virtual_machine" "test" {
network_interface_ids = [azurerm_network_interface.test.id]
}
resource "azurerm_security_center_subscription_pricing" "test" {
tier = "Standard"
resource_type = "VirtualMachines"
subplan = "P2"
}
resource "azurerm_security_center_server_vulnerability_assessment_virtual_machine" "test" {
virtual_machine_id = azurerm_linux_virtual_machine.test.id
depends_on = [azurerm_security_center_subscription_pricing.test]
}
`, data.RandomInteger, data.Locations.Primary)
}
Expand Down

0 comments on commit 9843e2e

Please sign in to comment.