Aws Terraform Backup Restore

Hey all so we’ve been working with Modules :
module “ec2” {

location to get the terraform module from

appname = var.appname
security_groups = module.EC2_SG.sg_id
bu = var.bu
env = var.env
type = var.type
ami =
ec2_type = var.ec2_type
subnets = var.subnets
key_name = var.key_name
server_name = var.server_name
server_count = var.server_count
seq_start = var.seq_start

The Deploys have been working fine. Recently two of the servers were recovered via The Aws Backup service. Restore worked great but getting the Terraform Plan to not need to Recreate the Servers is being a problem. Currently its wanting to Recreate the Ec2s because of the below. Wondering how to get around this so we can get a clean state.

ebs_optimized = true -> null # forces replacement
key_name = “ServiceDefault” # forces replacement

I think your best bet is to delete the two recovered machines from the state, and then import them again.

But make sure you have a backup copy of your statefile in case things go wrong.