Skip to content

Instantly share code, notes, and snippets.

@pgporada
Created March 4, 2016 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgporada/147024325d56fec909b9 to your computer and use it in GitHub Desktop.
Save pgporada/147024325d56fec909b9 to your computer and use it in GitHub Desktop.
resource "template_file" "app" {
template = "${file("${path.module}/init.sh")}"
vars {
TERRAFORM_db_host = "${var.rds_master}"
TERRAFORM_db_user = "dfgdfg"
TERRAFORM_db_pass = "dfgdfg"
TERRAFORM_db = "sdfsdfsd"
}
}
resource "aws_launch_configuration" "app" {
name_prefix = "app_${var.env}_launchconfig"
image_id = "${var.ami}"
instance_type = "${var.instance_type}"
key_name = "${var.key_name}"
security_groups = ["${aws_security_group.vpc.id}","${aws_security_group.ssh.id}"]
user_data = "${template_file.app.rendered}"
iam_instance_profile = "${aws_iam_instance_profile.app_profile.name}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment