Skip to content

Commit daea969

Browse files
committed
Add work to the development branch
1 parent 3cc2180 commit daea969

File tree

6 files changed

+52
-8
lines changed

6 files changed

+52
-8
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
# }

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
resource "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+
# }

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@
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;
@@ -53,7 +51,6 @@
5351
locations."/" = {
5452
root = "/var/www/${content_location}/_site";
5553
};
56-
5754
};
5855

5956
};

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ variable "public_subnet_cidr" {
4040

4141
variable "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
4748
variable "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

9798
variable "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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)