diff --git a/demo-10/cloudinit.tf b/demo-10/cloudinit.tf index 83fcfe2..08adc9a 100644 --- a/demo-10/cloudinit.tf +++ b/demo-10/cloudinit.tf @@ -1,20 +1,20 @@ # note: previous templatefile datasources have been replaced by the template_file() function -data "template_cloudinit_config" "cloudinit-example" { +data "cloudinit_config" "cloudinit-example" { gzip = false base64_encode = false part { filename = "init.cfg" content_type = "text/cloud-config" - content = template_file("scripts/init.cfg", { + content = templatefile("scripts/init.cfg", { REGION = var.AWS_REGION }) } part { content_type = "text/x-shellscript" - content = template_file("scripts/volumes.sh", { + content = templatefile("scripts/volumes.sh", { DEVICE = var.INSTANCE_DEVICE_NAME }) } diff --git a/demo-10/instance.tf b/demo-10/instance.tf index 4f17b09..4c0d0c9 100644 --- a/demo-10/instance.tf +++ b/demo-10/instance.tf @@ -12,7 +12,7 @@ resource "aws_instance" "example" { key_name = aws_key_pair.mykeypair.key_name # user data - user_data = data.template_cloudinit_config.cloudinit-example.rendered + user_data = data.cloudinit_config.cloudinit-example.rendered } resource "aws_ebs_volume" "ebs-volume-1" {