'Create the API Gateway for this Zappa deployment.
Returns the new RestAPI CF resource.'

def create_api_gateway_routes(self, lambda_arn, api_name=None, api_key_required=False, authorization_type='NONE', authorizer=None, cors_options=None, description=None):

    restapi = troposphere.apigateway.RestApi('Api')
    restapi.Name = (api_name or lambda_arn.split(':')[(-1)])
    if (not description):
        description = 'Created    automatically    by    Zappa.'
    restapi.Description = description
    self.cf_template.add_resource(restapi)
    root_id = troposphere.GetAtt(restapi, 'RootResourceId')
    invocations_uri = (((('arn:aws:apigateway:' + self.boto_session.region_name) + ':lambda:path/2015-03-31/functions/') + lambda_arn) + '/invocations')
    authorizer_resource = None
    if authorizer:
        authorizer_lambda_arn = authorizer.get('arn', lambda_arn)
        lambda_uri = 'arn:aws:apigateway:{region_name}:lambda:path/2015-03-31/functions/{lambda_arn}/invocations'.format(region_name=self.boto_session.region_name, lambda_arn=authorizer_lambda_arn)
        authorizer_resource = self.create_authorizer(restapi, lambda_uri, authorizer)
    self.create_and_setup_methods(restapi, root_id, api_key_required, invocations_uri, authorization_type, authorizer_resource, 0)
    if cors_options:
        self.create_and_setup_cors(restapi, root_id, invocations_uri, 0, cors_options)
    resource = troposphere.apigateway.Resource('ResourceAnyPathSlashed')
    self.cf_api_resources.append(resource.title)
    resource.RestApiId = troposphere.Ref(restapi)
    resource.ParentId = root_id
    resource.PathPart = '{proxy+}'
    self.cf_template.add_resource(resource)
    self.create_and_setup_methods(restapi, resource, api_key_required, invocations_uri, authorization_type, authorizer_resource, 1)
    if cors_options:
        self.create_and_setup_cors(restapi, resource, invocations_uri, 1, cors_options)
    return restapi
