From bcf8db4e14fe14a0d85d980a5ca6bc9a420a069c Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sat, 15 May 2021 00:09:40 +0300
Subject: [PATCH] Add checks for auth, elasticsearch and kibana.

---
 functions.tf         |  3 +++
 src/auth.py          | 12 ++++++++++++
 src/elasticsearch.py | 12 ++++++++++++
 src/kibana.py        | 12 ++++++++++++
 4 files changed, 39 insertions(+)
 create mode 100644 src/auth.py
 create mode 100644 src/elasticsearch.py
 create mode 100644 src/kibana.py

diff --git a/functions.tf b/functions.tf
index dd3c36c..7ccabd8 100644
--- a/functions.tf
+++ b/functions.tf
@@ -16,6 +16,9 @@ locals {
     "ssh",
     "smtp",
     "imap",
+    "auth",
+    "elasticsearch",
+    "kibana",
   ]
   function_names = [for name in local.functions : "${local.function_name_prefix}-${replace(name, "_", "")}"]
 }
diff --git a/src/auth.py b/src/auth.py
new file mode 100644
index 0000000..b9aff69
--- /dev/null
+++ b/src/auth.py
@@ -0,0 +1,12 @@
+from utils import website_handler
+
+URLS = [
+    {"url": "http://auth.shore.co.il/", "codes": [301]},
+    {"url": "https://auth.shore.co.il/", "codes": [403]},
+]
+
+handler = website_handler(URLS)
+
+
+if __name__ == "__main__":
+    handler("event", "context")
diff --git a/src/elasticsearch.py b/src/elasticsearch.py
new file mode 100644
index 0000000..eb30170
--- /dev/null
+++ b/src/elasticsearch.py
@@ -0,0 +1,12 @@
+from utils import website_handler
+
+URLS = [
+    {"url": "http://elasticsearch.shore.co.il/", "codes": [301]},
+    {"url": "https://elasticsearch.shore.co.il/", "codes": [403]},
+]
+
+handler = website_handler(URLS)
+
+
+if __name__ == "__main__":
+    handler("event", "context")
diff --git a/src/kibana.py b/src/kibana.py
new file mode 100644
index 0000000..d41683d
--- /dev/null
+++ b/src/kibana.py
@@ -0,0 +1,12 @@
+from utils import website_handler
+
+URLS = [
+    {"url": "http://kibana.shore.co.il/", "codes": [301]},
+    {"url": "https://kibana.shore.co.il/", "codes": [302]},
+]
+
+handler = website_handler(URLS)
+
+
+if __name__ == "__main__":
+    handler("event", "context")
-- 
GitLab