Created
February 11, 2019 12:39
-
-
Save mikaelkrief/0299b1eed9e0440cf2c87b3d57fd695e to your computer and use it in GitHub Desktop.
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
control 'azurerm_virtual_machine' do | |
describe azurerm_virtual_machine(resource_group: 'MyResourceGroup', name: 'prod-web-01') do | |
it { should exist } | |
it { should have_monitoring_agent_installed } | |
it { should have_only_approved_extensions(['MicrosoftMonitoringAgent']) } | |
its('type') { should eq 'Microsoft.Compute/virtualMachines' } | |
its('installed_extensions_types') { should include('MicrosoftMonitoringAgent') } | |
its('installed_extensions_names') { should include('LogAnalytics') } | |
its('properties.location') { should eq 'northeurope'} | |
its('properties.hardwareProfile.vmSize') { should eq 'Standard_Ds1_V2'} | |
its('properties.storageProfile.osDisk.osType') { should eq 'Linux' } | |
its('properties.storageProfile.dataDisks.count') { should eq 1 } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment