Skip to content

Commit

Permalink
Create DNS record for distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
jdno committed Jun 4, 2024
1 parent 4a42117 commit ac54e61
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions terragrunt/modules/win-rustup-rs/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ data "aws_iam_role" "cloudfront_lambda" {
name = "cloudfront-lambda"
}

data "aws_route53_zone" "rustup" {
// Convert {dev-win,win}.rustup.rs into rustup.rs
name = join(".", reverse(slice(reverse(split(".", var.domain_name)), 0, 2)))
}

data "aws_s3_bucket" "static" {
bucket = var.static_bucket
}
7 changes: 7 additions & 0 deletions terragrunt/modules/win-rustup-rs/dns.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resource "aws_route53_record" "record" {
zone_id = data.aws_route53_zone.rustup.id
name = var.domain_name
type = "CNAME"
ttl = 300
records = [aws_cloudfront_distribution.distribution.domain_name]
}

0 comments on commit ac54e61

Please sign in to comment.