Skip to main content

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.

Installation

This resource is available in the Chef InSpec AWS resource pack.

See the Chef InSpec documentation on cloud platforms for information on configuring your AWS environment for InSpec and creating an InSpec profile that uses the InSpec AWS resource pack.

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_id

device_arns
The Amazon Resource Name (ARN) of the device.

Field: device_arn

global_network_ids
The ID of the global network.

Field: global_network_id

location_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: zone

location_subnet_arns
The Amazon Resource Name (ARN) of the subnet the device is located in.

Field: subnet_arn

descriptions
The description of the device.

Field: description

types
The device type.

Field: type

vendors
The device vendor.

Field: vendor

models
The device model.

Field: model

addresses
The physical address of the location.

Field: address

latitudes
The latitude of the location.

Field: latitude

longitudes
The longitude of the location.

Field: longitude

site_ids
The site ID.

Field: site_id

created_at
The date and time that the site was created.

Field: created_at

states
The device state.

Field: state

tags
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

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.

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.

Edit this page on GitHub

Thank you for your feedback!

×









Search Results