"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
Object.defineProperty(exports, "CoreOutput", {
  enumerable: true,
  get: function () {
    return _pulumiAws.CoreOutput;
  }
});
Object.defineProperty(exports, "configureAdminCognitoFederation", {
  enumerable: true,
  get: function () {
    return _pulumiAws.configureAdminCognitoFederation;
  }
});
exports.createCoreApp = createCoreApp;
var _pulumiAws = require("@webiny/pulumi-aws");
var _plugins = require("./core/plugins");
function createCoreApp(projectAppParams = {}) {
  const builtInPlugins = [];
  if (projectAppParams.elasticSearch || projectAppParams.openSearch) {
    builtInPlugins.push(_plugins.generateDdbToEsHandler);
    if (projectAppParams.elasticSearch) {
      builtInPlugins.push(_plugins.checkEsServiceRole);
    } else {
      builtInPlugins.push(_plugins.checkOsServiceRole);
    }
  }
  const customPlugins = projectAppParams.plugins ? [...projectAppParams.plugins] : [];
  return {
    id: "core",
    name: "Core",
    description: "Your project's stateful cloud infrastructure resources.",
    cli: {
      // Default args for the "yarn webiny watch ..." command (we don't need the deploy option while developing).
      watch: {
        // We disable local development for all AWS Lambda functions.
        // This can be changed down the line by passing another set of values
        // to the "watch" command (for example `-f ps-render-subscriber`).
        function: "none"
      }
    },
    pulumi: (0, _pulumiAws.createCorePulumiApp)(projectAppParams),
    plugins: [builtInPlugins, customPlugins]
  };
}

//# sourceMappingURL=createCoreApp.js.map