Google cloud platform terraform导入google计算机安全策略错误读取SecurityPolicy错误读取SecurityPolicy googleapi:错误400:无效值

Google cloud platform terraform导入google计算机安全策略错误读取SecurityPolicy错误读取SecurityPolicy googleapi:错误400:无效值,google-cloud-platform,terraform,terraform-provider-gcp,Google Cloud Platform,Terraform,Terraform Provider Gcp,我正在尝试使用导入现有安全策略 terraform import google_compute_security_policy.testpolicy lunar-11111/testsecuritypolicy 我在我的地形文件中定义了: resource "google_compute_security_policy" "testpolicy" { name = "testsecuritypolicy" } 但是,这是我得到的错误: google_compute_security_po

我正在尝试使用导入现有安全策略

terraform import google_compute_security_policy.testpolicy lunar-11111/testsecuritypolicy
我在我的地形文件中定义了:

resource "google_compute_security_policy" "testpolicy" {
  name = "testsecuritypolicy"
}
但是,这是我得到的错误:

google_compute_security_policy.testpolicy: Importing from ID "lunar-111111/testsecuritypolicy"...
google_compute_security_policy.testpolicy: Import complete!
  Imported google_compute_security_policy
google_compute_security_policy.testpolicy: Refreshing state... [id=lunar-111111/testsecuritypolicy]

Error: Error reading SecurityPolicy "lunar-111111/testsecuritypolicy":
googleapi: Error 400: Invalid value 'lunar-111111/testsecuritypolicy'.
Values must match the following regular expression:
'[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}', invalidParameter
我尝试了中列出的其他导入格式,但出现了相同的错误

我能够使用terraform创建新的安全策略。 我是否缺少一些配置?任何帮助都将不胜感激

在上述命令和错误结果中更改了项目名称

terraform -version
Terraform v0.12.2
+ provider.google v2.9.0
+ provider.random v2.1.2

您可以遵循GCP文件中的政策和建议

为了理解正则表达式上的错误,我发现它可以解释有关语法和描述的详细信息