Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_site_recovery_replication_recovery_plan does not keep order of pre/post_actions #21963

Closed
1 task done
viewegchris opened this issue May 30, 2023 · 3 comments · Fixed by #22019
Closed
1 task done

Comments

@viewegchris
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.4.6

AzureRM Provider Version

3.58.0

Affected Resource(s)/Data Source(s)

azurerm_site_recovery_replication_recovery_plan

Terraform Configuration Files

resource "azurerm_site_recovery_replication_recovery_plan" "example" {
  name                      = "recover-plan-example"
  recovery_vault_id         = data.azurerm_recovery_services_vault.asr-vault.id
  source_recovery_fabric_id = data.azurerm_site_recovery_fabric.source_asr-recovery-fabric.id
  target_recovery_fabric_id = data.azurerm_site_recovery_fabric.target_asr-recovery-fabric.id

  recovery_group {
    type                       = "Shutdown"
    replicated_protected_items = [module.exaample_vm.site_recovery_replicated_vm_id]

    pre_action {
      name            = "01-pre-action"
      type            = "AutomationRunbookActionDetails"
      fabric_location = "Primary"

      fail_over_directions = [
        "PrimaryToRecovery", "RecoveryToPrimary"
      ]
      fail_over_types = [
        "TestFailover", "PlannedFailover", "UnplannedFailover"
      ]
      runbook_id = module.dr-runbooks.automation-runbook-01-pre-action
    }

    pre_action {
      name            = "02-stop-applications"
      type            = "AutomationRunbookActionDetails"
      fabric_location = "Primary"

      fail_over_directions = [
        "PrimaryToRecovery", "RecoveryToPrimary"
      ]
      fail_over_types = [
        "TestFailover", "PlannedFailover", "UnplannedFailover"
      ]
      runbook_id = module.dr-runbooks.automation-runbook-02-stop-apps-id
    }

    pre_action {
      name            = "03-approval-gate"
      type            = "ManualActionDetails"
      fabric_location = "Primary"

      fail_over_directions = [
        "PrimaryToRecovery", "RecoveryToPrimary"
      ]
      fail_over_types = [
        "TestFailover", "PlannedFailover", "UnplannedFailover"
      ]
      manual_action_instruction = "Please check if all scrips run successfully"
    }

    recovery_group {
      type = "Failover"
    }
    recovery_group {
      type = "Boot"
    }
    azure_to_azure_settings{
      primary_zone = local.source_zone
      recovery_zone = local.target_zone
    }
  }
}

Debug Output/Panic Output

2023-05-30T09:16:57.923Z [INFO]  Starting apply for azurerm_site_recovery_replication_recovery_plan.test-azure-rm
2023-05-30T09:16:57.929Z [DEBUG] azurerm_site_recovery_replication_recovery_plan.test-azure-rm: applying the planned Create change
2023-05-30T09:16:57.963Z [DEBUG] provider.terraform-provider-azurerm_v3.58.0_x5: AzureRM Request:
GET /subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationRecoveryPlans/recover-plan-azurerm?api-version=2022-10-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.19.3 (amd64-linux) go-autorest/v14.2.1 hashicorp/go-azure-sdk/replicationrecoveryplans/2022-10-01 HashiCorp Terraform/1.3.7 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev
Content-Type: application/json; charset=utf-8
X-Ms-Correlation-Request-Id: 71705386-0a34-c840-0328-92df8d24db91
Accept-Encoding: gzip: timestamp=2023-05-30T09:16:57.963Z
2023-05-30T09:16:58.128Z [DEBUG] provider.terraform-provider-azurerm_v3.58.0_x5: AzureRM Response for https://management.azure.com/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationRecoveryPlans/recover-plan-azurerm?api-version=2022-10-01:
HTTP/2.0 404 Not Found
Content-Length: 464
Cache-Control: no-cache
Content-Type: application/json
Date: Tue, 30 May 2023 09:16:58 GMT
Expires: -1
Pragma: no-cache
Server: Kestrel
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Ms-Client-Request-Id: 75381441-f97c-479c-9efa-034d5102dedc
X-Ms-Correlation-Request-Id: 71705386-0a34-c840-0328-92df8d24db91
X-Ms-Ratelimit-Remaining-Subscription-Reads: 11926
X-Ms-Request-Id: 75381441-f97c-479c-9efa-034d5102dedc 5/30/2023 9:16:58 AM
X-Ms-Routing-Request-Id: SWITZERLANDWEST:20230530T091658Z:2a9da933-9ba0-41b9-b730-2b4f0434994a

