I have a terraform script that created a resource (AWS Secret Manager), then I deleted that resource. Now I want to resurrect that resource, but Terraform cannot create it because secrets resources live for 30 days before actually being deleted, and cannot be ‘overwritten’.
I thought I could import the existing resource into the tf state file, but I can’t get it to work.
If I run a plan, I can find the resource:
# module.instance.aws_secretsmanager_secret.master_secret will be created
If I run the import I get an error:
terraform import -var-file=..env.tfvars 'module.instance.aws_secretsmanager_secret.master_secret' "/Instance/MasterConnectionString"
The import command expects two arguments.
Usage: terraform [global options] import [options] ADDR ID
I’ve also tried the ARN of the parameter store, and get the same error.