Relatively new to terraform. I am able to spin up servers but I am struggling with the bootstrapping. I have been trying variations of my shell script in user_data but nothing seems to work:
provider "aws" {
profile = var.profile
region = var.aws_region
}
resource "aws_instance" "Test_1" {
ami = var.amis_ubuntu_18_04
instance_type = var.instance_type_t2_micro
subnet_id = var.public_subnets
associate_public_ip_address = true
security_groups = ["*****************"]
user_data=<<EOF
#!/bin/bash
sudo mkdir /var/test1
EOF
key_name = var.Keypair
tags = {
Name = "Test 1"
Environment = var.environment_tag
Owner = "Me"
project = "Test 1"
}
}