Terraform import cannot find binding

Dear all,

I have some iam roles manually defined in a gcp environment

I’m trying to import these roles using the code below (example)


iap-tunnel-user = {
  test = "user:test@abc.com"


variable "iap-tunnel-user" {
  type = map(string)


resource "google_project_iam_member" "iap-tunnel-user-role" {
  for_each = var.iap-tunnel-user
  member = each.value
  role   = "roles/iap.tunnelResourceAccessor"

The command I use to import iam role is:

terraform import -var-file=./tfvars/file.tfvars google_project_iam_member.iap-tunnel-user-role[\"test\"] "my-project-id roles/iap.tunnelResourceAccessor user:test@abc.com"

but I get the following error

Error: Cannot find binding for "project \"my-project-id\"" with role "roles/iap.tunnelResourceAccessor", member "user:test@abc.com", and condition title ""

Any ideas?