title | platform |
---|---|
About the aws_network_manager_device Resource |
aws |
Use the aws_network_manager_device
InSpec audit resource to test properties of a single specific AWS Network Manager device.
The AWS::NetworkManager::Device
resource gets information about one or more of your devices in a global network.
Ensure that a device exists.
describe aws_network_manager_device(device_id: 'DEVICE_ID', global_network_id: 'GLOBAL_NETWORK_ID') do
it { should exist }
end
device_id
(required)
The ID of the device.
global_network_id
(required)
The ID of the global network.
For additional information, see the AWS documentation on AWS Network Manager Device.
Property | Description |
---|---|
device_id | The ID of the device. |
device_arn | The Amazon Resource Name (ARN) of the device. |
global_network_id | The ID of the global network. |
aws_location.zone | The Zone the device is located in. This can be the ID of an Availability Zone, Local Zone, Wavelength Zone, or an Outpost. |
aws_location.subnet_arn | The Amazon Resource Name (ARN) of the subnet the device is located in. |
description | The description of the device. |
type | The device type. |
vendor | The device vendor. |
model | The device model. |
serial_number | The device serial number. |
location.address | The physical address of the location. |
location.latitude | The latitude of the location. |
location.longitude | The longitude of the location. |
site_id | The site ID. |
created_at | The date and time that the site was created. |
state | The device state. |
tags | The tags for the device. |
describe aws_network_manager_device(device_id: 'DEVICE_ID', global_network_id: 'GLOBAL_NETWORK_ID') do
its('device_id') { should eq 'DEVICE_ID' }
end
describe aws_network_manager_device(device_id: 'DEVICE_ID', global_network_id: 'GLOBAL_NETWORK_ID') do
its('global_network_id') { should eq 'GLOBAL_NETWORK_ID' }
end
describe aws_network_manager_device(device_id: 'DEVICE_ID', global_network_id: 'GLOBAL_NETWORK_ID') do
its('aws_location.zone') { should eq 'ZONE_NAME' }
end
describe aws_network_manager_global_network(device_id: 'DEVICE_ID', global_network_id: 'GLOBAL_NETWORK_ID') do
its('state') { should eq 'AVAILABLE' }
end
This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our Universal Matchers page.
The controls will pass if the get
method returns at least one result.
Use should
to test that the entity exists.
describe aws_network_manager_device(device_id: 'DEVICE_ID', global_network_id: 'GLOBAL_NETWORK_ID') do
it { should exist }
end
Use should_not
to test the entity does not exist.
describe aws_network_manager_device(device_id: 'DEVICE_ID', global_network_id: 'GLOBAL_NETWORK_ID') do
it { should_not exist }
end
Use should
to check if the entity is available.
describe aws_network_manager_device(device_id: 'DEVICE_ID', global_network_id: 'GLOBAL_NETWORK_ID') do
it { should be_available }
end
Your Principal will need the NetworkManager:Client:GetDevicesResponse
action with Effect
set to Allow
.