Skip to content

Commit

Permalink
Fix HERE doc and security group ids
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-norwood committed Apr 21, 2020
1 parent c75f21e commit 4931a9d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ resource "aws_instance" "app" {
ami = data.aws_ami.amazon_linux.id
instance_type = var.instance_type

subnet_id = data.terraform_remote_state.vpc.outputs.private_subnet_ids[count.index % length(data.terraform_remote_state.vpc.outputs.private_subnet_ids)]
subnet_id = data.terraform_remote_state.vpc.outputs.private_subnet_ids[count.index % length(data.terraform_remote_state.vpc.outputs.private_subnet_ids)]
vpc_security_group_ids = data.terraform_remote_state.vpc_outputs.app_instance_security_group_ids

user_data = <<EOF
user_data = <<-EOF
#!/bin/bash
sudo yum update -y
sudo yum install httpd -y
sudo systemctl enable httpd
sudo systemctl start httpd
echo "<html><body><div>Hello, world!</div></body></html>" > /var/www/html/index.html
EOF
EOF

tags = {
Project = data.terraform_remote_state.vpc.outputs.project_tag
Expand Down

0 comments on commit 4931a9d

Please sign in to comment.