func Update(resources []terraform.Resource, providers map[aws.ClientKey]provider.TerraformProvider) UpdatedResources {
	withUpdatedState, errs := terraform.UpdateStates(resources, providers, 10, false)
	var resourcesAlreadyDeleted []terraform.Resource
	var resourcesToDelete []terraform.Resource
	for _, r := range withUpdatedState {
		if r.State().IsNull() {
			resourcesAlreadyDeleted = append(resourcesAlreadyDeleted, r)
		} else {
			resourcesToDelete = append(resourcesToDelete, r)
		}
	}
	if len(resourcesAlreadyDeleted) != 0 {
		internal.LogTitle("the following resources don't exist")
	}
	for _, r := range resourcesAlreadyDeleted {
		log.WithFields(log.Fields{
			"id":      r.ID,
			"profile": r.Profile,
			"region":  r.Region,
		}).Info(internal.Pad(r.Type))
	}
	return UpdatedResources{resourcesToDelete, errs}
}
Update fetches the Terraform state for the given resources. A state is needed to delete resources
via the Delete() function, which calls the Terraform AWS provider for deletion.
package resource
import (
	"bufio"
	"fmt"
	"io"
	"strings"
	"github.com/apex/log"
	"github.com/jckuester/awsrm/internal"
	"github.com/jckuester/awstools-lib/aws"
	"github.com/jckuester/awstools-lib/terraform"
	"github.com/jckuester/terradozer/pkg/provider"
	terradozerRes "github.com/jckuester/terradozer/pkg/resource"
)
type UpdatedResources struct {
	Resources []terraform.Resource
	Errors    []error
}