{"error":{"code":"NotFound","message":"Specified resource with name 'recover-plan-azurerm' does not exist.","details":[{"code":"ArmResourceDoesNotExist","message":"Specified resource with name 'recover-plan-azurerm' does not exist.","possibleCauses":"Ensure correct resource name was specified.","recommendedAction":"Verify ARM resource name details.","clientRequestId":"75381441-f97c-479c-9efa-034d5102dedc","activityId":"71705386-0a34-c840-0328-92df8d24db91"}]}}: timestamp=2023-05-30T09:16:58.128Z
2023-05-30T09:16:58.130Z [DEBUG] provider.terraform-provider-azurerm_v3.58.0_x5: AzureRM Request:
PUT /subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationRecoveryPlans/recover-plan-azurerm?api-version=2022-10-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.19.3 (amd64-linux) go-autorest/v14.2.1 hashicorp/go-azure-sdk/replicationrecoveryplans/2022-10-01 HashiCorp Terraform/1.3.7 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev
Content-Length: 4631
Content-Type: application/json; charset=utf-8
X-Ms-Correlation-Request-Id: 71705386-0a34-c840-0328-92df8d24db91
Accept-Encoding: gzip

{"properties":{"failoverDeploymentModel":"ResourceManager","groups":[{"endGroupActions":[],"groupType":"Failover","replicationProtectedItems":[],"startGroupActions":[]},{"endGroupActions":[],"groupType":"Shutdown","replicationProtectedItems":[{"id":"/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationFabrics/primary-fabric/replicationProtectionContainers/primary-protection-container/replicationProtectedItems/zachadevtestpr01005"}],"startGroupActions":[{"actionName":"04-approval-gate","customDetails":{"description":"Please check if all scrips run successfully","instanceType":"ManualActionDetails"},"failoverDirections":["PrimaryToRecovery","RecoveryToPrimary"],"failoverTypes":["UnplannedFailover","TestFailover","PlannedFailover"]},{"actionName":"01-free-up-crg-at-failover","customDetails":{"fabricLocation":"Primary","instanceType":"AutomationRunbookActionDetails","runbookId":"/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.Automation/automationAccounts/zacha9999pr01ns1asr01/runbooks/Free-Up-CRG"},"failoverDirections":["PrimaryToRecovery","RecoveryToPrimary"],"failoverTypes":["UnplannedFailover","TestFailover","PlannedFailover"]},{"actionName":"02-stop-applications","customDetails":{"fabricLocation":"Primary","instanceType":"AutomationRunbookActionDetails","runbookId":"/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.Automation/automationAccounts/zacha9999pr01ns1asr01/runbooks/Stop-Applications"},"failoverDirections":["PrimaryToRecovery","RecoveryToPrimary"],"failoverTypes":["UnplannedFailover","TestFailover","PlannedFailover"]},{"actionName":"03-stop-dbs","customDetails":{"fabricLocation":"Primary","instanceType":"AutomationRunbookActionDetails","runbookId":"/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.Automation/automationAccounts/zacha9999pr01ns1asr01/runbooks/Stop-Databases"},"failoverDirections":["PrimaryToRecovery","RecoveryToPrimary"],"failoverTypes":["UnplannedFailover","TestFailover","PlannedFailover"]}]},{"endGroupActions":[{"actionName":"02-restart-preprod-at-failback","customDetails":{"fabricLocation":"Primary","instanceType":"AutomationRunbookActionDetails","runbookId":"/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.Automation/automationAccounts/zacha9999pr01ns1asr01/runbooks/Failback-PreProd-Restart"},"failoverDirections":["PrimaryToRecovery","RecoveryToPrimary"],"failoverTypes":["UnplannedFailover","TestFailover","PlannedFailover"]},{"actionName":"01-db-health-check","customDetails":{"fabricLocation":"Primary","instanceType":"AutomationRunbookActionDetails","runbookId":"/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.Automation/automationAccounts/zacha9999pr01ns1asr01/runbooks/DB-Health-Check"},"failoverDirections":["PrimaryToRecovery","RecoveryToPrimary"],"failoverTypes":["UnplannedFailover","TestFailover","PlannedFailover"]},{"actionName":"03-commit-recovery-plan","customDetails":{"fabricLocation":"Primary","instanceType":"AutomationRunbookActionDetails","runbookId":"/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.Automation/automationAccounts/zacha9999pr01ns1asr01/runbooks/commit-and-re-protect"},"failoverDirections":["PrimaryToRecovery","RecoveryToPrimary"],"failoverTypes":["UnplannedFailover","TestFailover","PlannedFailover"]}],"groupType":"Boot","replicationProtectedItems":[{"id":"/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationFabrics/primary-fabric/replicationProtectionContainers/primary-protection-container/replicationProtectedItems/zachadevtestpr01005"}],"startGroupActions":[]}],"primaryFabricId":"/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationFabrics/primary-fabric","providerSpecificInput":[{"instanceType":"A2A","primaryZone":"1","recoveryZone":"2"}],"recoveryFabricId":"/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationFabrics/primary-fabric"}}: timestamp=2023-05-30T09:16:58.129Z
2023-05-30T09:16:58.656Z [DEBUG] provider.terraform-provider-azurerm_v3.58.0_x5: AzureRM Response for https://management.azure.com/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationRecoveryPlans/recover-plan-azurerm?api-version=2022-10-01:
HTTP/2.0 202 Accepted
Content-Length: 0
Azure-Asyncoperation: https://management.azure.com/Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationOperationStatus/3915b5ce-0aba-40cf-bdd0-8fb55c338ef1?api-version=2022-10-01
Cache-Control: no-cache
Date: Tue, 30 May 2023 09:16:58 GMT
Expires: -1
Location: https://management.azure.com/Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationRecoveryPlans/recover-plan-azurerm/operationresults/3915b5ce-0aba-40cf-bdd0-8fb55c338ef1?api-version=2022-10-01
Pragma: no-cache
Retry-After: 30
Server: Kestrel
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Ms-Client-Request-Id: 5f4b556a-2b86-4321-8283-752151bc373a
X-Ms-Correlation-Request-Id: 71705386-0a34-c840-0328-92df8d24db91
X-Ms-Ratelimit-Remaining-Subscription-Writes: 1199
X-Ms-Request-Id: /Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationJobs/3915b5ce-0aba-40cf-bdd0-8fb55c338ef1
X-Ms-Request-Id: /Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationJobs/3915b5ce-0aba-40cf-bdd0-8fb55c338ef1
X-Ms-Routing-Request-Id: SWITZERLANDWEST:20230530T091658Z:ee10d732-817c-4091-ad85-0f01c71a8f39: timestamp=2023-05-30T09:16:58.656Z
2023-05-30T09:17:28.676Z [DEBUG] provider.terraform-provider-azurerm_v3.58.0_x5: AzureRM Request:
GET /Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationOperationStatus/3915b5ce-0aba-40cf-bdd0-8fb55c338ef1?api-version=2022-10-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.19.3 (amd64-linux) go-autorest/v14.2.1 hashicorp/go-azure-sdk/replicationrecoveryplans/2022-10-01 HashiCorp Terraform/1.3.7 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev
X-Ms-Correlation-Request-Id: 71705386-0a34-c840-0328-92df8d24db91
Accept-Encoding: gzip: timestamp=2023-05-30T09:17:28.675Z
2023-05-30T09:17:28.820Z [DEBUG] provider.terraform-provider-azurerm_v3.58.0_x5: AzureRM Response for https://management.azure.com/Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationOperationStatus/3915b5ce-0aba-40cf-bdd0-8fb55c338ef1?api-version=2022-10-01:
HTTP/2.0 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Tue, 30 May 2023 09:17:28 GMT
Expires: -1
Pragma: no-cache
Server: Kestrel
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Ms-Client-Request-Id: 46893706-00d4-49e0-9fd2-47aa59fcdeeb
X-Ms-Correlation-Request-Id: 71705386-0a34-c840-0328-92df8d24db91
X-Ms-Ratelimit-Remaining-Subscription-Reads: 11925
X-Ms-Request-Id: /Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationJobs/3915b5ce-0aba-40cf-bdd0-8fb55c338ef1
X-Ms-Routing-Request-Id: SWITZERLANDWEST:20230530T091728Z:1ae3c0bc-6d92-46aa-aab8-1ca5536a70d4

