Terraform-provider-google: Creating new projects with auto_create_network = false fails due to default firewall rules

Created on 24 Oct 2019  ·  8Comments  ·  Source: hashicorp/terraform-provider-google


Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
  • If an issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to "hashibot", a community member has claimed the issue already.

Terraform Version

$ terraform -v
Terraform v0.12.12
+ provider.google v2.18.0

Affected Resource(s)

  • google_project

Terraform Configuration Files

resource "google_project" "su-cloud" {
  name                = "${var.gcloud-project}"
  project_id          = var.gcloud-project
  folder_id           = var.suqld-org-cloud-hosting-folder # Cloud Hosting fodler ID
  billing_account     = var.billing_account
  auto_create_network = false
}

Debug Output

Error: Error deleting default network in project su-cloud-test2: Error waiting for Deleting Network: The network resource 'projects/su-cloud-test2/global/networks/default' is already being used by 'projects/su-cloud-test2/global/firewalls/default-allow-internal'


  on project-metadata.tf line 1, in resource "google_project" "su-cloud":
   1: resource "google_project" "su-cloud" {

Expected Behavior

Create a project, after the initial network creation completed, it would remove the auto created networks so we could create our custom VPCs

Actual Behavior

Project is created, but removal of auto created networks fail due to a default firewall being present.

Error waiting for Deleting Network: The network resource 'projects/su-cloud-test2/global/networks/default' is already being used by 'projects/su-cloud-test2/global/firewalls/default-allow-internal'

Steps to Reproduce

  1. terraform apply
bug

Most helpful comment

Yep!

All 8 comments

@timwsuqld
We are also having this issue
In the meantime, you can choose the provider to work with as a workaround

I just run into this issue today.

as @cr-amnonbenzion suggested a temporary workaround is to

provider "google" {
  version = "~> 2.17.0"
}

Ran into this while glancing through tests, I think I've got a fix. In the meantime, downgrading your provider version is the best solution.

This should get released in a patch tomorrow.

@rileykarson Thanks. So would that be a provider version bump to 2.18.1 then?

Yep!

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings