无法释放 Serverless ipv4,因为某些地址预留正在使用

问题描述 投票:0回答:1

有一段时间我尝试使用

terraform destroy
销毁 GCP 项目。几乎所有东西都被毁了,但我有一些错误说我无法删除

module.transformers.google_service_networking_connection.private_vpc_connection: Destroying... [id=projects%2F{PROJECT}%2Fglobal%2Fnetworks%2Fprivate-network:servicenetworking.googleapis.com]
module.transformers.google_compute_subnetwork.direct_vpc_access_cloud_run: Destroying... [id=projects/{PROJECT}/regions/europe-west1/subnetworks/direct-vpc-access-cr]
module.transformers.google_service_networking_connection.private_vpc_connection: Still destroying... [id=projects%2F{PROJECT}...twork:servicenetworking.googleapis.com, 10s elapsed]
module.transformers.google_service_networking_connection.private_vpc_connection: Still destroying... [id=projects%2F{PROJECT}...twork:servicenetworking.googleapis.com, 20s elapsed]
╷
│ Error: Error when reading or editing Subnetwork: googleapi: Error 400: The subnetwork resource 'projects/{PROJECT}/regions/europe-west1/subnetworks/direct-vpc-access-cr' is already being used by 'projects/{PROJECT}/regions/europe-west1/addresses/serverless-ipv4-{IPV4_ID}', resourceInUseByAnotherResource
│ 
│ 
╵
╷
│ Error: Unable to remove Service Networking Connection, err: Error waiting for Delete Service Networking Connection: Error code 9, message: Failed to delete connection; Producer services (e.g. CloudSQL, Cloud Memstore, etc.) are still using this connection.
│ Help Token: XXXXX
│ 
│ 
╵

我设法在 GCP Console 中手动删除

module.transformers.google_service_networking_connection.private_vpc_connection
,但此 TF 错误仍然存在。

尝试在 GCP Console 中手动删除 IPv4 地址时,出现此错误:

Failed to release serverless-ipv4-{IPV4_ID}: The address resource 'projects/{PROJECT_ID}/locations/europe-west1/addresses/serverless-ipv4-{IPV4_ID}' is already being used by '//serverless.googleapis.com/projects/{PROJECT_ID}/locations/europe-west1/addressReservations/serverless-ipv4-{IPV4_ID}'

基本上是说带有

IPV4_ID
的IPv4不能被删除,因为有一些“保留”在使用它。但我在 GCP Cloud Console 中找不到任何“预订”。 我还尝试禁用 Cloud Run API 和服务网络 API,但仍然无法删除此 IP 并完全删除我的项目。

知道如何删除此 IPv4 地址吗?谢谢你。

google-cloud-platform networking vpc
1个回答
0
投票

终于找到解决方法了。

我查看了 IP 地址,发现这可能不是来自 Cloud Run。这是不同的子网。项目中只有一项服务连接到 VPC,它是 Cloud SQL。我使用服务网络连接将 SQL 实例与私有 IP 连接。这会自动创建用于此连接的 VPC 内部 IP 地址。不知何故,在您删除 SQL 实例甚至禁用服务网络 API 后,IP 和“预留”仍然存在于项目中,阻止删除子网和 VPC。

我禁用了 Cloud SQL API 并等待了几分钟。然后再次尝试手动删除 IP 地址。 现在它可以正常工作,没有任何错误。

我仍然不知道如何删除这个“预订”或在哪里找到它。以某种方式禁用整个 Cloud SQL API 将其删除。

希望它对某人有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.