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

Error creating google_monitoring_uptime_check_config with private Service Directory service #11537

Comments

@mikepietruszka
Copy link

mikepietruszka commented Apr 19, 2022

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 -v
Terraform v1.1.7
on darwin_amd64
+ provider registry.terraform.io/hashicorp/google v4.17.0
+ provider registry.terraform.io/hashicorp/google-beta v4.17.0

Affected Resource(s)

  • google_monitoring_uptime_check_config

Terraform Configuration Files

resource "google_monitoring_uptime_check_config" "http" {
  display_name = "http-uptime-check"
  timeout = "60s"
  project  = "test_project_name"

  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"
    }
  }
}

Debug Output

google_monitoring_uptime_check_config.http: Creating...
╷
│ Error: Error creating UptimeCheckConfig: googleapi: Error 400: Configs with Service Directry targets must use checker_type VPC_CHECKERS
│ 
│   with google_monitoring_uptime_check_config.http,
│   on main.tf line 41, in resource "google_monitoring_uptime_check_config" "http":
│   41: resource "google_monitoring_uptime_check_config" "http" {
│ 

Panic Output

Expected Behavior

Private Uptime Check should have been created with Service Directory target. This typically works using gcloud command.

Actual Behavior

Private Uptime Check fails to create because the schema in resourceMonitoringUptimeCheckConfig is missing checker_type/CheckerType property that is defined in Resource: UptimeCheckConfig object.

CheckerType states that VPC_CHECKERS should be used for uptime checks using Service Directory targets.

Steps to Reproduce

  1. Define main.tf with google_monitoring_uptime_check_config resource.
  2. Run terraform apply.

Important Factoids

References

  • #0000
@shuyama1
Copy link
Collaborator

Hi @mikepietruszka! Thanks for filing the issue. Looks like the provider does not currently have checker_type implemented. Therefore change the label of this issue from bug to enhancement.

Note: API for checkerType: https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.uptimeCheckConfigs#CheckerType

mikepietruszka pushed a commit to mikepietruszka/terraform-provider-google that referenced this issue Apr 19, 2022
@mikepietruszka
Copy link
Author

Hi @shuyama1, I have a working fixed (that's been tested) in PR #11545. I attempted to do this via Magic Modules but was having issues getting it setup on my machine.

@jrbarnard
Copy link

I created a PR in magic modules to add this field - GoogleCloudPlatform/magic-modules#5987

@github-actions
Copy link

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 have found a problem that seems similar to this, 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 Jun 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.