From 6a2da7bbe8d91bc92cdcd4d279b5cb7fb7409c88 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Fri, 30 Apr 2021 21:22:45 +0300
Subject: [PATCH] Add checks for shore.co.il and www.shore.co.il.

---
 functions.tf |  1 +
 src/www.py   | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 src/www.py

diff --git a/functions.tf b/functions.tf
index 01ec3e2..297b713 100644
--- a/functions.tf
+++ b/functions.tf
@@ -8,6 +8,7 @@ locals {
     "notify",
     "autoconfig",
     "mta-sta",
+    "www",
   ]
   function_names = [for name in local.functions : "${local.function_name_prefix}-${replace(name, "_", "")}"]
 }
diff --git a/src/www.py b/src/www.py
new file mode 100644
index 0000000..af56888
--- /dev/null
+++ b/src/www.py
@@ -0,0 +1,16 @@
+from utils import check_urls
+
+
+def handler(event, context):  # pylint: disable=unused-argument
+    """Lambda event handler."""
+    checks = [
+        {"url": "http://shore.co.il/", "codes": [301, 302]},
+        {"url": "http://www.shore.co.il/", "codes": [301, 302]},
+        {"url": "https:/shore.co.il/", "codes": [301, 302]},
+        {"url": "https://www.shore.co.il/blog"},
+    ]
+    check_urls(checks)
+
+
+if __name__ == "__main__":
+    handler("event", "context")
-- 
GitLab