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

Added support for checker_type when using Service Directory for Uptime Checks #11545

Closed

Conversation

mikepietruszka
Copy link

@mikepietruszka mikepietruszka commented Apr 19, 2022

Added support for checker_type when using Service Directory as a target for Uptime Checks. This fixes issue #11537.

This can be verified with the following Terraform configuration:

# Data sources needed to setup Service Directory
data "google_project" "project" {
  provider = google-beta
  project_id = "test_project_name"
}

data "google_compute_network" "network" {
  name = "default"
  project = "test_project_name"
}

# Service Directory Endpoint that we will monitor in the Uptime Checks
resource "google_service_directory_namespace" "custom_namespace" {
  provider = google-beta
  namespace_id = "custom_namespace"
  location = "us-central1"
  project = "test_project_name"
}

resource "google_service_directory_service" "web_custom_service" {
  provider = google-beta
  service_id = "web"
  namespace  = google_service_directory_namespace. custom_namespace_namespace.id

  metadata = {
    stage  = "dev"
    region = "us-central1"
  }
}

resource "google_service_directory_endpoint" "endpoint" {
  provider = google-beta
  endpoint_id = "endpoint"
  service  = google_service_directory_service.web_custom_service.id

  metadata = {
    stage  = "dev"
    region = "us-central1"
  }

  address = "10.128.0.41"
  port    = 80
  network = "projects/${data.google_project.project.number}/locations/global/networks/${data.google_compute_network.network.name}"
}

# Private Uptime Check
resource "google_monitoring_uptime_check_config" "http" {
  display_name = "http-uptime-check"
  timeout = "60s"
  project  = "test_project_name"
  checker_type = "VPC_CHECKERS"

  http_check {
    path = "/web"
    port = "80"
    request_method = "POST"
    content_type = "URL_ENCODED"
    body = "ZmXXXXXXXXXI="
  }

  monitored_resource {
    type = "servicedirectory_service"
    labels = {
      project_id = "test_project_name"
      location = "us-central1"
      namespace_name = "custom_namespace"
      service_name = "web"
    }
  }
}

@melinath
Copy link
Collaborator

Duplicate PR - closing

@melinath melinath closed this Nov 28, 2022
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants