Open ilokhvytska-medrhythms opened 1 year ago
Sorry to hear you're having some issues with this. Maybe it's the id you're using (the id by itself), it should be a number?
I was able to test and import doing the following with a sample test script. I followed these instructions
relevant portion of my TF file
resource "aptible_database" "pg" {
env_id = data.aptible_environment.example.env_id
handle = "example"
database_type = "postgresql"
container_size = 512
disk_size = 10
}
i created it:
terraform plan
terraform apply
then i removed it from my local state
terraform state rm aptible_database.pg
cat terraform.tfstate
# verified it is no longer in my state file
terraform import aptible_database.pg 106610 # got the ID from the dashboard
and it worked without issue:
terraform import -input=false -var-file=environ/dev/terraform.tfvars aptible_database.coretx-psql coretx-dev-psql
Result:
I tried differend combination, like env_id/db_id, env_id:db_id, env_name/db_name, env_name:db_name.