Skip to content

Azure/terraform-azurerm-avm-ptn-azure-local-migrate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

terraform-azurerm-avm-template

This is a template repo for Terraform Azure Verified Modules.

Requirements

The following requirements are needed by this module:

Resources

The following resources are used by this module:

Required Inputs

The following input variables are required:

Description: The name of the migration resource.

Type: string

Description: The resource group where the resources will be deployed.

Type: string

Optional Inputs

The following input variables are optional (have default values):

Description: Application consistent snapshot frequency in minutes

Type: number

Default: 240

Description: Appliance name (maps to site name)

Type: string

Default: null

Description: Storage Account ARM ID for cache/private endpoint scenario

Type: string

Default: null

Description: Crash consistent snapshot frequency in minutes

Type: number

Default: 60

Description: Whether to create a new Azure Migrate project. If false, an existing project is queried.

Type: bool

Default: false

Description: Whether to create a new resource group. If false, an existing resource group is queried. When true, location must be specified.

Type: bool

Default: false

Description: Custom location ARM ID for Arc

Type: string

Default: null

Description: A map describing customer-managed keys to associate with the resource. This includes the following properties:

  • key_vault_resource_id - The resource ID of the Key Vault where the key is stored.
  • key_name - The name of the key.
  • key_version - (Optional) The version of the key. If not specified, the latest version is used.
  • user_assigned_identity - (Optional) An object representing a user-assigned identity with the following properties:
    • resource_id - The resource ID of the user-assigned identity.

Type:

object({
    key_vault_resource_id = string
    key_name              = string
    key_version           = optional(string, null)
    user_assigned_identity = optional(object({
      resource_id = string
    }), null)
  })

Default: null

Description: A map of diagnostic settings to create on the Key Vault. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.

  • name - (Optional) The name of the diagnostic setting. One will be generated if not set, however this will not be unique if you want to create multiple diagnostic setting resources.
  • log_categories - (Optional) A set of log categories to send to the log analytics workspace. Defaults to [].
  • log_groups - (Optional) A set of log groups to send to the log analytics workspace. Defaults to ["allLogs"].
  • metric_categories - (Optional) A set of metric categories to send to the log analytics workspace. Defaults to ["AllMetrics"].
  • log_analytics_destination_type - (Optional) The destination type for the diagnostic setting. Possible values are Dedicated and AzureDiagnostics. Defaults to Dedicated.
  • workspace_resource_id - (Optional) The resource ID of the log analytics workspace to send logs and metrics to.
  • storage_account_resource_id - (Optional) The resource ID of the storage account to send logs and metrics to.
  • event_hub_authorization_rule_resource_id - (Optional) The resource ID of the event hub authorization rule to send logs and metrics to.
  • event_hub_name - (Optional) The name of the event hub. If none is specified, the default event hub will be selected.
  • marketplace_partner_resource_id - (Optional) The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic LogsLogs.

Type:

map(object({
    name                                     = optional(string, null)
    log_categories                           = optional(set(string), [])
    log_groups                               = optional(set(string), ["allLogs"])
    metric_categories                        = optional(set(string), ["AllMetrics"])
    log_analytics_destination_type           = optional(string, "Dedicated")
    workspace_resource_id                    = optional(string, null)
    storage_account_resource_id              = optional(string, null)
    event_hub_authorization_rule_resource_id = optional(string, null)
    event_hub_name                           = optional(string, null)
    marketplace_partner_resource_id          = optional(string, null)
  }))

Default: {}

Description: Disks to include for replication (power user mode)

Type:

list(object({
    disk_id          = string
    disk_size_gb     = number
    disk_file_format = optional(string, "VHDX")
    is_os_disk       = bool
    is_dynamic       = optional(bool, true)
  }))

Default: []

Description: Source machine display name for filtering

Type: string

Default: null

Description: This variable controls whether or not telemetry is enabled for the module.
For more information see https://aka.ms/avm/telemetryinfo.
If it is set to false, then no telemetry will be collected.

Type: bool

Default: true

Description: Specifies whether the replication needs to be force removed. Use with caution as force removal may leave resources in an inconsistent state.

Type: bool

Default: false

