Skip to content

Commit 81652c5

Browse files
committed
Updates to match master
1 parent 354d299 commit 81652c5

File tree

5 files changed

+19
-22
lines changed

5 files changed

+19
-22
lines changed

modules/terraform-aws-nixos-webserver-wrapper/route53.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ resource "aws_route53_record" "www" {
1111
name = "www.${var.base_domain}."
1212
type = "A"
1313
ttl = "300"
14-
# records = [ aws_instance.email_server.public_ip ]
1514
records = [ aws_eip.web_server.public_ip ]
1615
}
1716

@@ -30,7 +29,6 @@ resource "aws_route53_record" "a" {
3029
name = "${var.base_domain}."
3130
type = "A"
3231
ttl = "300"
33-
# records = [ aws_instance.email_server.public_ip ]
3432
records = [ aws_eip.web_server.public_ip ]
3533
}
3634

modules/terraform-aws-nixos-webserver-wrapper/templates/configuration.nix.tpl

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
ec2.hvm = true;
88
99
networking = {
10-
hostName = "mikemcgirr";
11-
# TODO set with Terraform Template var
10+
hostName = "${hostname}";
1211
1312
enableIPv6 = true;
1413
@@ -38,11 +37,8 @@
3837
enableACME = true;
3938
4039
locations."/" = {
41-
# TODO set from an input variable
42-
root = "/var/www/mikemcgirr-com/_site";
40+
root = "/var/www/${content_location}/_site";
4341
};
44-
45-
4642
};
4743

4844
# TODO combine this with the above so that this doesn't repeat itself
@@ -53,10 +49,8 @@
5349
enableACME = true;
5450
5551
locations."/" = {
56-
# TODO set from an input variable
57-
root = "/var/www/mikemcgirr-com/_site";
52+
root = "/var/www/${content_location}/_site";
5853
};
59-
6054
};
6155

6256
};

modules/terraform-aws-nixos-webserver-wrapper/templates/init.sh.tpl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44

55
ssh -i ./id_rsa root@${ip} "nix-channel --update && nixos-rebuild switch"
66

7-
ssh -i ./id_rsa root@${ip} "mkdir -p /var/www/mikemcgirr-com"
8-
# TODO set this with an input variable
7+
ssh -i ./id_rsa root@${ip} "mkdir -p /var/www/${content_location}"
98

10-
# then scp the website file at this point
11-
scp -i ./id_rsa -P 22 -r ../../mikemcgirr-com/_site root@${ip}:/var/www/mikemcgirr-com/.
12-
# TODO set this with an input variable
9+
# Then scp the website file at this point.
10+
# This assumes the static blog content you'd initially like to move over is located two directories up
11+
scp -i ./id_rsa -P 22 -r ../../${content_location}/_site root@${ip}:/var/www/${content_location}/.
1312

1413
# then scp the configuration.nix file at this point
1514
scp -i ./id_rsa -P 22 configuration.nix root@${ip}:/etc/nixos/configuration.nix
1615

17-
ssh -i ./id_rsa root@${ip} "nix-channel --update && nixos-rebuild switch"
16+
ssh -i ./id_rsa root@${ip} "nix-channel --update && nixos-rebuild switch"

modules/terraform-aws-nixos-webserver-wrapper/variables.tf

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,21 @@ variable "base_domain" {
88
type = string
99
}
1010

11+
variable "hostname" {
12+
description = "The hostname to set on the AWS instance"
13+
type = string
14+
}
15+
1116
variable "email" {
1217
description = "The email to use for the cert emails."
1318
type = string
1419
}
1520

21+
variable "content_location" {
22+
description = "The location on the AWS instance where the web content will be located."
23+
type = string
24+
}
25+
1626
variable "region" {
1727
description = "The region to create AWS resources in for the web server"
1828
type = string
@@ -93,11 +103,8 @@ variable "vpc_extra_tags" {
93103
type = map
94104
}
95105

96-
# TODO review
97-
# if the description here is confusing, see the semantics that `merge()` uses:
98-
# https://www.terraform.io/docs/configuration/interpolation.html#merge-map1-map2-
99106
variable "extra_tags" {
100-
description = "Extra tags that will be added to ALL RESOURCES, use the resource-specific variables if you need that level of control. Note that keys may be overwritten in cases where there are duplicates."
107+
description = "Extra tags that will be added to all resources."
101108
default = {} # TODO remove default
102109
type = map
103110
}

modules/terraform-aws-nixos-webserver-wrapper/webserver-sg.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module "web-server-sg" {
1111
module "web-server-ssh-rule" {
1212
source = "fpco/foundation/aws//modules/ssh-sg"
1313
version = "0.9.4"
14-
# cidr_blocks = var.allowed_remote_cidrs # TODO maybe add a bastion host eventually
1514
cidr_blocks = ["0.0.0.0/0" ]
1615
# ipv6_cidr_blocks = ["::/0" ] # TODO add ipv6 to the upstream module
1716
security_group_id = module.web-server-sg.id

0 commit comments

Comments
 (0)