azure_db_migration_service Resource
Use the azure_db_migration_service
InSpec audit resource to test properties related to a Azure DB Migration Service.
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.
Installation
This resource is available in the Chef InSpec Azure resource pack.
See the Chef InSpec documentation on cloud platforms for information on configuring your Azure environment for InSpec and creating an InSpec profile that uses the InSpec Azure resource pack.
Syntax
resource_group
and service_name
must be given as a parameter.
describe azure_db_migration_service(resource_group: 'MyResourceGroup', service_name: 'dbbackup_to_uat_migration_servicet') do
it { should exist }
its('name') { should cmp 'inspec-cloud-pack-test' }
its('type') { should cmp 'Microsoft.DataMigration/services' }
its('sku.name') { should cmp 'Basic_1vCore' }
its('sku.size') { should cmp '1 vCore' }
its('location') { should cmp 'southcentralus' }
end
describe azure_db_migration_service(resource_group: 'MyResourceGroup', service_name: 'dbbackup_to_uat_migration_service') do
it { should exist }
end
Parameters
resource_group
- Azure resource group that the targeted resource resides in.
MyResourceGroup
. service_name
- Name of the Azure DB Migration service to test.
The parameter set should be provided for a valid query:
resource_group
andservice_name
Properties
id
- Resource ID.
name
- DB Migration Service Name.
location
- DB Migration Service Location.
type
- Resource type.
kind
- The resource kind.
etag
- HTTP strong entity tag value. Ignored if submitted.
sku.name
- The unique name of the SKU, such as ‘P3’.
sku.size
- The size of the SKU, used when the name alone does not denote a service size or when a SKU has multiple performance classes within a family, e.g. ‘A1’ for virtual machines.
sku.tier
- The tier of the SKU, such as ‘Free’, ‘Basic’, ‘Standard’, or ‘Premium’.
tags
- Resource tags.
properties.provisioningState
- The resource’s provisioning state.
properties.virtualSubnetId
- The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined.
properties.virtualNicId
- The ID of the Azure Network Interface.
For properties applicable to all resources, such as type
, name
, id
, properties
, refer to azure_generic_resource
.
Also, refer to Azure documentation for other properties available.
Any attribute in the response may be accessed with the key names separated by dots (.
).
Examples
Test <>.
describe azure_db_migration_service(resource_group: 'MyResourceGroup', service_name: 'dbbackup_to_uat_migration_service') do
its('properties.provisioningState') { should eq 'Succeeded' }
end
Test <>.
describe azure_db_migration_service(resource_group: 'MyResourceGroup', service_name: 'dbbackup_to_uat_migration_service') do
its('sku.name') { should 'Standard_1vCores' }
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 azure_db_migration_service is found it will exist
describe azure_db_migration_service(resource_group: 'MyResourceGroup', service_name: 'dbbackup_to_uat_migration_service') do
it { should exist }
end
# azure_db_migration_services that aren't found will not exist
describe azure_db_migration_service(resource_group: 'MyResourceGroup', service_name: 'dbbackup_to_uat_migration_service') 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.