Skip to content

Commit 72d0233

Browse files
committed
Create DNS record for distribution
1 parent a0fe728 commit 72d0233

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

terragrunt/modules/win-rustup-rs/data.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ data "aws_iam_role" "cloudfront_lambda" {
22
name = "cloudfront-lambda"
33
}
44

5+
data "aws_route53_zone" "rustup" {
6+
// Convert {dev-win,win}.rustup.rs into rustup.rs
7+
name = join(".", reverse(slice(reverse(split(".", var.domain_name)), 0, 2)))
8+
}
9+
510
data "aws_s3_bucket" "static" {
611
bucket = var.static_bucket
712
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource "aws_route53_record" "record" {
2+
zone_id = data.aws_route53_zone.rustup.id
3+
name = var.domain_name
4+
type = "CNAME"
5+
ttl = 300
6+
records = [aws_cloudfront_distribution.distribution.domain_name]
7+
}

0 commit comments

Comments
 (0)