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

Replicas ip_configuration - enable_private_path_for_google_cloud_services for replicas #468

Closed
amais33 opened this issue May 5, 2023 · 1 comment
Labels
enhancement New feature or request Stale

Comments

@amais33
Copy link

amais33 commented May 5, 2023

TL;DR

The parameter "enable_private_path_for_google_cloud_services" under " ip_configuration" for replicas is not enabled in google module. Hence we are unable to enable it from terraform. When we enable it from console, terraform is overwriting the value to null. This parameter is available in terraform resource, but not available in the google module. When we try to add this parameter in lifecycle ignore changes, it is not accepting. Error is "The block type name "lifecycle" is reserved for use by Terraform in a future version".
This should be the same work as #442

Terraform Resources

resource "google_sql_database_instance" "instance" {
  provider = google-beta

  name             = "private-instance-${random_id.db_name_suffix.hex}"
  region           = "us-central1"
  database_version = "POSTGRES_14"

  depends_on = [google_service_networking_connection.private_vpc_connection]

  settings {
    tier = "db-f1-micro"
    ip_configuration {
      ipv4_enabled                                  = false
      private_network                               = google_compute_network.private_network.id
    }
  }

  read_replicas = [
      name                  = "private-instance-${random_id.db_name_suffix.hex}-replica",
      tier                  = "db-f1-micro"
      availability_type     = "ZONAL"
      zone                  = "us-central1"
      disk_type             = "PD_SSD",
      disk_autoresize       = true,
      disk_autoresize_limit = 0,
      disk_size             = 10,
      ip_configuration = {
        ipv4_enabled        = false
        private_network     = google_compute_network.private_network.id
        enable_private_path_for_google_cloud_services = true
      },
      encryption_key_name = null
  ]
}

Detailed design

Terraform plan when private path enabled from console

 ~ resource "google_sql_database_instance" "replicas" {
        id                             = "mydb-replica"
        name                           = "mydb-replica"
        # (15 unchanged attributes hidden)

      ~ settings {
            # (12 unchanged attributes hidden)

          ~ ip_configuration {
              - enable_private_path_for_google_cloud_services = true -> null
                # (3 unchanged attributes hidden)
            }

            # (16 unchanged blocks hidden)
        }

        # (2 unchanged blocks hidden)
    }

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

Additional information

No response

@github-actions
Copy link

github-actions bot commented Jul 4, 2023

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Jul 4, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale
Projects
None yet
Development

No branches or pull requests

1 participant