aws_network_manager_devices Resource
Use the aws_network_manager_devices InSpec audit resource to test properties of multiple AWS Network Manager devices.
The AWS::NetworkManager::Device resource gets information about one or more of your devices in a global network.
For additional information, including details on parameters and properties, see the AWS documentation on AWS Network Manager Device.
Install
This resource is available in the Chef InSpec AWS resource pack.
For information on configuring your AWS environment for Chef InSpec and creating an InSpec profile that uses the InSpec AWS resource pack, see the Chef InSpec documentation on the AWS cloud platform.
Syntax
Ensure that a device exists.
describe aws_network_manager_devices(global_network_id: 'GLOBAL_NETWORK_ID') do
it { should exist }
end
Parameters
global_network_id(required)The ID of the global network.
Properties
device_ids- The ID of the device.
Field:
device_iddevice_arns- The Amazon Resource Name (ARN) of the device.
Field:
device_arnglobal_network_ids- The ID of the global network.
Field:
global_network_idlocation_zones- The Zone the device is located in. This can be the ID of an Availability Zone, Local Zone, Wavelength Zone, or an Outpost.
Field:
zonelocation_subnet_arns- The Amazon Resource Name (ARN) of the subnet the device is located in.
Field:
subnet_arndescriptions- The description of the device.
Field:
descriptiontypes- The device type.
Field:
typevendors- The device vendor.
Field:
vendormodels- The device model.
Field:
modeladdresses- The physical address of the location.
Field:
addresslatitudes- The latitude of the location.
Field:
latitudelongitudes- The longitude of the location.
Field:
longitudesite_ids- The site ID.
Field:
site_idcreated_at- The date and time that the site was created.
Field:
created_atstates- The device state.
Field:
statetags- The tags for the device.
Field:
tags
Examples
Ensure a device ID is available.
describe aws_network_manager_devices(global_network_id: 'GLOBAL_NETWORK_ID') do
its('device_ids') { should include 'DEVICE_ID' }
end
Ensure a global network ID is available.
describe aws_network_manager_devices(global_network_id: 'GLOBAL_NETWORK_ID') do
its('global_network_ids') { should include 'GLOBAL_NETWORK_ID' }
end
Ensure a location zone is available.
describe aws_network_manager_devices(global_network_id: 'GLOBAL_NETWORK_ID') do
its('location_zones') { should include 'ZONE_NAME' }
end
Ensure that the state is AVAILABLE.
describe aws_network_manager_devices(global_network_id: 'GLOBAL_NETWORK_ID') do
its('states') { should include 'AVAILABLE' }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.This resource has the following special matchers.
exist
Use should to test that the entity exists.
describe aws_network_manager_devices(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_devices(global_network_id: 'GLOBAL_NETWORK_ID') do
it { should_not exist }
end
AWS Permissions
Your Principal will need the NetworkManager:Client:GetDevicesResponse action with Effect set to Allow.