function parseDeploymentStackScope()

in src/config.ts [266:305]


function parseDeploymentStackScope():
  | ManagementGroupScope
  | SubscriptionScope
  | ResourceGroupScope {
  const type = getRequiredEnumInput("scope", [
    "managementGroup",
    "subscription",
    "resourceGroup",
  ]);
  const tenantId = getOptionalStringInput("tenant-id");

  switch (type) {
    case "managementGroup": {
      const managementGroup = getRequiredStringInput("management-group-id");
      return {
        type,
        tenantId,
        managementGroup,
      };
    }
    case "subscription": {
      const subscriptionId = getRequiredStringInput("subscription-id");
      return {
        type,
        tenantId,
        subscriptionId,
      };
    }
    case "resourceGroup": {
      const subscriptionId = getRequiredStringInput("subscription-id");
      const resourceGroup = getRequiredStringInput("resource-group-name");
      return {
        type,
        tenantId,
        subscriptionId,
        resourceGroup,
      };
    }
  }
}