title: Terraform setup tips: TLS communication across VPCs
body: <p>I'm working for a client that has a simple enough problem:</p>
  
  <p>They have EC2s in two different Regions/VPCs that are hosting microservices. Up to this point all EC2s only needed to communicate with EC2 instances that were in the same subnet, but now we need to provision our infrastructure so that specific ec2s in VPC A's public subnet can call specific ec2s in VPC B's public subnet (and vice versa). Communications would be calling restful APIs over over HTTPS/TLS 2.0</p>
  
  <p>This is nothing revolutionary but IT moves slowly and I want to create a Terraform proof of concept that:</p>
  
  <ol>
  <li>Creates two VPCs</li>
  <li>Creates a public subnet in each</li>
  <li>Creates an EC2 in each</li>
  <li>Installs httpd in the EC2 along with a Cert to use SSL/TLS</li>
  <li>Creates the proper security groups so that only IPs associated with the specific instance can call the relevant service</li>
  </ol>
  
  <p>There is no containerization at this client, just individual EC2s for each app with 1 or 2 backups to distribute the load. I'm working with terraform so I can submit different ideas to them for consideration, such as using VPC Peering, Elastic IPs, NAT Gateways, etc.</p>
  
  <p>I can see how to use Terraform to make these infrastructural changes, but I'm not sure how to create EC2s that install a server that can use a temp cert to demonstrate HTTPS traffic. I see a tech called Packer, but was also thinking I should just create a custom AMI that does this.</p>
  
  <p>What would the best solution be? This doesn't have to be production-ready so I'm favoring creating a fast stable proof-of-concept.</p>