diff --git a/ahoskingit/terraform/cloudflare_access.tf b/ahoskingit/terraform/cloudflare_access.tf index 1d4261c..cf8146b 100644 --- a/ahoskingit/terraform/cloudflare_access.tf +++ b/ahoskingit/terraform/cloudflare_access.tf @@ -65,4 +65,29 @@ resource "cloudflare_access_application" "tv" { allowed_idps = [ "f27ba272-b676-4ab0-b560-e4ea52b19f18", #TODO: Remove Manual Entry ] -} \ No newline at end of file +} + +resource "cloudflare_access_application" "period" { + account_id = var.CLOUDFLARE_ACCOUNT_ID + name = "period" + domain = "period.ahosking.com" + type = "self_hosted" + session_duration = "336h" + allowed_idps = [ + "f27ba272-b676-4ab0-b560-e4ea52b19f18", #TODO: Remove Manual Entry + ] +} + +resource "cloudflare_access_policy" "period" { + application_id = cloudflare_access_application.period.id + zone_id = cloudflare_zone.ahosking_com.id + name = "family" + precedence = "1" + decision = "allow" + include { + email_domain = ["@ahosking.com"] + } + require { + email_domain = ["@ahosking.com"] + } +}