title: Can't start EC2 instance in VPC via lambda
body: <p>I have followed the <a href="https://aws.amazon.com/premiumsupport/knowledge-center/start-stop-lambda-cloudwatch/" rel="nofollow noreferrer">following tutorial</a> to start/stop instances by ID. </p>
  
  <p>I didn't supply the VPC information for either <code>stopEC2Instances</code> or <code>startEC2Instance</code> functions. </p>
  
  <p><strong>Problem</strong>: While it works fine when stopping the instances, the <code>startEC2Instances</code> function doesn't do its job. </p>
  
  <p>I'm wondering if <code>boto3</code> has changed in someway since the tutorial was written? I checked out the <code>boto3</code> API to make sure, but <code>start_instances</code> is still the same function. </p>
  
  <p>I haven't changed any code than what's on the linked article above. </p>
  
  <p><strong>UPDATE</strong>: </p>
  
  <p>CloudWatch Logs for the latest successful run of the <code>startEC2Instances</code> function (it didn't work as expected and still didn't start the instances)</p>
  
  <pre><code>START RequestId: 663ce39a-8534-11e8-9928-2b8c600ed800 Version: $LATEST
  started your instances: REDACTED
  END RequestId: 663ce39a-8534-11e8-9928-2b8c600ed800
  REPORT RequestId: 663ce39a-8534-11e8-9928-2b8c600ed800  Duration: 1055.49 ms    Billed Duration: 1100 ms Memory Size: 512 MB    Max Memory Used: 56 MB  
  START RequestId: 7f7e57ac-8534-11e8-9c44-41bb6e4a0724 Version: $LATEST
  started your instances: REDACTED
  END RequestId: 7f7e57ac-8534-11e8-9c44-41bb6e4a0724
  REPORT RequestId: 7f7e57ac-8534-11e8-9c44-41bb6e4a0724  Duration: 420.79 ms Billed Duration: 500 ms Memory Size: 512 MB Max Memory Used: 56 MB  
  </code></pre>
  
  <p><strong>UPDATE 2</strong>
  I'm copying the policy document and the code from the document above, I have made no changes whatsoever. </p>
  
  <pre><code>{
    "Version": "2012-10-17",
    "Statement": [
      {
        "Effect": "Allow",
        "Action": [
          "logs:CreateLogGroup",
          "logs:CreateLogStream",
          "logs:PutLogEvents"
        ],
        "Resource": "arn:aws:logs:*:*:*"
      },
      {
        "Effect": "Allow",
        "Action": [
          "ec2:Start*",
          "ec2:Stop*"
        ],
        "Resource": "*"
      }
    ]
  }
  </code></pre>
  
  <p>The <code>startEC2Instance</code> code:</p>
  
  <pre><code>import boto3
  # Enter the region your instances are in. Include only the region without specifying Availability Zone; e.g.; 'us-east-1'
  region = 'us-east-1'
  # Enter your instances here: ex. ['X-XXXXXXXX', 'X-XXXXXXXX']
  instances = ['REDACTED']
  
  def lambda_handler(event, context):
      ec2 = boto3.client('ec2', region_name=region)
      ec2.start_instances(InstanceIds=instances)
      print 'started your instances: ' + str(instances)
  </code></pre>