Skip to content

Commit 4aec0f3

Browse files
committed
Manage infra with Terraform
1 parent 065fe4e commit 4aec0f3

File tree

6 files changed

+114
-0
lines changed

6 files changed

+114
-0
lines changed

.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,38 @@ yarn-error.log*
4444
npm-debug.log*
4545
yarn-debug.log*
4646
yarn-error.log*
47+
48+
# Local .terraform directories
49+
**/.terraform/*
50+
51+
# .tfstate files
52+
*.tfstate
53+
*.tfstate.*
54+
55+
# Crash log files
56+
crash.log
57+
crash.*.log
58+
59+
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
60+
# password, private keys, and other secrets. These should not be part of version
61+
# control as they are data points which are potentially sensitive and subject
62+
# to change depending on the environment.
63+
*.tfvars
64+
*.tfvars.json
65+
66+
# Ignore override files as they are usually used to override resources locally and so
67+
# are not checked in
68+
override.tf
69+
override.tf.json
70+
*_override.tf
71+
*_override.tf.json
72+
73+
# Include override files you do wish to add to version control using negated pattern
74+
# !example_override.tf
75+
76+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
77+
# example: *tfplan*
78+
79+
# Ignore CLI configuration files
80+
.terraformrc
81+
terraform.rc

infrastructure/.terraform.lock.hcl

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
resource "aws_route53_record" "dns_record" {
2+
zone_id = aws_route53_zone.dns_zone.id
3+
name = aws_route53_zone.dns_zone.name
4+
type = "A"
5+
records = [
6+
"185.199.108.153",
7+
"185.199.109.153",
8+
"185.199.110.153",
9+
"185.199.111.153"
10+
]
11+
ttl = 300
12+
}
13+
14+
resource "aws_route53_record" "dns_record_www" {
15+
zone_id = aws_route53_zone.dns_zone.id
16+
name = "www.${aws_route53_zone.dns_zone.name}"
17+
type = "CNAME"
18+
records = ["mattertwo.github.io."]
19+
ttl = 300
20+
}
21+
22+
resource "aws_route53_record" "dns_record_mail" {
23+
zone_id = aws_route53_zone.dns_zone.id
24+
name = aws_route53_zone.dns_zone.name
25+
type = "MX"
26+
records = ["0 mattertwo-com.mail.protection.outlook.com."]
27+
ttl = 300
28+
}
29+
30+
resource "aws_route53_record" "dns_record_autodiscover" {
31+
zone_id = aws_route53_zone.dns_zone.id
32+
name = "autodiscover.${aws_route53_zone.dns_zone.name}"
33+
type = "CNAME"
34+
records = ["autodiscover.outlook.com."]
35+
ttl = 300
36+
}
37+
38+
resource "aws_route53_record" "dns_record_spf" {
39+
zone_id = aws_route53_zone.dns_zone.id
40+
name = aws_route53_zone.dns_zone.name
41+
type = "TXT"
42+
records = ["v=spf1 include:spf.protection.outlook.com -all"]
43+
ttl = 300
44+
}
45+
46+
resource "aws_route53_record" "dns_record_github_pages" {
47+
zone_id = aws_route53_zone.dns_zone.id
48+
name = "_github-pages-challenge-mattertwo.${aws_route53_zone.dns_zone.name}"
49+
type = "TXT"
50+
records = ["dee22f0f20c4b1262f021d6406582a"]
51+
ttl = 300
52+
}

infrastructure/aws_route53_zone.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resource "aws_route53_zone" "dns_zone" {
2+
name = "mattertwo.com"
3+
}

infrastructure/backend.tf

Whitespace-only changes.

infrastructure/main.tf

Whitespace-only changes.

0 commit comments

Comments
 (0)