Problem in the migration of instances by the APP Service

Hello,

I made a function to use in APP Services, where they run Scale UP and Scale Down instances in the mongodb cluster, but when Triggers fire and execute the function, for example:
M60 (Low-CPU) it migrates to the M50 it stays as General does not maintain the (Low-CPU).

I tried to find something in this documentation but I couldn’t find it:
https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Multi-Cloud-Clusters/operation/updateCluster

My Function is this:

exports = async function() {
  
  // Forneça projectID e clusterNames...
  const projectID = 'XXXXXXXXXXXXXXXXXXXXX';
  const clusterName = 'cloud-prod';

  // Obter credenciais armazenadas...
  const username = context.values.get("AtlasPublicKey");
  const password = context.values.get("AtlasPrivadeKeySecret");

  // Defina o tamanho de instância desejado...
  const body =    {
      "providerSettings" : {
        "providerName" : "AWS",
        "instanceSizeName" : "M50"
      }
    };
  
  result = await context.functions.execute('modifyCluster', username, password, projectID, clusterName, body);
  console.log(EJSON.stringify(result));
  
  if (result.error) {
    return result;
  }

  return clusterName + " scaled down"; 
};

I found this doc where the available instances are mentioned, I changed it to R (Low-CPU):

Cluster Tier & API Naming Conventions
For purposes of management with the Atlas Administration API, cluster tier names that are prepended with R instead of an M (R40 for example) run a low-CPU version of the cluster. When creating or modifying a cluster with the API, be sure to specify your desired cluster class by name with the providerSettings.instanceSizeName attribute.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.