Hi Glenn Horton,
Welcome to Microsoft Q&A Forum, thank you for posting your query here!
You can achieve this by using the below functionality
Terraform does not have a dedicated resource type like azurerm_site_recovery_failover
for initiating a failover in Azure Site Recovery (ASR). However, you can still achieve this functionality within your Terraform workflow by using a null resource combined with an Azure PowerShell script, this will work.
PowerShell script reference below link:
https://docs.azure.cn/en-us/site-recovery/azure-to-azure-powershell#fail-over-to-azure
Terraform Code by using a null resource
resource "null_resource" "run_powershell_script" {
provisioner "local-exec" {
command = "powershell.exe -ExecutionPolicy Bypass -File ./script.ps1"
}
}
Feel free to reach out if you have any further questions or need additional information—I’m happy to assist!
Please provide your valuable comments
Please do not forget to "Accept the answer” and “upvote it” wherever the information provided helps you, this can be beneficial to other community members.it would be greatly appreciated and helpful to others.