azure_migrate_assessments Resource
Use the azure_migrate_assessments InSpec audit resource to test the properties related to all Azure Migrate assessments within a project.
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_assessments resource block returns all Azure Migrate assessments within a project.
describe azure_migrate_assessments(resource_group: 'RESOURCE_GROUP', project_name: 'PROJECT_NAME') do
#...
end
Parameters
resource_group- Azure resource group where the targeted resource resides.
project_name- Azure Migrate assessments project name.
The parameter set that should be provided for a valid query are resource_group and project_name.
Properties
ids- Path reference to the assessments.
Field:
idnames- Unique names for all assessments.
Field:
nametypes- Type of the objects.
Field:
typeeTags- A list of eTags for all the assessments.
Field:
eTagproperties- A list of Properties for all the assessments.
Field:
propertiesazureDiskTypes- Storage type selected for the disk of all the assessments.
Field:
azureDiskTypeazureHybridUseBenefits- A HUB discount on windows virtual machines for all the assessments.
Field:
azureHybridUseBenefitazureLocations- Target Azure locations for which the machines should be assessed.
Field:
azureLocationazureOfferCodes- Offer codes according to which cost estimation is done.
Field:
azureOfferCodeazurePricingTiers- Pricing tiers for size evaluation.
Field:
azurePricingTierazureStorageRedundancies- Storage redundancy types offered by Azure.
Field:
azureStorageRedundancyazureVmFamilies- List of azure VM families.
Field:
azureVmFamiliesconfidenceRatingInPercentages- Confidence rating percentages for assessment.
Field:
confidenceRatingInPercentagecreatedTimestamps- Time when this project is created.
Field:
createdTimestampcurrencies- Currencies to report the prices.
Field:
currencydiscountPercentages- Custom discount percentages to be applied to final costs.
Field:
discountPercentageeaSubscriptionIds- Enterprise agreement subscription arm IDs.
Field:
eaSubscriptionIdmonthlyBandwidthCosts- Monthly network cost estimates for the machines.
Field:
monthlyBandwidthCostmonthlyComputeCosts- Monthly compute cost estimates for the machines.
Field:
monthlyComputeCostmonthlyPremiumStorageCosts- Monthly premium storage cost estimates for the machines.
Field:
monthlyPremiumStorageCostmonthlyStandardSSDStorageCosts- Monthly standard SSD storage cost estimates for the machines.
Field:
monthlyStandardSSDStorageCostmonthlyStorageCosts- Monthly storage cost estimates for the machines.
Field:
monthlyStorageCostnumberOfMachines- Number of assessed machines part of the assessments.
Field:
numberOfMachinespercentiles- Percentiles of performance data used to recommend Azure size.
Field:
percentileperfDataEndTimes- End times to consider performance data for assessments.
Field:
perfDataEndTimeperfDataStartTimes- Start times to consider performance data for assessments.
Field:
perfDataStartTimepricesTimestamps- Times when the Azure Prices are queried.
Field:
pricesTimestampreservedInstances- Azure reserved instances.
Field:
reservedInstancescalingFactors- Scaling factors used over utilization data to add a performance buffer for new machines to be created in Azure.
Field:
scalingFactorsizingCriterions- Assessment sizing criteria.
Field:
sizingCriterionstages- User configurable setting that describes the status of the assessments.
Field:
stagestatuses- Whether the assessments have been created and are valid.
Field:
statustimeRanges- Time ranges of performance data used to recommend a size.
Field:
timeRangeupdatedTimestamps- Times when the project is last updated.
Field:
updatedTimestampvmUptimes- Specify the durations for which the VMs are up in the on-premises environment.
Field:
vmUptime
Refer to the Azure Migrate assements documentation for additional information.
Note
Examples
Loop through migrate assessments by their names
azure_migrate_assessments(resource_group: 'RESOURCE_GROUP', project_name: 'PROJECT_NAME'.names.each do |name|
describe azure_container_group (resource_group: 'RESOURCE_GROUP', project_name: 'PROJECT_NAME', group_name: 'GROUP_NAME', name: name) do
it { should exist }
end
end
Test to ensure migrate assessments exist with local redundancy
describe azure_migrate_assessments(resource_group: 'RESOURCE_GROUP', project_name: 'PROJECT_NAME').where(azureStorageRedundancy: 'LocallyRedundant') 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 Assessments are present in the project and the resource group.
describe azure_migrate_assessments(resource_group: 'RESOURCE_GROUP', project_name: 'PROJECT_NAME') do
it { should_not exist }
end
not_exists
# Should exist if the filter returns at least one Migrate Assessment in the project and the resource group.
describe azure_migrate_assessments(resource_group: 'RESOURCE_GROUP', project_name: '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.