Skip to content

philips-labs/terraform-cloudfoundry-alertmanager

Repository files navigation

terraform-cloudfoundry-alertmanager

The Alertmanager will handle alerts sent by the Prometheus server. It will route the alerts to the correct receiver integration.

Supported receiver integrations

  • Microsoft Teams notifications

Example of Alertmanager Terraform

module "alertmanager" {
    source = "philips-labs/alertmanager/cloudfoundry"
    version = "0.0.1"

    cf_space_id = "test"
    teams_incoming_webhook_url = "https://teamschannel.webhook.office.com"
    alerts_source_app_id = "prometheusappid"
}

Requirements

Name Version
terraform >= 1.3.0
cloudfoundry >= 0.15.5
random >= 2.2.1

Providers

Name Version
cloudfoundry >= 0.15.5
random >= 2.2.1

Modules

No modules.

Resources

Name Type
cloudfoundry_app.alertmanager resource
cloudfoundry_app.prometheusmsteams resource
cloudfoundry_network_policy.alertmanager resource
cloudfoundry_network_policy.prometheusmsteams resource
cloudfoundry_route.alertmanager_internal resource
cloudfoundry_route.prometheusmsteams_internal resource
random_id.id resource
cloudfoundry_domain.apps_internal_domain data source

Inputs

Name Description Type Default Required
alertmanager n/a
object({
docker_image = optional(string, "prom/alertmanager:v0.23.0")
memory = optional(number, 128)
config_file = optional(string, "")
docker_username = optional(string)
docker_password = optional(string)
})
{} no
alertmanager_service_bindings A list of service instances that should be bound to the alertmanager list(object({ service_instance = string })) [] no
alerts_source_app_id Cloudfoundry app id that will send the alerts. E.g Thanos, Prometheus.. string n/a yes
cf_space_id Cloudfoundry SPACE id to use for deploying the alertmanager components. string n/a yes
environment Pass environment variable to the app map(any) {} no
name_postfix The postfix string to append to the app names, hostname, etc. Prevents namespace clashes string "" no
prometheusmsteams_docker_image The docker image to use for the Prometheus MS Teams app string "quay.io/prometheusmsteams/prometheus-msteams:latest" no
prometheusmsteams_service_bindings A list of service instances that should be bound to the prometheusmsteams list(object({ service_instance = string })) [] no
teams_incoming_webhook_url Teams incoming webhook URL string "" no

Outputs

Name Description
alertmanager_app_id App id of Alertmanager
alertmanager_internal_endpoint Internal route of alertmanager

Contact / Getting help

Please start a discussion

License

License is MIT

Requirements

Name Version
terraform >= 1.3.0
cloudfoundry >= 0.15.5
random >= 2.2.1

Providers

Name Version
cloudfoundry >= 0.15.5
random >= 2.2.1

Modules

No modules.

Resources

Name Type
cloudfoundry_app.alertmanager resource
cloudfoundry_app.prometheusmsteams resource
cloudfoundry_network_policy.alertmanager resource
cloudfoundry_network_policy.prometheusmsteams resource
cloudfoundry_route.alertmanager_internal resource
cloudfoundry_route.prometheusmsteams_internal resource
random_id.id resource
cloudfoundry_domain.apps_internal_domain data source

Inputs

Name Description Type Default Required
alertmanager n/a
object({
docker_image = optional(string, "prom/alertmanager:v0.23.0")
memory = optional(number, 128)
config_file = optional(string, "")
docker_username = optional(string)
docker_password = optional(string)
})
{} no
alertmanager_service_bindings A list of service instances that should be bound to the alertmanager list(object({ service_instance = string })) [] no
alerts_source_app_id Cloudfoundry app id that will send the alerts. E.g Thanos, Prometheus.. string n/a yes
cf_space_id Cloudfoundry SPACE id to use for deploying the alertmanager components. string n/a yes
environment Pass environment variable to the app map(any) {} no
name_postfix The postfix string to append to the app names, hostname, etc. Prevents namespace clashes string "" no
prometheusmsteams_docker_image The docker image to use for the Prometheus MS Teams app string "quay.io/prometheusmsteams/prometheus-msteams:latest" no
prometheusmsteams_service_bindings A list of service instances that should be bound to the prometheusmsteams list(object({ service_instance = string })) [] no
teams_incoming_webhook_url Teams incoming webhook URL string "" no

Outputs

Name Description
alertmanager_app_id App id of Alertmanager
alertmanager_internal_endpoint Internal route of alertmanager