'Creates the API GW domain and returns the resulting DNS name.'

def create_domain_name(self, domain_name, certificate_name, certificate_body=None, certificate_private_key=None, certificate_chain=None, certificate_arn=None, lambda_name=None, stage=None):

    if (not certificate_arn):
        agw_response = self.apigateway_client.create_domain_name(domainName=domain_name, certificateName=certificate_name, certificateBody=certificate_body, certificatePrivateKey=certificate_private_key, certificateChain=certificate_chain)
    else:
        agw_response = self.apigateway_client.create_domain_name(domainName=domain_name, certificateName=certificate_name, certificateArn=certificate_arn)
    api_id = self.get_api_id(lambda_name)
    if (not api_id):
        raise LookupError('No    API    URL    to    certify    found    -    did    you    deploy?')
    self.apigateway_client.create_base_path_mapping(domainName=domain_name, basePath='', restApiId=api_id, stage=stage)
    return agw_response['distributionDomainName']
