Skip to content

Commit

Permalink
feat(google_monitoring): add module
Browse files Browse the repository at this point in the history
  • Loading branch information
ahoneiser committed Jun 28, 2024
1 parent d2bf496 commit 2461147
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
33 changes: 33 additions & 0 deletions google_monitoring/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
| <a name="requirement_google"></a> [google](#requirement\_google) | >= 4.0.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_google"></a> [google](#provider\_google) | >= 4.0.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [google_monitoring_uptime_check_config.https](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/monitoring_uptime_check_config) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | n/a | `string` | n/a | yes |
| <a name="input_uptime_checks"></a> [uptime\_checks](#input\_uptime\_checks) | n/a | <pre>list(object({<br> name = string<br> host = string<br> path = string<br> timeout = optional(string, "60s")<br> }))</pre> | `[]` | no |

## Outputs

No outputs.
22 changes: 22 additions & 0 deletions google_monitoring/uptime_checks.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
resource "google_monitoring_uptime_check_config" "https" {
for_each = { for uptime_check in var.uptime_checks : uptime_check.name => uptime_check }

display_name = each.value.name
timeout = each.value.timeout

http_check {
path = each.value.path
port = 443
use_ssl = true
validate_ssl = true
}

monitored_resource {
type = "uptime_url"

labels = {
project_id = var.project_id
host = each.value.host
}
}
}
14 changes: 14 additions & 0 deletions google_monitoring/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
variable "project_id" {
type = string
}

variable "uptime_checks" {
type = list(object({
name = string
host = string
path = string
timeout = optional(string, "60s")
}))

default = []
}
11 changes: 11 additions & 0 deletions google_monitoring/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
terraform {
required_version = ">= 1.3.0"

required_providers {

google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
}
}

0 comments on commit 2461147

Please sign in to comment.