Terraform谷歌正常运行时间检查模块-如何指定区域



我想指定一个运行正常运行时间检查的区域。我指定了参数CCD_ 1;"北美";但是得到以下错误


我的地形代码

resource "google_monitoring_uptime_check_config" "http1" {
project      = var.project_id
display_name = "Website uptime check1"
timeout = "10s"
period = "60s"
selected_regions = [var.region1]
http_check {
path = "/"
port = "80"
}
monitored_resource {
type = "uptime_url"
labels = {
project_id = var.project_id
#region     = var.region
host = "xx.xx.xx.xx"
}
}
}

错误

Step #1 - "terraform-apply": Error: Error updating UptimeCheckConfig "projects/xxxxxxxxxxxx/uptimeCheckConfigs/website-uptime-check-vh-T7eowa2Y": googleapi: Error 400: Invalid value at 'uptime_check_config.selected_regions[0]' (type.googleapis.com/google.monitoring.v3.UptimeCheckRegion), "North America"
Step #1 - "terraform-apply": Details:
Step #1 - "terraform-apply": [
Step #1 - "terraform-apply":   {
Step #1 - "terraform-apply":     "@type": "type.googleapis.com/google.rpc.BadRequest",
Step #1 - "terraform-apply":     "fieldViolations": [
Step #1 - "terraform-apply":       {
Step #1 - "terraform-apply":         "description": "Invalid value at 'uptime_check_config.selected_regions[0]' (type.googleapis.com/google.monitoring.v3.UptimeCheckRegion), "North America"",
Step #1 - "terraform-apply":         "field": "uptime_check_config.selected_regions[0]"
Step #1 - "terraform-apply":       }
Step #1 - "terraform-apply":     ]
Step #1 - "terraform-apply":   }``
Step #1 - "terraform-apply": ]
Step #1 - "terraform-apply": 

尝试输入此文档中列出的区域:

美国、欧洲、南美或亚太

GogoleCloud在北美有多个区域,(目前(为:

  • northamerica-northeast1northamerica-northeast2
  • us-east1us-east4
  • us-west1us-west2us-west3us-west4
  • selected_regions0

您必须选择并设置正确的区域名称。参见:

  • 区域和区域
  • 查看可用区域的列表

这个列表很难找到。截至2023年8月31日,它在这里:

https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.uptimeCheckConfigs#UptimeCheckRegion

  • 区域_未指定
  • 美国-欧洲
  • 南美
  • 亚洲人
  • USA_OREGON
  • USA_IOWA
  • 美国弗吉尼亚州

使用示例:

variable "list_uptime_check_regions" {
type = list
description = "List of regions from which the check will be run."
default = [ "EUROPE", "ASIA_PACIFIC", "SOUTH_AMERICA" ]
}
resource "google_monitoring_uptime_check_config" "https_incident" {
display_name = "uptime-check_test"
selected_regions = var.list_uptime_check_regions  
timeout = "60s"
...
}

相关内容

  • 没有找到相关文章

最新更新