{"error":null,"id":null,"name":"3915b5ce-0aba-40cf-bdd0-8fb55c338ef1","properties":null,"status":"Succeeded","startTime":"2023-05-30T09:16:58.5364558Z","endTime":"2023-05-30T09:16:58.0000000Z","percentComplete":null}: timestamp=2023-05-30T09:17:28.820Z
2023-05-30T09:17:28.821Z [DEBUG] provider.terraform-provider-azurerm_v3.58.0_x5: AzureRM Request:
GET /subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationRecoveryPlans/recover-plan-azurerm?api-version=2022-10-01 HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.19.3 (amd64-linux) go-autorest/v14.2.1 hashicorp/go-azure-sdk/replicationrecoveryplans/2022-10-01 HashiCorp Terraform/1.3.7 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev
Content-Type: application/json; charset=utf-8
X-Ms-Correlation-Request-Id: 71705386-0a34-c840-0328-92df8d24db91
Accept-Encoding: gzip: timestamp=2023-05-30T09:17:28.820Z
2023-05-30T09:17:28.980Z [DEBUG] provider.terraform-provider-azurerm_v3.58.0_x5: AzureRM Response for https://management.azure.com/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationRecoveryPlans/recover-plan-azurerm?api-version=2022-10-01:
HTTP/2.0 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Tue, 30 May 2023 09:17:28 GMT
Expires: -1
Pragma: no-cache
Server: Kestrel
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Ms-Client-Request-Id: 4aecccaa-7aa9-4caf-9554-56096f6343f3
X-Ms-Correlation-Request-Id: 71705386-0a34-c840-0328-92df8d24db91
X-Ms-Ratelimit-Remaining-Subscription-Reads: 11924
X-Ms-Request-Id: 4aecccaa-7aa9-4caf-9554-56096f6343f3 5/30/2023 9:17:28 AM
X-Ms-Routing-Request-Id: SWITZERLANDWEST:20230530T091728Z:fb79a195-bb14-4a8e-a82e-14e0970ceb6b

