Azure Database Migration Service

This page shows how to write Terraform and Azure Resource Manager for Database Migration Service and write them securely.

azurerm_database_migration_service (Terraform)

The Service in Database Migration can be configured in Terraform with the resource name azurerm_database_migration_service. The following sections describe 7 examples of how to use the resource and its parameters.

Example Usage from GitHub

dms.tf#L1
resource "azurerm_database_migration_service" "dms" {
  for_each = var.settings.dms

  name                = each.value.name
  location            = var.location
  resource_group_name = var.resource_group_name
dms.tf#L1
resource "azurerm_database_migration_service" "dms" {
  for_each = var.settings.dms

  name                = each.value.name
  location            = var.location
  resource_group_name = var.resource_group_name
main.tf#L35
resource "azurerm_database_migration_service" "dbms" {
  name                = "database_migration_service-dbms"
  location            = azurerm_resource_group.resource_group.location
  resource_group_name = azurerm_resource_group.resource_group.name
  subnet_id   = azurerm_subnet.migrate_subnet.id
  sku_name            = "Standard_1vCores"
dms.tf#L12
resource "azurerm_database_migration_service" "dms" {
  name                = azurecaf_name.dms.result
  location            = var.location
  resource_group_name = var.resource_group_name
  sku_name            = var.settings.sku_name
  tags                = local.tags
dms.tf#L12
resource "azurerm_database_migration_service" "dms" {
  name                = azurecaf_name.dms.result
  location            = var.location
  resource_group_name = var.resource_group_name
  sku_name            = var.settings.sku_name
  tags                = local.tags
main.tf#L7
resource "azurerm_database_migration_service" "this" {
  location            = var.location
  name                = var.name
  resource_group_name = var.resource_group_name
  sku_name            = var.sku_name
  subnet_id           = var.subnet_id
dms.tf#L1
resource "azurerm_database_migration_service" "dms" {
  for_each = var.settings.dms

  name                = each.value.name
  location            = var.location
  resource_group_name = var.resource_group_name

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Azure Database Migration Service.

NOTE: Destroying a Database Migration Service will leave any outstanding tasks untouched. This is to avoid unexpectedly deleting any tasks managed outside of terraform.

Microsoft.DataMigration/services (Azure Resource Manager)

The services in Microsoft.DataMigration can be configured in Azure Resource Manager with the resource name Microsoft.DataMigration/services. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

  • apiVersion required - string
  • etag optional - string

    HTTP strong entity tag value. Ignored if submitted

  • kind optional - string

    The resource kind. Only 'vm' (the default) is supported.

  • location required - string

    Resource location.

  • name required - string

    Name of the service

  • properties required
      • publicKey optional - string

        The public key of the service, used to encrypt secrets sent to the service

      • virtualNicId optional - string

        The ID of the Microsoft.Network/networkInterfaces resource which the service have

      • virtualSubnetId required - string

        The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be joined

  • sku optional
      • capacity optional - integer

        The capacity of the SKU, if it supports scaling

      • family optional - string

        The SKU family, used when the service has multiple performance classes within a tier, such as 'A', 'D', etc. for virtual machines

      • name optional - string

        The unique name of the SKU, such as 'P3'

      • size optional - string

        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

      • tier optional - string

        The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'

  • tags optional - string

    Resource tags.

  • type required - string

Frequently asked questions

What is Azure Database Migration Service?

Azure Database Migration Service is a resource for Database Migration of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Database Migration Service?

For Terraform, the anmoltoppo/Terraform, davesee/terraform-caf-rover-breakout and celenn/Azure-Migrate source code examples are useful. See the Terraform Example section for further details.