Skip to content

Commit

Permalink
Merge pull request #929 from DFE-Digital/tf-statuscake-tls-monitor
Browse files Browse the repository at this point in the history
Deploy StatusCake SSL Checks for public endpoints
  • Loading branch information
DrizzlyOwl authored Oct 19, 2023
2 parents 8aa1963 + 02e400d commit 71c17dc
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 6 deletions.
37 changes: 36 additions & 1 deletion terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ If everything looks good, answer `yes` and wait for the new infrastructure to be
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.6.1 |
| <a name="requirement_azapi"></a> [azapi](#requirement\_azapi) | >= 1.6.0 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | >= 3.76.0 |
| <a name="requirement_statuscake"></a> [statuscake](#requirement\_statuscake) | >= 2.1.0 |

## Providers

Expand All @@ -138,6 +138,7 @@ No providers.
|------|--------|---------|
| <a name="module_azure_container_apps_hosting"></a> [azure\_container\_apps\_hosting](#module\_azure\_container\_apps\_hosting) | github.com/DFE-Digital/terraform-azurerm-container-apps-hosting | v1.1.0 |
| <a name="module_azurerm_key_vault"></a> [azurerm\_key\_vault](#module\_azurerm\_key\_vault) | github.com/DFE-Digital/terraform-azurerm-key-vault-tfvars | v0.2.2 |
| <a name="module_statuscake-tls-monitor"></a> [statuscake-tls-monitor](#module\_statuscake-tls-monitor) | github.com/dfe-digital/terraform-statuscake-tls-monitor | v0.1.2 |

## Resources

Expand Down Expand Up @@ -183,6 +184,11 @@ No resources.
| <a name="input_monitor_email_receivers"></a> [monitor\_email\_receivers](#input\_monitor\_email\_receivers) | A list of email addresses that should be notified by monitoring alerts | `list(string)` | n/a | yes |
| <a name="input_monitor_endpoint_healthcheck"></a> [monitor\_endpoint\_healthcheck](#input\_monitor\_endpoint\_healthcheck) | Specify a route that should be monitored for a 200 OK status | `string` | n/a | yes |
| <a name="input_project_name"></a> [project\_name](#input\_project\_name) | Project name. Will be used along with `environment` as a prefix for all resources. | `string` | n/a | yes |
| <a name="input_statuscake_api_token"></a> [statuscake\_api\_token](#input\_statuscake\_api\_token) | API token for StatusCake | `string` | `"00000000000000000000000000000"` | no |
| <a name="input_statuscake_contact_group_email_addresses"></a> [statuscake\_contact\_group\_email\_addresses](#input\_statuscake\_contact\_group\_email\_addresses) | List of email address that should receive notifications from StatusCake | `list(string)` | `[]` | no |
| <a name="input_statuscake_contact_group_integrations"></a> [statuscake\_contact\_group\_integrations](#input\_statuscake\_contact\_group\_integrations) | List of Integration IDs to connect to your Contact Group | `list(string)` | `[]` | no |
| <a name="input_statuscake_contact_group_name"></a> [statuscake\_contact\_group\_name](#input\_statuscake\_contact\_group\_name) | Name of the contact group in StatusCake | `string` | `""` | no |
| <a name="input_statuscake_monitored_resource_addresses"></a> [statuscake\_monitored\_resource\_addresses](#input\_statuscake\_monitored\_resource\_addresses) | The URLs to perform TLS checks on | `list(string)` | `[]` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Tags to be applied to all resources | `map(string)` | n/a | yes |
| <a name="input_tfvars_filename"></a> [tfvars\_filename](#input\_tfvars\_filename) | tfvars filename. This file is uploaded and stored encrupted within Key Vault, to ensure that the latest tfvars are stored in a shared place. | `string` | n/a | yes |
| <a name="input_virtual_network_address_space"></a> [virtual\_network\_address\_space](#input\_virtual\_network\_address\_space) | Virtual network address space CIDR | `string` | n/a | yes |
Expand Down
4 changes: 4 additions & 0 deletions terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ locals {
existing_logic_app_workflow = var.existing_logic_app_workflow
existing_network_watcher_name = var.existing_network_watcher_name
existing_network_watcher_resource_group_name = var.existing_network_watcher_resource_group_name
statuscake_monitored_resource_addresses = var.statuscake_monitored_resource_addresses
statuscake_contact_group_name = var.statuscake_contact_group_name
statuscake_contact_group_integrations = var.statuscake_contact_group_integrations
statuscake_contact_group_email_addresses = var.statuscake_contact_group_email_addresses
}
4 changes: 3 additions & 1 deletion terraform/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ provider "azurerm" {
skip_provider_registration = true
}

provider "azapi" {}
provider "statuscake" {
api_token = var.statuscake_api_token
}
11 changes: 11 additions & 0 deletions terraform/statuscake-tls-monitor.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module "statuscake-tls-monitor" {
source = "github.com/dfe-digital/terraform-statuscake-tls-monitor?ref=v0.1.2"

statuscake_monitored_resource_addresses = local.statuscake_monitored_resource_addresses
statuscake_alert_at = [ # days to alert on
14, 7, 3
]
statuscake_contact_group_name = local.statuscake_contact_group_name
statuscake_contact_group_integrations = local.statuscake_contact_group_integrations
statuscake_contact_group_email_addresses = local.statuscake_contact_group_email_addresses
}
31 changes: 31 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,34 @@ variable "dns_txt_records" {
})
)
}

variable "statuscake_api_token" {
description = "API token for StatusCake"
type = string
sensitive = true
default = "00000000000000000000000000000"
}

variable "statuscake_contact_group_name" {
description = "Name of the contact group in StatusCake"
type = string
default = ""
}

variable "statuscake_contact_group_integrations" {
description = "List of Integration IDs to connect to your Contact Group"
type = list(string)
default = []
}

variable "statuscake_monitored_resource_addresses" {
description = "The URLs to perform TLS checks on"
type = list(string)
default = []
}

variable "statuscake_contact_group_email_addresses" {
description = "List of email address that should receive notifications from StatusCake"
type = list(string)
default = []
}
6 changes: 3 additions & 3 deletions terraform/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ terraform {
source = "hashicorp/azurerm"
version = ">= 3.76.0"
}
azapi = {
source = "Azure/azapi"
version = ">= 1.6.0"
statuscake = {
source = "StatusCakeDev/statuscake"
version = ">= 2.1.0"
}
}
}

0 comments on commit 71c17dc

Please sign in to comment.