-
Notifications
You must be signed in to change notification settings - Fork 3
/
alinka_website.tf
82 lines (69 loc) · 2.07 KB
/
alinka_website.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
module "alinka_website_user" {
source = "./user"
name = "alinka_website"
}
resource "aws_route53_zone" "alinka_website" {
name = "alinka.io"
}
resource "aws_route53_record" "ns_alinka_website" {
zone_id = aws_route53_zone.alinka_website.zone_id
name = aws_route53_zone.alinka_website.name
type = "NS"
ttl = "172800"
records = [
"${aws_route53_zone.alinka_website.name_servers.0}.",
"${aws_route53_zone.alinka_website.name_servers.1}.",
"${aws_route53_zone.alinka_website.name_servers.2}.",
"${aws_route53_zone.alinka_website.name_servers.3}.",
]
}
resource "aws_route53_record" "soa_alinka_website" {
zone_id = aws_route53_zone.alinka_website.zone_id
name = aws_route53_zone.alinka_website.name
type = "SOA"
ttl = "900"
records = [
"ns-1143.awsdns-14.org. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400",
]
}
module "alinka_website_ssl_certificate" {
source = "./ssl_certificate"
domain = "alinka.io"
route53_zone = aws_route53_zone.alinka_website
providers = {
aws = aws.north_virginia
}
}
module "alinka_website_frontend_assets" {
source = "./frontend_assets"
name = "alinka_website"
s3_bucket = aws_s3_bucket.codeforpoznan_public
iam_user = module.alinka_website_user.user
}
module "alinka_website_cloudfront_distribution" {
source = "./cloudfront_distribution"
name = "alinka_website"
domain = "alinka.io"
s3_bucket = aws_s3_bucket.codeforpoznan_public
route53_zone = aws_route53_zone.alinka_website
iam_user = module.alinka_website_user.user
acm_certificate = module.alinka_website_ssl_certificate.certificate
origins = {
static_assets = {
default = true
domain_name = aws_s3_bucket.codeforpoznan_public.bucket_domain_name
origin_path = "/alinka_website"
}
google_form = {
domain_name = "docs.google.com"
origin_path = ""
custom_origin = true
}
}
additional_cache_behaviors = [
{
path_pattern = "forms/*"
target_origin_id = "google_form"
}
]
}