azure_migrate_project Resource
Use the azure_migrate_project
InSpec audit resource to test the properties related to an Azure Migrate 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, the latest version will be used. For more information, refer to azure_generic_resource
.
Unless defined, azure_cloud
global endpoint and default values for the HTTP client will be used. 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
name
and resource_group
are required parameters.
describe azure_migrate_project(resource_group: 'RESOURCE_GROUP', name: 'PROJECT_NAME') do
it { should exist }
its('name') { should eq 'zoneA_migrate_project' }
its('type') { should eq 'Microsoft.Migrate/MigrateProjects' }
end
describe azure_migrate_project(resource_group: 'RESOURCE_GROUP', name: 'PROJECT_NAME') do
it { should exist }
end
Parameters
name
- Name of the Azure Migrate project to test.
resource_group
- Azure resource group where the targeted resource resides.
The parameter set that should be provided for a valid query is resource_group
and name
.
Properties
id
- Path reference to the Migrate project.
eTag
- The eTag for concurrency control.
name
- Unique name of a Migrate project.
type
- Type of the object.
Microsoft.Migrate/MigrateProject
. properties
- The nested properties.
For properties applicable to all resources, such as type
, name
, id
, and properties
, refer to azure_generic_resource
.
Also, refer to the Azure documentation for other available properties.
Any attribute in the response nested within properties may be accessed with the key names separated by dots (.
), and attributes nested in the assessment data are pluralized and listed as a collection.
Examples
Test that The Migrate project has a server instance type
describe azure_migrate_project(resource_group: 'RESOURCE_GROUP', name: 'PROJECT_NAME') do
its('properties.summary.servers.instanceType') { should eq 'Servers' }
end
Matchers
This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our Universal Matchers page.
exists
# If a Migrate project is found, it exists.
describe azure_migrate_project(resource_group: 'RESOURCE_GROUP', name: 'PROJECT_NAME') do
it { should exist }
end
# If Migrate project is not found, it does not exist.
describe azure_migrate_project(resource_group: 'RESOURCE_GROUP', name: 'PROJECT_NAME') do
it { should_not exist }
end
Azure Permissions
Your Service Principal must be set up with at least a contributor
role on the subscription you wish to test.