func createPoolFromDevice(svc *devicefarm.DeviceFarm, poolName string, deviceName string, projectArn string) (poolArn string, poolErr error) {

	deviceArn, err := lookupDeviceArn(svc, deviceName)
	failOnErr(err, "error looking up device")

	fmt.Printf("creating %s", deviceArn)
	req := &devicefarm.CreateDevicePoolInput{
		Name:        aws.String(poolName),
		Description: aws.String("autocreated pool " + poolName),
		ProjectArn:  aws.String(projectArn),
		Rules: []*devicefarm.Rule{
			&devicefarm.Rule{
				Attribute: aws.String("Arn"),
				Operator:  aws.String("IN"),
				// Value: "[\"arn:aws:devicefarm:us-west-2::device:6A553F3B3D384DB1A780C590FCC7F85D\"]"
				Value: aws.String("[\"" + deviceArn + "\"]"),
			},
		},
	}

	resp, err := svc.CreateDevicePool(req)

	if err != nil {
		return "", err
	}

	return *resp.DevicePool.Arn, nil
	//fmt.Println(awsutil.Prettify(resp))
}