def create_cluster(api, project, region, cluster_name, init_file_url):
  """Create a DataProc clsuter."""
  cluster_data = {
    'projectId': project,
    'clusterName': cluster_name,
    'config': {
        'gceClusterConfig': {
        },
        'initializationActions': {
             'executableFile': init_file_url
        }
    }
  }
  result = api.projects().regions().clusters().create(
      projectId=project,
      region=region,
      body=cluster_data).execute()
  return result