Simplified main. Added AMI module.

This commit is contained in:
Curtis Wilson
2021-11-26 16:06:19 -05:00
parent 19f5765a1e
commit 65c1b634e3
14 changed files with 390 additions and 84 deletions
@@ -0,0 +1,9 @@
data "template_file" "user-datas" {
template = file("${var.cloud-init-template}")
vars = {
admin-passwd = "${var.root-admin-passwd}"
admin-pub-key = "${var.root-admin-pub-key}"
hostname = "${var.hostname-prefix}-${count.index}"
}
count = var.num
}
@@ -0,0 +1,3 @@
output "user-datas" {
value = data.template_file.user-datas
}
@@ -0,0 +1,22 @@
variable "cloud-init-template" {
default = "../../cloud_init.cfg"
description = "The path to the cloud-init config template."
type = string
}
variable "hostname-prefix" {
description = "This prefix wil be applied as a prefix for the hostnames."
}
variable "num" {
description = "The number of user-datas to create with these parameters."
}
variable "root-admin-passwd" {
description = "This value will be substituted for any occurence of 'admin-password' in the cloud-init config template."
}
variable "root-admin-pub-key" {
description = "This value will be substituted for any occurence of 'admin-pub-key' in the cloud-init config template."
}