Description: Hyper-V generation (1 or 2)

Type: string

Default: "1"

Description: Migration instance type

Type: string

Default: "VMwareToAzStackHCI"

Description: Whether RAM is dynamic

Type: bool

Default: false

Description: Specific job name to retrieve. If not provided, all jobs will be listed.

Type: string

Default: null

Description: Azure region where resources should be deployed. Required when create_resource_group or create_migrate_project is true.

Type: string

Default: null

Description: Controls the Resource Lock configuration for this resource. The following properties can be specified:

  • kind - (Required) The type of lock. Possible values are \"CanNotDelete\" and \"ReadOnly\".
  • name - (Optional) The name of the lock. If not specified, a name will be generated based on the kind value. Changing this forces the creation of a new resource.

Type:

object({
    kind = string
    name = optional(string, null)
  })

Default: null

Description: Machine ARM ID of the discovered server to migrate

Type: string

Default: null

Description: Index of the discovered server from the list (1-based)

Type: number

Default: null

Description: Source machine internal name

Type: string

Default: null

Description: Controls the Managed Identity configuration on this resource. The following properties can be specified:

  • system_assigned - (Optional) Specifies if the System Assigned Managed Identity should be enabled.
  • user_assigned_resource_ids - (Optional) Specifies a list of User Assigned Managed Identity resource IDs to be assigned to this resource.

Type:

object({
    system_assigned            = optional(bool, false)
    user_assigned_resource_ids = optional(set(string), [])
  })

Default: {}

Description: NIC ID for the source server (default user mode). Used when nics_to_include is not provided but target_virtual_switch_id is specified.

Type: string

Default: null

Description: NICs to include for replication (power user mode)

Type:

list(object({
    nic_id            = string
    target_network_id = string
    test_network_id   = optional(string)
    selection_type    = optional(string, "SelectedByUser")
  }))

Default: []

Description: The migration operation to perform: create-project, discover, initialize, replicate, jobs, remove, get, list, or migrate

Type: string

Default: "discover"

Description: Operating system disk ID for the source server (default user mode)

Type: string

Default: null

Description: OS disk size in GB for default user mode. Used when disks_to_include is not provided.

Type: number

Default: 60

Description: Replication policy name

Type: string

Default: null

Description: Azure Migrate project name

Type: string

Default: null

Description: The full ARM resource ID of the protected item to retrieve. Required for 'get' operation mode when retrieving by ID. Format: /subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.DataReplication/replicationVaults/{vault-name}/protectedItems/{item-name}

Type: string

Default: null

Description: The name of the protected item to retrieve. Required for 'get' operation mode when retrieving by name (requires project_name or replication_vault_id).

Type: string

Default: null

Description: Recovery point retention in minutes

Type: number

Default: 4320

Description: Replication extension name (for replicate mode)

Type: string

Default: null

Description: Replication vault ARM ID (for replicate mode)

Type: string

Default: null

Description: A map of role assignments to create on this resource. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.

  • role_definition_id_or_name - The ID or name of the role definition to assign to the principal.
  • principal_id - The ID of the principal to assign the role to.
  • description - The description of the role assignment.
  • skip_service_principal_aad_check - If set to true, skips the Azure Active Directory check for the service principal in the tenant. Defaults to false.
  • condition - The condition which will be used to scope the role assignment.
  • condition_version - The version of the condition syntax. Valid values are '2.0'.
  • delegated_managed_identity_resource_id - The delegated Azure Resource Id which contains a Managed Identity. Changing this forces a new resource to be created.
  • principal_type - The type of the principal_id. Possible values are User, Group and ServicePrincipal. Changing this forces a new resource to be created. It is necessary to explicitly set this attribute when creating role assignments if the principal creating the assignment is constrained by ABAC rules that filters on the PrincipalType attribute.

Note: only set skip_service_principal_aad_check to true if you are assigning a role to a service principal.

Type:

map(object({
    role_definition_id_or_name             = string
    principal_id                           = string
    description                            = optional(string, null)
    skip_service_principal_aad_check       = optional(bool, false)
    condition                              = optional(string, null)
    condition_version                      = optional(string, null)
    delegated_managed_identity_resource_id = optional(string, null)
    principal_type                         = optional(string, null)
  }))

