From 856fe76718918007e1a83125cb3aaf8d44305747 Mon Sep 17 00:00:00 2001 From: parabolic Date: Sat, 18 May 2019 21:37:46 +0200 Subject: [PATCH] add the data resources --- .../ec2_instance_cloudwatch_agent/data.tf | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 terraform/ec2_instance_cloudwatch_agent/data.tf diff --git a/terraform/ec2_instance_cloudwatch_agent/data.tf b/terraform/ec2_instance_cloudwatch_agent/data.tf new file mode 100644 index 0000000..d4fb7d3 --- /dev/null +++ b/terraform/ec2_instance_cloudwatch_agent/data.tf @@ -0,0 +1,21 @@ +data "aws_ami" "ubuntu" { + most_recent = true + + filter { + name = "name" + values = ["ubuntu/images/hvm-ssd/ubuntu-*-18.04-amd64-server-*"] + } + + owners = [ + "099720109477", + ] +} + +data "template_file" "cloud-init" { + template = "${file("${path.module}/templates/cloud_init.yaml")}" + + vars { + username = "${module.label.id}" + password = "${random_id.http_password.hex}" + } +}