Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function main(projectId, region, clusterName) {
// [START dataproc_create_cluster]
const dataproc = require('@google-cloud/dataproc').v1;
// Create a client with the endpoint set to the desired cluster region
const client = new dataproc.v1.ClusterControllerClient({
apiEndpoint: `${region}-dataproc.googleapis.com`,
});
async function createCluster() {
// TODO(developer): Uncomment and set the following variables
// projectId = 'YOUR_PROJECT_ID'
// region = 'YOUR_CLUSTER_REGION'
// clusterName = 'YOUR_CLUSTER_NAME'
// Create the cluster config
const request = {
projectId: projectId,
region: region,
cluster: {
clusterName: clusterName,
config: {