azure_migrate_assessment_projects Resource
Use the azure_migrate_assessment_projects InSpec audit resource to test the properties related to all Azure Migrate assessment projects within a subscription.
Azure REST API Version, Endpoint, and HTTP Client Parameters
This resource interacts with API versions supported by the resource provider.
The api_version can be defined as a resource parameter.
If not provided, this resource uses the latest version.
For more information, refer to the azure_generic_resource document.
Unless defined, this resource uses the azure_cloud global endpoint and default values for the HTTP client.
For more information, refer to the resource pack README.
Install
This resource is available in the Chef InSpec Azure resource pack.
For information on configuring your Azure environment for Chef InSpec and creating an InSpec profile that uses the InSpec Azure resource pack, see the Chef InSpec documentation for the Azure cloud platform.
Syntax
An azure_migrate_assessment_projects resource block returns all Azure Migrate projects within a subscription.
describe azure_migrate_assessment_projects do
#...
end
Parameters
This resource does not require any parameters.
Properties
ids- Path reference to the projects.
Field:
idnames- Name of the projects.
Field:
nametypes- Type of the project.
Field:
typeeTags- A list of eTags for all the assessments.
Field:
eTaglocations- Azure locations in which the project is created.
Field:
locationtags- A list of Tags provided by Azure Tagging service.
Field:
tagsproperties- A list of Properties for all the projects.
Field:
propertiesassessmentSolutionIds- Assessment solution ARM IDs tracked by
Microsoft.Migrate/migrateProjects. Field:
assessmentSolutionIdcreatedTimestamps- Times when this project is created. Date-Time is represented in ISO-8601 format.
Field:
createdTimestampcustomerStorageAccountArmIds- The ARM IDs of the storage account used for interactions when public access is disabled.
Field:
customerStorageAccountArmIdcustomerWorkspaceIds- The ARM IDs of the service map workspace created by customer.
Field:
customerWorkspaceIdcustomerWorkspaceLocations- Locations of the service map workspace created by customer.
Field:
customerWorkspaceLocationlastAssessmentTimestamps- Times when the last assessment is created.
Field:
lastAssessmentTimestampnumberOfAssessments- Number of assessments created in the project.
Field:
numberOfAssessmentsnumberOfGroups- Number of groups created in all the projects.
Field:
numberOfGroupsnumberOfMachines- Number of machines in all the projects.
Field:
numberOfMachinesprivateEndpointConnections- The list of private endpoint connections to the projects.
Field:
privateEndpointConnectionsprojectStatuses- Assessment project statuses.
Field:
projectStatusprovisioningStates- Provisioning states of all the projects.
Field:
provisioningStatepublicNetworkAccesses- Public network access for all the projects.
Field:
publicNetworkAccessserviceEndpoints- Service endpoints of all the projects.
Field:
serviceEndpointupdatedTimestamps- Times when this project is last updated.
Field:
updatedTimestamp
Note
Examples
Loop through migrate assessment projects by their names
azure_migrate_assessment_projects.names.each do |name|
describe azure_migrate_assessment_project(resource_group: 'RESOURCE_GROUP', name: name) do
it { should exist }
end
end
Test to ensure that migrate assessment projects in West Europe location
describe azure_migrate_assessment_projects.where(location: 'westeurope') 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 projects are present in the subscription.
describe azure_migrate_assessment_projects do
it { should_not exist }
end
not_exists
# Should exist if the filter returns at least one Migrate Assessment project in the subscription.
describe azure_migrate_assessment_projects 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.