I have a Terraform script for make a deploy of Ubuntu.
resource "aws_instance" "runner" {
instance_type = "${var.instance_type}"
ami = "${var.ami}"
user_data = "${data.template_file.deploy.rendered}"
}
data "template_file" "deploy" {
template = "${file("cloudinit.tpl")}"
}
My cloudinit.tpl:
#cloud-config
runcmd:
- apt-get update
- sleep 30
- apt-get install -y awscli
I can't find any issue on cloud-init.log and can't find user-data.log file in /var/log to understand why user-data is not working.
/var/log/cloud-init-output.log
? If you view the user data for the instance in the AWS console what does it show? – ydaetskcoR/var/log/cloud-init-output.log
i have this:E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
– mleafpackages
, which also runsapt-get update
automatically for you. – StephenKing