Skip to content

Commit

Permalink
zero_trsut
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCardin committed Nov 21, 2024
1 parent 7073670 commit b2b7239
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
13 changes: 7 additions & 6 deletions terraform/modules/zero_trust_application/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
resource "cloudflare_access_policy" "policy" {
for_each = { for idx, name in var.names : idx => name }

resource "cloudflare_access_policy" "github-app-policy" {
zone_id = var.cloudflare_zone_id
name = "${each.value}-github-auth"
name = "github-auth"
decision = "allow"

include {
Expand All @@ -11,9 +9,12 @@ resource "cloudflare_access_policy" "policy" {
}

resource "cloudflare_zero_trust_access_application" "app" {
for_each = { for idx, name in var.names : idx => name }
depends_on = [cloudflare_access_policy.github-app-policy]
for_each = { for idx, name in var.names : idx => name }

account_id = var.cloudflare_api_key
zone_id = var.cloudflare_zone_id

zone_id = var.cloudflare_zone_id
name = each.value
domain = "${each.value}.ninebasetwo.net"
type = "self_hosted"
Expand Down
5 changes: 5 additions & 0 deletions terraform/modules/zero_trust_application/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ variable "names" {
variable "cloudflare_zone_id" {
description = "The zone ID for Cloudflare"
type = string
}

variable "cloudflare_api_key" {
description = "The API key for Cloudflare"
type = string
}

0 comments on commit b2b7239

Please sign in to comment.