Skip to content

Commit

Permalink
configure redirect rule
Browse files Browse the repository at this point in the history
  • Loading branch information
augustfengd committed Jan 26, 2025
1 parent ff336d5 commit 107fda4
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions cloud/terraform/cloudflare.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import {
to = cloudflare_ruleset.aws_access_portal
id = "75e452482817c1c147830ac917e3cc08/60b251bcbeb34a0eab96efb9500822fd"
}

resource "cloudflare_ruleset" "aws_access_portal" {
name = "Redirect from aws.augustfeng.app to AWS access portal"
kind = "redirect"
phase = "http_request_late_transform"
kind = "zone"
phase = "http_request_dynamic_redirect"

rules {
action = "redirect"
expression = "(http.host eq \"aws.augustfeng.app\")"
action_parameters {
from_value {
status_code = 301
target_url {
value = format("https://%s.awsapps.com/start", var.aws_identity_store_id)
}
}
}
}
}

0 comments on commit 107fda4

Please sign in to comment.