Open ThomasObenaus opened 6 years ago
Terraform support the functionality to render a cloud-init-script from separate parts: https://www.terraform.io/docs/providers/template/d/cloudinit_config.html
data "template_cloudinit_config" "config" { gzip = true base64_encode = true
part { filename = "init.cfg" content_type = "text/cloud-config" content = "${data.template_file.script.rendered}" }
part { content_type = "text/x-shellscript" content = "${var.user-specific-user-data}" } }
Things to change in this repository: https://github.com/MatthiasScholz/cos/blob/d6263fdebbb3685d9a8d9aeff5b649408cc217f3/modules/nomad-datacenter/datacenter.tf
Some use-cases (i.e. mounting an efs mount-target) are best implemented via user-data when the instance is created. With the current module api it is not possible to add steps to the user-data of the nomad nodes.
It would be nice to have this option.