Default: {}

Description: Run-as account ARM ID

Type: string

Default: null

Description: Whether to shut down the source VM before migration. Recommended to set to true to ensure data consistency. Required for 'migrate' operation mode.

Type: bool

Default: false

Description: Source appliance name for AzLocal scenario

Type: string

Default: null

Description: Source fabric agent (DRA) name

Type: string

Default: null

Description: Source replication fabric ARM ID

Type: string

Default: null

Description: Source machine type (VMware or HyperV)

Type: string

Default: "VMware"

Description: Number of CPU cores from source VM

Type: number

Default: 2

Description: Source RAM size in MB

Type: number

Default: 4096

Description: (Optional) Tags of the resource.

Type: map(string)

Default: null

Description: Target appliance name for AzLocal scenario

Type: string

Default: null

Description: Target fabric agent (DRA) name

Type: string

Default: null

Description: Target replication fabric ARM ID

Type: string

Default: null

Description: Target HCI cluster ARM ID

Type: string

Default: null

Description: The protected item ARM ID for which replication needs to be disabled. Required for 'remove' operation mode. Format: /subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.DataReplication/replicationVaults/{vault-name}/protectedItems/{item-name}

Type: string

Default: null

Description: Target resource group ARM ID for migrated VM resources

Type: string

Default: null

Description: Storage path ARM ID where VMs will be stored

Type: string

Default: null

Description: Test logical network ARM ID for VMs

Type: string

Default: null

Description: Logical network ARM ID for VMs (default user mode)

Type: string

Default: null

Description: Number of CPU cores for target VM

Type: number

Default: null

Description: Name of the VM to be created on target

Type: string

Default: null

Description: Target RAM size in MB

Type: number

Default: null

Outputs

The following outputs are exported:

Description: ID of the cache storage account

Description: Name of the cache storage account

Description: List of discovered servers from Azure Migrate (filtered: index, machine_name, ip_addresses, operating_system, boot_type, os_disk_id)

Description: Total number of discovered servers with discovery data

Description: Raw API response for discovered servers (for debugging)

Description: Azure region where resources are deployed

Description: Machine ID being replicated

Description: The resource ID of the Azure Migrate project (created or existing)

Description: Detailed response from the migration operation including async operation URL for job tracking

Description: Details of the protected item being migrated (before migration)

Description: Status of the migration (planned failover) operation

Description: Validation warnings or issues detected before migration

Description: Current operation mode

Description: Azure Migrate project name

Description: Complete protected item details including replication status, health, and configuration

Description: Custom properties including fabric-specific details, disk configuration, and network settings

Description: Details of the protected item before removal (for validation)

Description: List of health errors for the protected item

Description: ID of the protected item (replicated VM)

Description: Name of the protected item

Description: Summary of protected item with key information

Description: Protected items grouped by replication health

Description: Protected items grouped by protection state

Description: Total number of protected items found

Description: Complete list of all protected items (replicated VMs) in the vault

Description: Summary list with key information for each protected item

Description: List of protected items that have health errors

Description: Response headers from the removal operation (includes Azure-AsyncOperation and Location for job tracking)

Description: Status of the replication removal operation

Description: ID of the replication extension

Description: Name of the replication extension

Description: List of all available replication fabrics in the resource group (useful for troubleshooting appliance discovery)

Description: Detailed information for a specific replication job

Description: Summary of all replication jobs in the vault

Description: Total number of replication jobs in the vault

Description: ID of the replication policy

Description: Current replication state

Description: ID of the replication vault

Description: Managed identity of the replication vault

Description: Name of the resource group

Description: Details of the auto-discovered source fabric (when using appliance name)

Description: Source fabric ID used for replication (auto-discovered from appliance name or explicitly provided)

Description: Details of the auto-discovered target fabric (when using appliance name)

Description: Target fabric ID used for replication (auto-discovered from appliance name or explicitly provided)

Description: Name of the target VM to be created

Description: Total number of machines (including those without discovery data)

Description: Replication vault ID used for job queries

Modules

No modules.

Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

About

Terraform Azure Verified Pattern Module for Azure Local Azure Migrate Project

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5