Skip to content

Commit

Permalink
Merge pull request #123 from ruby-no-kai/rko-router-rk-n
Browse files Browse the repository at this point in the history
rko-router.rubykaigi.net for HTTPS record
  • Loading branch information
sorah authored Nov 1, 2024
2 parents ce6c8cb + ccdb7b7 commit 00d3b17
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .mairu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"server": "https://amc.rubykaigi.net/api/remote/",
"role": "arn:aws:iam::005216166247:role/OrgzAdmin"
}
32 changes: 16 additions & 16 deletions tf/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions tf/route53.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
resource "aws_route53_record" "rko-router-rk-n_A" {
zone_id = each.value
for_each = local.rubykaigi_net_zones
name = "rko-router.rubykaigi.net."
type = "A"
alias {
name = aws_cloudfront_distribution.rko-router.domain_name
zone_id = aws_cloudfront_distribution.rko-router.hosted_zone_id
evaluate_target_health = true
}
}
resource "aws_route53_record" "rko-router-rk-n_AAAA" {
zone_id = each.value
for_each = local.rubykaigi_net_zones
name = "rko-router.rubykaigi.net."
type = "AAAA"
alias {
name = aws_cloudfront_distribution.rko-router.domain_name
zone_id = aws_cloudfront_distribution.rko-router.hosted_zone_id
evaluate_target_health = true
}
}
resource "aws_route53_record" "rko-router-rk-n_HTTPS" {
for_each = local.rubykaigi_net_zones
name = "rko-router.rubykaigi.net."
zone_id = each.value
type = "HTTPS"
ttl = 60
records = ["1 . alpn=\"h3,h2\""]
}

data "aws_route53_zone" "rubykaigi-net_public" {
name = "rubykaigi.net."
private_zone = false
}

data "aws_route53_zone" "rubykaigi-net_private" {
name = "rubykaigi.net."
private_zone = true
}

locals {
rubykaigi_net_zones = toset([data.aws_route53_zone.rubykaigi-net_public.zone_id, data.aws_route53_zone.rubykaigi-net_private.zone_id])
}

0 comments on commit 00d3b17

Please sign in to comment.