forked from inspec/inspec-azure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazurerm_public_ip.rb
21 lines (18 loc) · 944 Bytes
/
azurerm_public_ip.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
resource_group = input('resource_group', value: nil)
address_name = input('ip_address_name', value: '')
control 'azurerm_public_ip' do
only_if { !address_name.empty? }
describe azurerm_public_ip(resource_group: resource_group, name: address_name) do
it { should exist }
its('name') { should cmp address_name }
its('type') { should cmp 'Microsoft.Network/publicIPAddresses' }
its('properties.provisioningState') { should cmp 'Succeeded' }
its('properties.publicIPAddressVersion') { should eq 'IPv4' }
end
describe azurerm_public_ip(resource_group: resource_group, name: 'fake') do
it { should_not exist }
end
describe azurerm_public_ip(resource_group: 'does-not-exist', name: 'fake') do
it { should_not exist }
end
end