title: EC2 instance is not in the same VPC as ELB. Invalid Instance
body: <p>Using the AWS CloudFormation service, I am trying to create an Elastic Load Balancer on 2 EC2 instances, but I am getting an error:</p>
  
  <blockquote>
    <p>EC2 instance i-0a38204c18b48604c is not in the same VPC as ELB. (Service: AmazonElasticLoadBalancing; Status Code: 400; Error Code: InvalidInstance; Request ID: 2af5dc7e-9a7f-11e8-91c9-a3410fab05ba)".</p>
  </blockquote>
  
  <p>The EC2 instances are getting created properly, but ELB is not created. How can I rectify this issue?</p>
  
  <p>Please find the full code for reference <a href="https://pastebin.com/Q14FeBba" rel="nofollow noreferrer">here</a></p>
  
  <pre><code> ElasticLoadBalancer:
  Type: AWS::ElasticLoadBalancing::LoadBalancer
  Properties:
    AvailabilityZones: 
    - 'us-east-2a'
    Instances: [!Ref 'webServer1', !Ref 'webServer2']  
    Listeners:
    - LoadBalancerPort: '80'
      InstancePort: '80'
      Protocol: HTTP
    HealthCheck:
      Target: HTTP:80/
      HealthyThreshold: '3'
      UnhealthyThreshold: '5'
      Interval: '30'
      Timeout: '5'
  </code></pre>