File tree Expand file tree Collapse file tree 6 files changed +52
-8
lines changed
modules/terraform-aws-nixos-webserver-wrapper Expand file tree Collapse file tree 6 files changed +52
-8
lines changed Original file line number Diff line number Diff line change 1+ # An ebs volume to mount that stores the existing emails
2+ # resource "aws_ebs_volume" "mailbox" {
3+ # availability_zone = var.azs[0]
4+ # encrypted = true
5+ # kms_key_id = aws_kms_key.mail.arn
6+ # size = 60
7+ # tags = {
8+ # Name = "${var.name_prefix}-ebs-volume"
9+ # }
10+ # }
11+
12+ # TODO review/setup
13+ # This will be mounted to /var/vmail/
14+ #
15+ # Attach the email EBS volume to the instance
16+ # resource "aws_volume_attachment" "mailbox" {
17+
18+ # # The device name to expose to the instance (for example, /dev/sdh or xvdh).
19+ # device_name = "/dev/sdh"
20+ # # TODO change this or set up a way for it to be mounted by the instance where
21+ # # the mailserver puts the mail files
22+ # # https://www.terraform.io/docs/providers/aws/r/volume_attachment.html#device_name
23+
24+ # volume_id = aws_ebs_volume.mailbox.id
25+ # instance_id = aws_instance.email_server.id
26+ # }
27+
28+ # # TODO review EBS snapshots
29+ # # Create a snap of the EBS volume
30+ # resource "aws_ebs_snapshot" "mailbox_snapshot" {
31+ # volume_id = aws_ebs_volume.mailbox.id
32+ #
33+ # tags = {
34+ # Name = "${var.name_prefix}-ebs-volume-snapshot"
35+ # }
36+ # }
Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ resource "aws_instance" "web_server" {
8181 kms_key_id = aws_kms_key. root . arn
8282 }
8383
84+ # ebs_block_device cannot be mixed with external aws_ebs_volume and
85+ # aws_volume_attachment resources for a given instance.
86+
8487 tags = {
8588 Name = " ${ var . name_prefix } -web-server"
8689 Terraform = true
Original file line number Diff line number Diff line change 22resource "aws_kms_key" "root" {
33 description = " The KMS key used to encrypt the root EBS volume for the ${ var . base_domain } web server instance."
44
5+ # policy = TODO
6+
57 tags = {
68 Name = " ${ var . name_prefix } -root-volume-kms-key"
79 }
810}
11+
12+ # TODO see https://www.terraform.io/docs/providers/aws/r/ebs_default_kms_key.html
13+ # resource "aws_ebs_default_kms_key" "example" {
14+ # key_arn = "${aws_kms_key.example.arn}"
15+ # }
Original file line number Diff line number Diff line change 3939 locations." /" = {
4040 root = " /var/www/${content_location}/_site" ;
4141 } ;
42-
43-
4442 };
4543
46- # TODO combine this with the above so that this doesn't repeat itself
44+ # TODO combine this with the above so that this doesn't repeat itself
4745
4846 "${ domain} " = {
4947 forceSSL = true ;
5351 locations." /" = {
5452 root = " /var/www/${content_location}/_site" ;
5553 } ;
56-
5754 };
5855
5956 };
Original file line number Diff line number Diff line change @@ -40,13 +40,14 @@ variable "public_subnet_cidr" {
4040
4141variable "public_subnet_extra_tags" {
4242 description = " Extra tags that will be added to public subnets."
43- default = {}
43+ default = {} # TODO remove default
4444 type = map
4545}
4646
47+ # TODO review
4748variable "public_gateway_extra_tags" {
4849 description = " Extra tags that will be added to Internet Gateway and public Routing Tables."
49- default = {}
50+ default = {} # TODO remove default
5051 type = map
5152}
5253
@@ -96,7 +97,7 @@ variable "az" {
9697
9798variable "vpc_extra_tags" {
9899 description = " Extra tags that will be added to VPC and DHCP Options. Note that duplicate keys will overwrite those from the extra_tags variable."
99- default = {}
100+ default = {} # TODO remove default
100101 type = map
101102}
102103
Original file line number Diff line number Diff line change @@ -56,4 +56,4 @@ module "web-server-https-rule" {
5656 security_group_id = module. web-server-sg . id
5757}
5858
59- # TODO add ping icmp
59+ # TODO add ping icmp
You can’t perform that action at this time.
0 commit comments