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

Adding private endpoint to AstraDB in GCP #416

Open
mandar-s95 opened this issue Dec 4, 2024 · 0 comments
Open

Adding private endpoint to AstraDB in GCP #416

mandar-s95 opened this issue Dec 4, 2024 · 0 comments

Comments

@mandar-s95
Copy link

The astra tf module documentation for PL endpoint for GCP, has the following :

# The endpoint ID (PSC Connection ID) is not currently accessible from the google_compute_forwarding_rule terraform object.
# It must be retrieved via the GCP UI (https://console.cloud.google.com/net-services/psc/list) or via the gcloud CLI:
#    gcloud compute forwarding-rules describe psc-endpoint --region=us-east1

However, I think now you can do the above natively via TF:

resource "google_compute_forwarding_rule" "endpoint" {
  name                  = "psc-endpoint-${formatdate("YYYYMMDDhhmmss", timestamp())}"
  target                = "https://www.googleapis.com/compute/v1/${astra_private_link.main.service_name}"
  project               = var.project_id
  ip_address            = google_compute_address.endpoint.id
  network               = google_compute_network.main.id
  region                = local.region
  load_balancing_scheme = ""
  lifecycle {
    ignore_changes = [name]
  }
}
data "google_compute_forwarding_rule" "endpoint_data" {
  name    = google_compute_forwarding_rule.endpoint.name
  project = var.project_id
  region  = local.region
}

resource "astra_private_link_endpoint" "endpoint" {
  database_id   = local.database_id
  datacenter_id = local.datacenter_id
  endpoint_id   = data.google_compute_forwarding_rule.endpoint_data.psc_connection_id 
}
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

1 participant