Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling or changing VPC Flow Logs parameters should not force the VPC subnet resource recreation #4179

Closed
lainra opened this issue Aug 7, 2019 · 2 comments
Labels

Comments

@lainra
Copy link

lainra commented Aug 7, 2019

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-providers/null 2.1.2

terraform-providers/google 2.12.0

terraform-providers/google-beta 2.12.0

Affected Resource(s)

  • google_compute_subnetwork

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://www.hashicorp.com/security
# If reproducing the bug involves modifying the config file (e.g., apply a config,
# change a value, apply the config again, see the bug) then please include both the
# version of the config before the change, and the version of the config after the change.
resource "google_compute_subnetwork" "shared_vpc_subnetwork" {
  provider                 = "google-beta"
  project                  = "redacted"
  name                     = "shared-vpc-subnetwork"
  region                   = "redacted"
  network                  = "shared-vpc-network"
  ip_cidr_range            = "redacted"
  private_ip_google_access = "true"

  dynamic "secondary_ip_range" {
    for_each = var.secondary_ip_ranges

    content {
      range_name    = secondary_ip_range.value.name
      ip_cidr_range = secondary_ip_range.value.ip_cidr_range
    }
  }

  enable_flow_logs = var.enable_flow_logs

  log_config {
    aggregation_interval = var.flow_logs_aggregation_interval
    flow_sampling        = var.flow_logs_flow_sampling
    metadata             = var.flow_logs_metadata
  }
}

Debug Output

https://gist.github.com/lainra/05dbdab45cc93892ce35c4a1ca3ecdda

Panic Output

None

Expected Behavior

Creating or editing VPC Flow Logs logs_config in the subnet should not force its re-creation.
VPC Flow Logs can be enabled, disabled, have it's log_config modified without implying the resource deletion.

Actual Behavior

When enabling VPC Flow Logs with a log_config block, the subnet becomes subject to recreation.

Steps to Reproduce

  1. Prepare a similar manifest as above, specifying the log_config block.
  2. terraform plan

Important Factoids

References

https://github.com/terraform-providers/terraform-provider-google-beta/blob/v2.12.0/google-beta/resource_compute_subnetwork.go#L108
hashicorp/terraform-provider-google-beta#619

@ghost ghost added the bug label Aug 7, 2019
@rileykarson
Copy link
Collaborator

Duplicates #3628

@ghost
Copy link

ghost commented Sep 7, 2019

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!

@ghost ghost locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants