Skip to content

Commit

Permalink
feat: create github pages subdomains
Browse files Browse the repository at this point in the history
Update the terraform configruation to create branded github pages with custom domains.
  • Loading branch information
jboix committed Nov 4, 2024
1 parent 9010fcc commit 1b231dd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,17 @@ resource "aws_iam_role" "route53_access_role" {
Name = "Route53AccessRole"
}
}

# -----------------------------------
# Route 53 Github Configuration
# -----------------------------------

# Define a new Route 53 CNAME Record for GitHub Pages
resource "aws_route53_record" "github_pages_cname" {
for_each = var.github_sub_domains
zone_id = aws_route53_zone.main_zone.zone_id
name = "${each.key}.${var.domain_name}"
type = "CNAME"
ttl = 300
records = ["srgssr.github.io"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ variable "allowed_account_ids" {
description = "The ids allows to access the route 53 main zone resource"
type = list(string)
}

variable "github_sub_domains" {
type = set(string)
default = ["demo", "www", "web", "android", "editor", "plugins"]
}

0 comments on commit 1b231dd

Please sign in to comment.