Update AWS Terraform

- Add variables to cloud-init.yaml
- Allow to set Linux OS password via cloud-init
- Pass the tpot.conf file as inline content to allow variables
- Remove obsolete tpot.conf file in terraform/ directory
This commit is contained in:
Sebastian Haderecker
2020-03-25 13:34:22 +01:00
parent f606187350
commit a73f34490d
4 changed files with 38 additions and 17 deletions

View File

@ -60,7 +60,7 @@ resource "aws_instance" "tpot" {
volume_size = 128
delete_on_termination = true
}
user_data = "${file("../cloud-init.yaml")} content: ${base64encode(file("../tpot.conf"))}"
user_data = templatefile("../cloud-init.yaml", {timezone = var.timezone, password = var.linux_password, tpot_flavor = var.tpot_flavor, web_user = var.web_user, web_password = var.web_password})
vpc_security_group_ids = [aws_security_group.tpot.id]
associate_public_ip_address = true
}