diff --git a/functions.tf b/functions.tf index 01ec3e274a57db68a93d51322c2b73b891a72710..297b7136d8456e5b618cccd59b9b16f4bf1cb243 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 0000000000000000000000000000000000000000..af56888b40f6a4a6578633731309ed0777fdbd5d --- /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")