I'm working on an AWS configuration via Terraform.
What I'm trying to do is to have an auto-scaling group of lab-indexers spun up within the lab-VPC with routes/subnets/security group configured. When I execute `terraform apply' the script will hang at the 'lab-indexer' portion and then timeout. I am not getting any errors other than the timeout message that I have configured. If I comment out the vpc_zone_indentifier line the indexes spin up without error, although not correctly configured. This leads me to believe that I'm making some sort of configuration error within my VPC settings.
I've searched the Terraform Docs, Stack Overflow, and this comprehensive guide to Terraform.
UPDATE: I was able to log in to the console and check the ASG activity while the instance within the ASG were being created. I noticed a bunch of attempted instance creations with "cancelled" as the status. Upon investigation I saw the following message.
Description: Description Launching a new EC2 instance: i-0bf6afd70895e8212. Status Reason: Failed to update load balancer lab-asg-indexer: EC2 instance i-044ff993c34bc237a is not in the same VPC as ELB. Updating load balancer configuration failed
Cause: Cause At 2017-06-19T13:00:41Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 3.
I'm not sure how to go about fixing this issue with the VPC. I added the ELB to the VPC (I think) via:
subnets = ["${aws_subnet.lab-Subnet.id}"]
but this hasn't resolved the issue.