Skip to content

Commit 01189f2

Browse files
committed
docs: improve standalone distribution example
1 parent b5a0793 commit 01189f2

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

examples/standalone-distribution/cloudfront_distribution.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ resource "aws_cloudfront_distribution" "fpjs_cloudfront_distribution" {
4646
}
4747
}
4848

49-
aliases = ["${var.subdomain}.${var.root_domain}"]
49+
aliases = [var.proxy_subdomain_domain]
5050
viewer_certificate {
51-
acm_certificate_arn = "arn:aws:acm:us-east-1:013357491684:certificate/c3ffee8c-071b-4ff8-bec2-e222eff602bc"
51+
acm_certificate_arn = var.certificate_arn
5252
ssl_support_method = "sni-only"
5353
}
5454

@@ -64,7 +64,7 @@ resource "aws_cloudfront_distribution" "fpjs_cloudfront_distribution" {
6464
# (comment this out if you don't want to do that for now)
6565
resource "aws_route53_record" "cloudfront_terraform_new_distribution_record" {
6666
zone_id = var.domain_zone_id
67-
name = "${var.subdomain}.${var.root_domain}"
67+
name = var.proxy_subdomain_domain
6868
type = "CNAME"
6969
ttl = 300
7070
records = [aws_cloudfront_distribution.fpjs_cloudfront_distribution.domain_name]

examples/standalone-distribution/variables.tf

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,18 @@ variable "fpjs_get_result_path" {
1313
type = string
1414
}
1515

16-
variable "subdomain" {
17-
description = "The subdomain for the CloudFront distribution"
16+
variable "proxy_subdomain_domain" {
17+
description = "The subdomain for the CloudFront distribution, including the root domain of your website, for example `metrics.yourwebsite.com`"
1818
type = string
19-
# default = "metrics"
2019
}
2120

22-
variable "root_domain" {
23-
description = "The root domain for the CloudFront distribution"
24-
type = string
25-
# default = "yourwebsite.com"
26-
}
2721

2822
variable "domain_zone_id" {
2923
description = "Zone ID of the domain for the CloudFront distribution"
3024
type = string
3125
}
26+
27+
variable "certificate_arn" {
28+
description = "ARN of the domain certificate for the CloudFront distribution"
29+
type = string
30+
}

0 commit comments

Comments
 (0)