{"id":"/Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationRecoveryPlans/recover-plan-example","name":"recover-plan-example","type":"Microsoft.RecoveryServices/vaults/replicationRecoveryPlans","properties":{"friendlyName":"recover-plan-example","primaryFabricId":"/Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationFabrics/primary-fabric","primaryFabricFriendlyName":"Switzerland North","recoveryFabricId":"/Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationFabrics/secondary-fabric","recoveryFabricFriendlyName":"Switzerland North","failoverDeploymentModel":"ResourceManager","replicationProviders":["A2A"],"allowedOperations":["UnplannedFailover","TestFailover"],"currentScenario":null,"currentScenarioStatus":null,"currentScenarioStatusDescription":null,"groups":[{"groupType":"Shutdown","replicationProtectedItems":[],"startGroupActions":[{"actionName":"03-approval-gate","failoverTypes":["PlannedFailover","UnplannedFailover","TestFailover"],"failoverDirections":["PrimaryToRecovery","RecoveryToPrimary"],"customDetails":{"instanceType":"ManualActionDetails","description":"Please check if all scrips run successfully","canWrite":false,"canRead":true}},{"actionName":"01-pre-action","failoverTypes":["PlannedFailover","UnplannedFailover","TestFailover"],"failoverDirections":["PrimaryToRecovery","RecoveryToPrimary"],"customDetails":{"instanceType":"AutomationRunbookActionDetails","runbookId":"/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.Automation/automationAccounts/zacha9999pr01ns1asr01/runbooks/01-pre-action","fabricLocation":"Primary","canWrite":false,"canRead":true}},{"actionName":"02-stop-applications","failoverTypes":["PlannedFailover","UnplannedFailover","TestFailover"],"failoverDirections":["PrimaryToRecovery","RecoveryToPrimary"],"customDetails":{"instanceType":"AutomationRunbookActionDetails","runbookId":"/subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.Automation/automationAccounts/zacha9999pr01ns1asr01/runbooks/02-stop-apps","fabricLocation":"Primary","canWrite":false,"canRead":true}}],"endGroupActions":[]},{"groupType":"Failover","replicationProtectedItems":[],"startGroupActions":[],"endGroupActions":[]},{"groupType":"Boot","replicationProtectedItems":[{"id":"/Subscriptions/94850947-9bd7-4bc1-8e99-939c3131dd42/resourceGroups/z-ach-a9999-pr01-ns1-01-asr/providers/Microsoft.RecoveryServices/vaults/zacha9999pr01ns1rsv90/replicationFabrics/primary-fabric/replicationProtectionContainers/primary-protection-container/replicationProtectedItems/zachadevtestpr01005","virtualMachineId":"c3b0d661-63c0-592b-8da9-12133dad5163"}],"startGroupActions":[],"endGroupActions":[]}],"providerSpecificDetails":[{"instanceType":"A2A","primaryZone":"1","recoveryZone":"2","primaryExtendedLocation":null,"recoveryExtendedLocation":null}]}: timestamp=2023-05-30T09:17:28.977Z
2023-05-30T09:17:28.995Z [WARN]  Provider "provider[\"registry.terraform.io/hashicorp/azurerm\"]" produced an unexpected new value for azurerm_site_recovery_replication_recovery_plan.test-azure-rm, but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations:
- .azure_to_azure_settings[0].primary_edge_zone: was null, but now cty.StringVal("")
- .azure_to_azure_settings[0].recovery_edge_zone: was null, but now cty.StringVal("")
2023-05-30T09:17:29.016Z [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-05-30T09:17:29.023Z [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/azurerm/3.58.0/linux_amd64/terraform-provider-azurerm_v3.58.0_x5 pid=129
2023-05-30T09:17:29.023Z [DEBUG] provider: plugin exited

Expected Behaviour

The order of pre and post actions is kept the same as in the Terraform Configuration file defined.

Actual Behaviour

The order of pre and post actions in recovery groups should keep the same as defined in the Terraform Configuration file. Currently it's impossible to define runtime dependencies in the steps. E.g. Manuel approval at the end of the pre steps.

I guess the problem is within the handling of site_recovery_replication_recovery_plan_resource.go, the actions will be parsed in a Map instead of an ordered list. As you can see in the debug output the object handovered on the AZ-API call, already has the wrong order.

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@viewegchris viewegchris changed the title azurerm_site_recovery_replication_recovery_plan does not keep order of pre/-post_actions azurerm_site_recovery_replication_recovery_plan does not keep order of pre/post_actions May 30, 2023
@ziyeqf
Copy link
Contributor

ziyeqf commented Jun 2, 2023

Hi @viewegchris, thanks for opening the issue.

I have submitted a PR (#22019) for it, once it merged & released it will be fixed.

For any further questions please leave comments.

@samanshariq
Copy link

can we loop through pre-actions?

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants