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

Changing network/subnet properties does not update deployment #10

Closed
ocervell opened this issue Sep 17, 2018 · 3 comments
Closed

Changing network/subnet properties does not update deployment #10

ocervell opened this issue Sep 17, 2018 · 3 comments

Comments

@ocervell
Copy link
Contributor

ocervell commented Sep 17, 2018

Steps to reproduce:

module "vpc-network" {
  source       = "github.com/terraform-google-modules/terraform-google-network"
  project_id   = "${module.vpc-host.project_id}"
  network_name = "tf-training-network"

  subnets = [
    {
      subnet_name   = "gke-prod"
      subnet_ip     = "10.0.0.0/17"
      subnet_region = "us-east1"
    },
    {
      subnet_name   = "gke-dev"
      subnet_ip     = "10.1.0.0/17"
      subnet_region = "us-east1"
    }
  ]

  secondary_ranges = {
    gke-prod = []
    gke-dev = []
  }
}

Add subnet_flow_logs = true to one of the subnets and get no new changes when running terraform apply. Same for other additional flags passed to any subnet.

Update: This is the same when adding shared_vpc_host = true (meaning we can't currently convert a vpc to a shared vpc)

@ocervell ocervell changed the title Changing subnets property does not update anything Changing network/subnet properties does not update deployment Sep 17, 2018
@andreyk-code
Copy link
Contributor

Unable to reproduce. Try using a string for shared_vpc_host and a boolean for subnet_flow_logs.

$ terraform apply
google_compute_network.network: Refreshing state... (ID: tf-training-network)
google_compute_network.network: Refreshing state... (ID: test-vpc-module)
google_compute_subnetwork.subnetwork[0]: Refreshing state... (ID: us-east1/gke-prod)
google_compute_subnetwork.subnetwork[1]: Refreshing state... (ID: us-east1/gke-dev)
google_compute_subnetwork.subnetwork[1]: Refreshing state... (ID: us-west1/subnet-02)
google_compute_subnetwork.subnetwork[0]: Refreshing state... (ID: us-west1/subnet-01)

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  + module.test-vpc-module.google_compute_shared_vpc_host_project.shared_vpc_host
      id:               <computed>
      project:          "ref-gke-shared-svc"

  ~ module.vpc-network.google_compute_subnetwork.subnetwork[0]
      enable_flow_logs: "false" => "true"

Plan: 1 to add, 1 to change, 0 to destroy.

@morgante
Copy link
Contributor

@andreyk-code Maybe we should standardize on using string variables? (ie "true" for subnet_flow_logs)

@morgante
Copy link
Contributor

#9 to track that standardization.

Closing this as @andreyk-code and I cannot reproduce. @ocervell reopen if you have reproduction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants