aboutsummaryrefslogtreecommitdiff
path: root/terraform/aws/mini_environment.tf
diff options
context:
space:
mode:
Diffstat (limited to 'terraform/aws/mini_environment.tf')
-rw-r--r--terraform/aws/mini_environment.tf9
1 files changed, 6 insertions, 3 deletions
diff --git a/terraform/aws/mini_environment.tf b/terraform/aws/mini_environment.tf
index ddaefd0..bf3a356 100644
--- a/terraform/aws/mini_environment.tf
+++ b/terraform/aws/mini_environment.tf
@@ -14,6 +14,9 @@ variable "ssh_public_key" {
type = "string"
}
+variable "start_command" {
+ type = "string"
+}
provider "aws" {
region = "${var.aws_region}"
@@ -43,9 +46,7 @@ data "template_file" "govuk_service" {
template = "${file("${path.module}/mini_environment/govuk.service.tpl")}"
vars {
- guix_daemon_socket = "guix://${data.aws_instance.guix-daemon.private_dns}",
- app_domain = "${var.slug}.aws.cbaines.net",
- web_domain = "www.${var.slug}.aws.cbaines.net"
+ start_command = "${var.start_command}"
}
}
@@ -85,6 +86,8 @@ resource "aws_spot_instance_request" "example" {
"sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 ${data.aws_efs_file_system.main.dns_name}:var/guix /var/guix",
"echo \"export GUIX_DAEMON_SOCKET=guix://${data.aws_instance.guix-daemon.private_dns}\" | sudo tee /etc/profile.d/guix-daemon-socket.sh",
#"sudo systemctl restart cachefilesd",
+ "sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080",
+ "sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8443",
"sudo mv /home/ubuntu/govuk.service /etc/systemd/system/govuk.service",
"sudo systemctl daemon-reload",
"sudo systemctl enable govuk.service",