From 2fbe8d4d45abbc133b89e7780fa6f962a6e9f7ed Mon Sep 17 00:00:00 2001 From: Heng Lu Date: Thu, 17 Oct 2024 14:44:24 +0800 Subject: [PATCH] skip resource whose action is create or delete --- types/from_plan.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/from_plan.go b/types/from_plan.go index 47184fc3..81d72dbf 100644 --- a/types/from_plan.go +++ b/types/from_plan.go @@ -29,6 +29,10 @@ func ListResourcesFromPlan(p *tfjson.Plan) []AzureResource { if resourceChange == nil || resourceChange.Change == nil { continue } + if len(resourceChange.Change.Actions) != 0 && (resourceChange.Change.Actions[0] == tfjson.ActionCreate || resourceChange.Change.Actions[0] == tfjson.ActionDelete) { + log.Printf("[WARN] resource %s.%s's planned action is %v, which is not supported. Please apply the changes before running the migration tool", resourceChange.Type, resourceChange.Name, resourceChange.Change.Actions) + continue + } switch resourceChange.Type { case "azapi_resource":