'Implements GenericVmValidateBomDeployer interface.'

def do_determine_instance_ip(self):

    options = self.options
    response = run_and_monitor('aws    ec2    describe-instances    --profile    {region}    --output    json    --filters    "Name=tag:Name,Values={name},Name=instance-state-name,Values=running"'.format(region=options.deploy_aws_region, name=options.deploy_aws_name), echo=False)
    if (response.returncode != 0):
        raise ValueError('Could    not    determine    public    IP:    {0}'.format(response))
    found = json.JSONDecoder().decode(response.stdout).get('Reservations')
    if (not found):
        raise RuntimeError('"{0}"    is    not    running'.format(options.deploy_aws_name))
    return found[0]['Instances'][0]['PublicIpAddress']
