azure_migrate_assessment_machines resource
Use the azure_migrate_assessment_machines
InSpec audit resource to test the properties related to all Azure Migrate assessment machines within a project.
Azure REST API version, endpoint, and HTTP client parameters
This resource interacts with API versions supported by the resource provider.
You can specify the api_version
as a resource parameter to use a specific version of the Azure REST API.
If you don’t specify an API version, this resource uses the latest version available.
For more information about API versioning, see the azure_generic_resource
.
By default, this resource uses the azure_cloud
global endpoint and default HTTP client settings.
You can override these settings if you need to connect to a different Azure environment (such as Azure Government or Azure China).
For more information about configuration options, see the resource pack README.
Syntax
An azure_migrate_assessment_machines
resource block returns all Azure Migrate assessment machines within a project.
describe azure_migrate_assessment_machines(resource_group: 'RESOURCE_GROUP', project_name: 'MIGRATE_ASSESSMENT_PROJECT_NAME') do
#...
end
Parameters
resource_group
(required)Azure resource group where the targeted resource resides.
project_name
(required)The Azure Migrate Assessment project.
Properties
ids
- Path reference to the assessment machines.
Field:
id
names
- Unique names for all assessment machines.
Field:
name
types
- Type of the objects.
Field:
type
- A list of eTags for all the assessment machines.
Field:
eTag
properties
- A list of properties for all the assessment machines.
Field:
properties
bootTypes
- A list of boot machines.
Field:
bootType
createdTimestamps
- Time when this machine is created.
Field:
createdTimestamp
datacenterManagementServerArmIds
- A list of ARM IDs of the data center as tracked by the
Microsoft.OffAzure
.Field:
datacenterManagementServerArmId
datacenterManagementServerNames
- Name of the servers hosting the data center management solution.
Field:
datacenterManagementServerName
descriptions
- Descriptions of all the machines.
Field:
description
discoveryMachineArmIds
- A list of ARM IDs of the machine as tracked by the
Microsoft.OffAzure
.Field:
discoveryMachineArmId
disks
- Dictionary of disks attached to all the machines. The key is disk ID. Value is a disk object.
Field:
disks
displayNames
- User readable names of all the machines as defined by the user in their private data center.
Field:
displayName
groups
- A List of references to the groups where the machine is a member.
Field:
groups
megabytesOfMemories
- A list of memories in Megabytes.
Field:
megabytesOfMemory
networkAdapters
- Dictionary of network adapters attached to all the machines. The key is the network adapter ID. Value is a network adapter object.
Field:
networkAdapters
numberOfCores
- Processor counts.
Field:
numberOfCores
operatingSystemTypes
- Operating system types of all the machines.
Field:
operatingSystemType
operatingSystemNames
- Operating system names of all the machines.
Field:
operatingSystemName
operatingSystemVersions
- Operating system versions of all the machines.
Field:
operatingSystemVersion
updatedTimestamps
- Time when the machines are last updated.
Field:
updatedTimestamp
Note
Examples
Loop through migrate assessment machines by their names:
azure_migrate_assessment_machines(resource_group: 'RESOURCE_GROUP', project_name: 'MIGRATE_ASSESSMENT_PROJECT_NAME').names.each do |name|
describe azure_migrate_assessment_machine(resource_group: 'RESOURCE_GROUP', project_name: 'MIGRATE_ASSESSMENT_PROJECT_NAME', group_name: 'MACHINE_GROUP_NAME', name: name) do
it { should exist }
end
end
Test that there are migrate assessment machines with BIOS boot type:
describe azure_migrate_assessment_machines(resource_group: 'RESOURCE_GROUP', project_name: 'MIGRATE_ASSESSMENT_PROJECT_NAME').where(bootType: 'BIOS') do
it { should exist }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.This resource has the following special matchers.
exists
# Should not exist if no migrate assessment machines are present in the project and the resource group.
describe azure_migrate_assessment_machines(resource_group: 'RESOURCE_GROUP', project_name: 'MIGRATE_ASSESSMENT_PROJECT_NAME') do
it { should_not exist }
end
not_exists
# Should exist if the filter returns at least one migrate assessment machine in the project and the resource group.
describe azure_migrate_assessment_machines(resource_group: 'RESOURCE_GROUP', project_name: 'MIGRATE_ASSESSMENT_PROJECT_NAME') do
it { should exist }
end
Azure permissions
Your Service Principal must be set up with at least a contributor
role on the subscription you wish to test.