Resources don't seem to show up in Terraform state after import I'm in the middle of importing a bunch of AWS resources into Terraform by doing the following:

put a stub resource into a .tf file
terraform import the resource (using the same address)
copy the relevant config out of the output of terraform show -no-color into a new .tf file

This has worked before, but now I'm doing a bunch of security groups and it doesn't seem to be working. I'll do an import:
terraform import aws_security_group.rds-launch-wizard-2 sg-XXXXXXXX

This succeeds. I would expect aws_security_group.rds-launch-wizard-2 to show up in the output of terraform state list or terraform show, but it doesn't. I feel like maybe I'm missing something easy? Thanks for any help.
I figured it out. The stub resource has to have a provider that is configured with the proper AWS region. All these security groups were in us-west-2. You need this:
resource &quot;aws_security_group&quot; &quot;rds-launch-wizard-2&quot; { provider = aws.us_west_2 }

instead of this:
resource &quot;aws_security_group&quot; &quot;rds-launch-wizard-2&quot; {}

This assumes you have a provider already configured thus:
provider &quot;aws&quot; {
  region  = &quot;us-west-2&quot;
  alias   = &quot;us_west_2&quot;
}