@webiny/project-aws 6.6.0-alpha.12 → 6.6.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/_templates/appTemplates/api/graphql/package.json +2 -2
  2. package/_templates/appTemplates/api/graphql/src/index.ts +2 -2
  3. package/_templates/appTemplates/api/graphql/src/web.ts +1 -1
  4. package/_templates/extensions/OpenSearch/api/graphql/src/index.ts +2 -2
  5. package/_templates/extensions/OpenSearch/api/graphql/src/web.ts +1 -1
  6. package/_templates/extensions/Postgres/api/graphql/src/index.ts +3 -6
  7. package/_templates/extensions/Postgres/api/graphql/src/web.ts +1 -1
  8. package/api.d.ts +6 -6
  9. package/api.js +3 -2
  10. package/api.js.map +1 -1
  11. package/decorators/GetPulumiServiceWithDownloadInfo.d.ts +1 -3
  12. package/decorators/GetPulumiServiceWithDownloadInfo.js +15 -11
  13. package/decorators/GetPulumiServiceWithDownloadInfo.js.map +1 -1
  14. package/extensions/AuroraPostgresCluster.d.ts +12 -0
  15. package/extensions/{Postgres.js → AuroraPostgresCluster.js} +7 -7
  16. package/extensions/AuroraPostgresCluster.js.map +1 -0
  17. package/extensions/Postgres/AddCorePostgres.d.ts +1 -1
  18. package/extensions/Postgres/AddCorePostgres.js +0 -2
  19. package/extensions/Postgres/AddCorePostgres.js.map +1 -1
  20. package/extensions/Postgres/CopyPgModulesAfterApiBuild.d.ts +4 -3
  21. package/extensions/Postgres/CopyPgModulesAfterApiBuild.js.map +1 -1
  22. package/extensions/Postgres/ReplaceApiLambdaFnHandlers.d.ts +3 -3
  23. package/extensions/Postgres/ReplaceApiLambdaFnHandlers.js.map +1 -1
  24. package/extensions/Postgres/ValidatePostgresBeforeCoreDeploy.d.ts +1 -1
  25. package/extensions/Postgres/ValidatePostgresBeforeCoreDeploy.js +3 -3
  26. package/extensions/Postgres/ValidatePostgresBeforeCoreDeploy.js.map +1 -1
  27. package/extensions/Postgres/copyPgRuntimeModules.d.ts +1 -1
  28. package/extensions/Postgres/copyPgRuntimeModules.js +2 -2
  29. package/extensions/Postgres/copyPgRuntimeModules.js.map +1 -1
  30. package/extensions/ProjectAws/EnsurePostgresSetupUnchanged.d.ts +2 -2
  31. package/extensions/ProjectAws/EnsurePostgresSetupUnchanged.js +1 -1
  32. package/extensions/ProjectAws/EnsurePostgresSetupUnchanged.js.map +1 -1
  33. package/extensions/ProjectAws/RefuseApiWatchWithPostgres.d.ts +3 -3
  34. package/extensions/ProjectAws/RefuseApiWatchWithPostgres.js +1 -1
  35. package/extensions/ProjectAws/RefuseApiWatchWithPostgres.js.map +1 -1
  36. package/extensions/definitions.js +2 -4
  37. package/extensions/definitions.js.map +1 -1
  38. package/extensions/index.d.ts +3 -3
  39. package/extensions/index.js +3 -4
  40. package/extensions/registerExtensionImplementations.js +3 -5
  41. package/extensions/registerExtensionImplementations.js.map +1 -1
  42. package/infra.d.ts +2 -8
  43. package/infra.js +6 -10
  44. package/infra.js.map +1 -1
  45. package/package.json +19 -18
  46. package/project.d.ts +1 -0
  47. package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
  48. package/pulumi/apps/api/ApiGraphql.js.map +1 -1
  49. package/pulumi/apps/api/ApiGraphqlWeb.js.map +1 -1
  50. package/pulumi/apps/api/ApiOutput.js.map +1 -1
  51. package/pulumi/apps/api/ApiSchemaSetup.d.ts +2 -2
  52. package/pulumi/apps/api/ApiSchemaSetup.js +1 -1
  53. package/pulumi/apps/api/ApiSchemaSetup.js.map +1 -1
  54. package/pulumi/apps/api/apiDynamoDb.js.map +1 -1
  55. package/pulumi/apps/api/backgroundTask/types.js.map +1 -1
  56. package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
  57. package/pulumi/apps/common/CoreOutput.js.map +1 -1
  58. package/pulumi/apps/core/CoreCognito.d.ts +14 -0
  59. package/pulumi/apps/core/CoreCognito.js +34 -1
  60. package/pulumi/apps/core/CoreCognito.js.map +1 -1
  61. package/pulumi/apps/core/CorePostgres.d.ts +4 -4
  62. package/pulumi/apps/core/CorePostgres.js +2 -1
  63. package/pulumi/apps/core/CorePostgres.js.map +1 -1
  64. package/pulumi/apps/core/cognitoIdentityProviders/configure.js +11 -0
  65. package/pulumi/apps/core/cognitoIdentityProviders/configure.js.map +1 -1
  66. package/pulumi/apps/core/coreDynamoDb.d.ts +2 -2
  67. package/pulumi/apps/core/coreDynamoDb.js.map +1 -1
  68. package/pulumi/apps/core/coreServiceManifests.d.ts +6 -4
  69. package/pulumi/apps/core/coreServiceManifests.js.map +1 -1
  70. package/pulumi/apps/core/coreVpcEndpoints.d.ts +2 -2
  71. package/pulumi/apps/core/coreVpcEndpoints.js.map +1 -1
  72. package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
  73. package/pulumi/apps/extensions/getPostgresConfigFromExtension.d.ts +4 -2
  74. package/pulumi/apps/extensions/getPostgresConfigFromExtension.js +4 -3
  75. package/pulumi/apps/extensions/getPostgresConfigFromExtension.js.map +1 -1
  76. package/pulumi/apps/extensions/projectUsesPostgres.d.ts +1 -1
  77. package/pulumi/apps/extensions/projectUsesPostgres.js.map +1 -1
  78. package/pulumi/apps/react/adminSettingsItem.d.ts +1 -1
  79. package/pulumi/apps/react/adminSettingsItem.js.map +1 -1
  80. package/pulumi/apps/react/createReactPulumiApp.js.map +1 -1
  81. package/pulumi/types.d.ts +2 -2
  82. package/pulumi/utils/lambdaEnvVariables.js +2 -2
  83. package/pulumi/utils/lambdaEnvVariables.js.map +1 -1
  84. package/pulumi/utils/withServiceManifest.d.ts +2 -2
  85. package/pulumi/utils/withServiceManifest.js.map +1 -1
  86. package/services/PulumiGetStackOutputService/mapStackOutput.js +1 -1
  87. package/services/PulumiGetStackOutputService/mapStackOutput.js.map +1 -1
  88. package/extensions/Postgres.d.ts +0 -11
  89. package/extensions/Postgres.js.map +0 -1
  90. package/extensions/RdsProxy/EnsurePostgresWithRdsProxy.d.ts +0 -14
  91. package/extensions/RdsProxy/EnsurePostgresWithRdsProxy.js +0 -23
  92. package/extensions/RdsProxy/EnsurePostgresWithRdsProxy.js.map +0 -1
  93. package/extensions/RdsProxy.d.ts +0 -9
  94. package/extensions/RdsProxy.js +0 -31
  95. package/extensions/RdsProxy.js.map +0 -1
  96. package/pulumi/apps/extensions/getRdsProxyConfigFromExtension.d.ts +0 -5
  97. package/pulumi/apps/extensions/getRdsProxyConfigFromExtension.js +0 -8
  98. package/pulumi/apps/extensions/getRdsProxyConfigFromExtension.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ProjectAws/EnsurePostgresSetupUnchanged.js","sources":["../../../src/extensions/ProjectAws/EnsurePostgresSetupUnchanged.ts"],"sourcesContent":["import { CoreBeforeDeploy } from \"@webiny/project-extensions-aws/abstractions/index.js\";\nimport { CoreStackOutputService } from \"@webiny/project-extensions-aws/abstractions/index.js\";\nimport { GetProjectConfigService } from \"@webiny/project/abstractions/index.js\";\nimport { DatabaseSetup } from \"@webiny/project/extensions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nconst POSTGRES = \"pg\";\n\n/**\n * A core deployed with DynamoDB can't move to Postgres in place, nor the other way round: the data\n * lives in a different database. Compares the database setup the core was deployed with (its stack\n * output) with the one the project config now asks for. A first deploy has nothing to compare.\n *\n * Rendered by `ProjectAws`, not by `<Infra.Postgres />`, so it also runs when `<Infra.Postgres />`\n * is removed from a project that was deployed with it.\n */\nexport class EnsurePostgresSetupUnchangedImpl implements CoreBeforeDeploy.Interface {\n constructor(\n private coreStackOutputService: CoreStackOutputService.Interface,\n private getProjectConfigService: GetProjectConfigService.Interface\n ) {}\n\n async execute() {\n const output = await this.coreStackOutputService.execute();\n const deployedSetup = output?.databaseSetup;\n if (!deployedSetup) {\n return;\n }\n\n const projectConfig = await this.getProjectConfigService.execute();\n const [databaseSetupExtension] = projectConfig.extensionsByType(DatabaseSetup);\n const configuredSetup = databaseSetupExtension?.params.setupName ?? \"ddb\";\n\n const wasPostgres = deployedSetup === POSTGRES;\n const isPostgres = configuredSetup === POSTGRES;\n if (wasPostgres === isPostgres) {\n return;\n }\n\n const error = isPostgres\n ? new Error(\n `Cannot deploy with Postgres. The Core application was deployed with the \"${deployedSetup}\" database setup.`\n )\n : new Error(\n `Cannot deploy without Postgres. The Core application was deployed with the \"${POSTGRES}\" database setup.`\n );\n\n throw GracefulError.from(\n error,\n [\n \"Once a project is deployed, it can't switch between %s and %s.\",\n \"\",\n \"Your options:\",\n \"• To switch, destroy the project and deploy it again from scratch.\",\n \"• To keep the current database, change your %s config file back (%s).\"\n ].join(\"\\n\"),\n \"DynamoDB\",\n \"Postgres\",\n \"webiny.config.tsx\",\n isPostgres ? \"remove <Infra.Postgres />\" : \"add <Infra.Postgres />\"\n );\n }\n}\n\nexport const EnsurePostgresSetupUnchanged = CoreBeforeDeploy.createImplementation({\n implementation: EnsurePostgresSetupUnchangedImpl,\n dependencies: [CoreStackOutputService, GetProjectConfigService]\n});\n"],"names":["POSTGRES","EnsurePostgresSetupUnchangedImpl","coreStackOutputService","getProjectConfigService","output","deployedSetup","projectConfig","databaseSetupExtension","DatabaseSetup","configuredSetup","wasPostgres","isPostgres","error","Error","GracefulError","EnsurePostgresSetupUnchanged","CoreBeforeDeploy","CoreStackOutputService","GetProjectConfigService"],"mappings":";;;;AAMA,MAAMA,WAAW;AAUV,MAAMC;IACT,YACYC,sBAAwD,EACxDC,uBAA0D,CACpE;aAFUD,sBAAsB,GAAtBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,UAAU;QACZ,MAAMC,SAAS,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO;QACxD,MAAMC,gBAAgBD,QAAQ;QAC9B,IAAI,CAACC,eACD;QAGJ,MAAMC,gBAAgB,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO;QAChE,MAAM,CAACC,uBAAuB,GAAGD,cAAc,gBAAgB,CAACE;QAChE,MAAMC,kBAAkBF,wBAAwB,OAAO,aAAa;QAEpE,MAAMG,cAAcL,kBAAkBL;QACtC,MAAMW,aAAaF,oBAAoBT;QACvC,IAAIU,gBAAgBC,YAChB;QAGJ,MAAMC,QAAQD,aACR,IAAIE,MACA,CAAC,yEAAyE,EAAER,cAAc,iBAAiB,CAAC,IAEhH,IAAIQ,MACA,CAAC,4EAA4E,EAAEb,SAAS,iBAAiB,CAAC;QAGpH,MAAMc,cAAc,IAAI,CACpBF,OACA,8NAOA,YACA,YACA,qBACAD,aAAa,8BAA8B;IAEnD;AACJ;AAEO,MAAMI,+BAA+BC,iBAAiB,oBAAoB,CAAC;IAC9E,gBAAgBf;IAChB,cAAc;QAACgB;QAAwBC;KAAwB;AACnE"}
1
+ {"version":3,"file":"extensions/ProjectAws/EnsurePostgresSetupUnchanged.js","sources":["../../../src/extensions/ProjectAws/EnsurePostgresSetupUnchanged.ts"],"sourcesContent":["import { CoreBeforeDeploy } from \"@webiny/project-extensions-aws/abstractions/index.js\";\nimport { CoreStackOutputService } from \"@webiny/project-extensions-aws/abstractions/index.js\";\nimport { GetProjectConfigService } from \"@webiny/project/abstractions/index.js\";\nimport { DatabaseSetup } from \"@webiny/project/extensions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nconst POSTGRES = \"pg\";\n\n/**\n * A core deployed with DynamoDB can't move to Postgres in place, nor the other way round: the data\n * lives in a different database. Compares the database setup the core was deployed with (its stack\n * output) with the one the project config now asks for. A first deploy has nothing to compare.\n *\n * Rendered by `ProjectAws`, not by `<Infra.AuroraPostgres />`, so it also runs when\n * `<Infra.AuroraPostgres />` is removed from a project that was deployed with it.\n */\nexport class EnsurePostgresSetupUnchangedImpl implements CoreBeforeDeploy.Interface {\n constructor(\n private coreStackOutputService: CoreStackOutputService.Interface,\n private getProjectConfigService: GetProjectConfigService.Interface\n ) {}\n\n async execute() {\n const output = await this.coreStackOutputService.execute();\n const deployedSetup = output?.databaseSetup;\n if (!deployedSetup) {\n return;\n }\n\n const projectConfig = await this.getProjectConfigService.execute();\n const [databaseSetupExtension] = projectConfig.extensionsByType(DatabaseSetup);\n const configuredSetup = databaseSetupExtension?.params.setupName ?? \"ddb\";\n\n const wasPostgres = deployedSetup === POSTGRES;\n const isPostgres = configuredSetup === POSTGRES;\n if (wasPostgres === isPostgres) {\n return;\n }\n\n const error = isPostgres\n ? new Error(\n `Cannot deploy with Postgres. The Core application was deployed with the \"${deployedSetup}\" database setup.`\n )\n : new Error(\n `Cannot deploy without Postgres. The Core application was deployed with the \"${POSTGRES}\" database setup.`\n );\n\n throw GracefulError.from(\n error,\n [\n \"Once a project is deployed, it can't switch between %s and %s.\",\n \"\",\n \"Your options:\",\n \"• To switch, destroy the project and deploy it again from scratch.\",\n \"• To keep the current database, change your %s config file back (%s).\"\n ].join(\"\\n\"),\n \"DynamoDB\",\n \"Postgres\",\n \"webiny.config.tsx\",\n isPostgres ? \"remove <Infra.AuroraPostgres />\" : \"add <Infra.AuroraPostgres />\"\n );\n }\n}\n\nexport const EnsurePostgresSetupUnchanged = CoreBeforeDeploy.createImplementation({\n implementation: EnsurePostgresSetupUnchangedImpl,\n dependencies: [CoreStackOutputService, GetProjectConfigService]\n});\n"],"names":["POSTGRES","EnsurePostgresSetupUnchangedImpl","coreStackOutputService","getProjectConfigService","output","deployedSetup","projectConfig","databaseSetupExtension","DatabaseSetup","configuredSetup","wasPostgres","isPostgres","error","Error","GracefulError","EnsurePostgresSetupUnchanged","CoreBeforeDeploy","CoreStackOutputService","GetProjectConfigService"],"mappings":";;;;AAMA,MAAMA,WAAW;AAUV,MAAMC;IACT,YACYC,sBAAwD,EACxDC,uBAA0D,CACpE;aAFUD,sBAAsB,GAAtBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,UAAU;QACZ,MAAMC,SAAS,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO;QACxD,MAAMC,gBAAgBD,QAAQ;QAC9B,IAAI,CAACC,eACD;QAGJ,MAAMC,gBAAgB,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO;QAChE,MAAM,CAACC,uBAAuB,GAAGD,cAAc,gBAAgB,CAACE;QAChE,MAAMC,kBAAkBF,wBAAwB,OAAO,aAAa;QAEpE,MAAMG,cAAcL,kBAAkBL;QACtC,MAAMW,aAAaF,oBAAoBT;QACvC,IAAIU,gBAAgBC,YAChB;QAGJ,MAAMC,QAAQD,aACR,IAAIE,MACA,CAAC,yEAAyE,EAAER,cAAc,iBAAiB,CAAC,IAEhH,IAAIQ,MACA,CAAC,4EAA4E,EAAEb,SAAS,iBAAiB,CAAC;QAGpH,MAAMc,cAAc,IAAI,CACpBF,OACA,8NAOA,YACA,YACA,qBACAD,aAAa,oCAAoC;IAEzD;AACJ;AAEO,MAAMI,+BAA+BC,iBAAiB,oBAAoB,CAAC;IAC9E,gBAAgBf;IAChB,cAAc;QAACgB;QAAwBC;KAAwB;AACnE"}
@@ -3,9 +3,9 @@ import { GetProjectConfigService } from "@webiny/project/abstractions/index.js";
3
3
  import { ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
4
4
  /**
5
5
  * Watching the API on AWS replaces the deployed functions with forwarders and runs every request
6
- * on the developer's machine, with the deployed function's env. With `<Infra.Postgres />` that env
7
- * points at Aurora in the VPC's private subnets, which the machine can't reach, so every request
8
- * would time out. Watch is refused before anything is built or replaced.
6
+ * on the developer's machine, with the deployed function's env. With `<Infra.AuroraPostgres />`
7
+ * that env points at Aurora in the VPC's private subnets, which the machine can't reach, so every
8
+ * request would time out. Watch is refused before anything is built or replaced.
9
9
  *
10
10
  * Unconditional: `--no-deployment-checks` doesn't skip it, because watch can't work at all.
11
11
  */
@@ -12,7 +12,7 @@ class RefuseApiWatchWithPostgresImpl {
12
12
  const error = new Error("Cannot watch the API of a project that uses Postgres on AWS.");
13
13
  const sdkParams = this.projectSdkParamsService.get();
14
14
  const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;
15
- throw GracefulError.from(error, "Watch isn't supported with %s on AWS: the database is in the VPC's private subnets, which your machine can't reach. To try your changes, deploy them instead by running: %s.", "<Infra.Postgres />", cmd);
15
+ throw GracefulError.from(error, "Watch isn't supported with %s on AWS: the database is in the VPC's private subnets, which your machine can't reach. To try your changes, deploy them instead by running: %s.", "<Infra.AuroraPostgres />", cmd);
16
16
  }
17
17
  }
18
18
  const RefuseApiWatchWithPostgres = ApiBeforeWatch.createImplementation({
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ProjectAws/RefuseApiWatchWithPostgres.js","sources":["../../../src/extensions/ProjectAws/RefuseApiWatchWithPostgres.ts"],"sourcesContent":["import { ApiBeforeWatch } from \"@webiny/project/abstractions/index.js\";\nimport { GetProjectConfigService } from \"@webiny/project/abstractions/index.js\";\nimport { ProjectSdkParamsService } from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\nimport { getPostgresConfigFromExtension } from \"~/pulumi/apps/extensions/getPostgresConfigFromExtension.js\";\n\n/**\n * Watching the API on AWS replaces the deployed functions with forwarders and runs every request\n * on the developer's machine, with the deployed function's env. With `<Infra.Postgres />` that env\n * points at Aurora in the VPC's private subnets, which the machine can't reach, so every request\n * would time out. Watch is refused before anything is built or replaced.\n *\n * Unconditional: `--no-deployment-checks` doesn't skip it, because watch can't work at all.\n */\nexport class RefuseApiWatchWithPostgresImpl implements ApiBeforeWatch.Interface {\n constructor(\n private getProjectConfigService: GetProjectConfigService.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute() {\n const projectConfig = await this.getProjectConfigService.execute();\n if (!getPostgresConfigFromExtension(projectConfig)) {\n return;\n }\n\n const error = new Error(`Cannot watch the API of a project that uses Postgres on AWS.`);\n const sdkParams = this.projectSdkParamsService.get();\n const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;\n\n throw GracefulError.from(\n error,\n [\n \"Watch isn't supported with %s on AWS: the database is in the VPC's private\",\n \"subnets, which your machine can't reach. To try your changes, deploy them\",\n \"instead by running: %s.\"\n ].join(\" \"),\n \"<Infra.Postgres />\",\n cmd\n );\n }\n}\n\nexport const RefuseApiWatchWithPostgres = ApiBeforeWatch.createImplementation({\n implementation: RefuseApiWatchWithPostgresImpl,\n dependencies: [GetProjectConfigService, ProjectSdkParamsService]\n});\n"],"names":["RefuseApiWatchWithPostgresImpl","getProjectConfigService","projectSdkParamsService","projectConfig","getPostgresConfigFromExtension","error","Error","sdkParams","cmd","GracefulError","RefuseApiWatchWithPostgres","ApiBeforeWatch","GetProjectConfigService","ProjectSdkParamsService"],"mappings":";;;AAcO,MAAMA;IACT,YACYC,uBAA0D,EAC1DC,uBAA0D,CACpE;aAFUD,uBAAuB,GAAvBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,UAAU;QACZ,MAAMC,gBAAgB,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO;QAChE,IAAI,CAACC,+BAA+BD,gBAChC;QAGJ,MAAME,QAAQ,IAAIC,MAAM;QACxB,MAAMC,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAMC,MAAM,CAAC,6BAA6B,EAAED,UAAU,GAAG,EAAE;QAE3D,MAAME,cAAc,IAAI,CACpBJ,OACA,gLAKA,sBACAG;IAER;AACJ;AAEO,MAAME,6BAA6BC,eAAe,oBAAoB,CAAC;IAC1E,gBAAgBX;IAChB,cAAc;QAACY;QAAyBC;KAAwB;AACpE"}
1
+ {"version":3,"file":"extensions/ProjectAws/RefuseApiWatchWithPostgres.js","sources":["../../../src/extensions/ProjectAws/RefuseApiWatchWithPostgres.ts"],"sourcesContent":["import { ApiBeforeWatch } from \"@webiny/project/abstractions/index.js\";\nimport { GetProjectConfigService } from \"@webiny/project/abstractions/index.js\";\nimport { ProjectSdkParamsService } from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\nimport { getPostgresConfigFromExtension } from \"~/pulumi/apps/extensions/getPostgresConfigFromExtension.js\";\n\n/**\n * Watching the API on AWS replaces the deployed functions with forwarders and runs every request\n * on the developer's machine, with the deployed function's env. With `<Infra.AuroraPostgres />`\n * that env points at Aurora in the VPC's private subnets, which the machine can't reach, so every\n * request would time out. Watch is refused before anything is built or replaced.\n *\n * Unconditional: `--no-deployment-checks` doesn't skip it, because watch can't work at all.\n */\nexport class RefuseApiWatchWithPostgresImpl implements ApiBeforeWatch.Interface {\n constructor(\n private getProjectConfigService: GetProjectConfigService.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute() {\n const projectConfig = await this.getProjectConfigService.execute();\n if (!getPostgresConfigFromExtension(projectConfig)) {\n return;\n }\n\n const error = new Error(`Cannot watch the API of a project that uses Postgres on AWS.`);\n const sdkParams = this.projectSdkParamsService.get();\n const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;\n\n throw GracefulError.from(\n error,\n [\n \"Watch isn't supported with %s on AWS: the database is in the VPC's private\",\n \"subnets, which your machine can't reach. To try your changes, deploy them\",\n \"instead by running: %s.\"\n ].join(\" \"),\n \"<Infra.AuroraPostgres />\",\n cmd\n );\n }\n}\n\nexport const RefuseApiWatchWithPostgres = ApiBeforeWatch.createImplementation({\n implementation: RefuseApiWatchWithPostgresImpl,\n dependencies: [GetProjectConfigService, ProjectSdkParamsService]\n});\n"],"names":["RefuseApiWatchWithPostgresImpl","getProjectConfigService","projectSdkParamsService","projectConfig","getPostgresConfigFromExtension","error","Error","sdkParams","cmd","GracefulError","RefuseApiWatchWithPostgres","ApiBeforeWatch","GetProjectConfigService","ProjectSdkParamsService"],"mappings":";;;AAcO,MAAMA;IACT,YACYC,uBAA0D,EAC1DC,uBAA0D,CACpE;aAFUD,uBAAuB,GAAvBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,UAAU;QACZ,MAAMC,gBAAgB,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO;QAChE,IAAI,CAACC,+BAA+BD,gBAChC;QAGJ,MAAME,QAAQ,IAAIC,MAAM;QACxB,MAAMC,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAMC,MAAM,CAAC,6BAA6B,EAAED,UAAU,GAAG,EAAE;QAE3D,MAAME,cAAc,IAAI,CACpBJ,OACA,gLAKA,4BACAG;IAER;AACJ;AAEO,MAAME,6BAA6BC,eAAe,oBAAoB,CAAC;IAC1E,gBAAgBX;IAChB,cAAc;QAACY;QAAyBC;KAAwB;AACpE"}
@@ -1,12 +1,10 @@
1
1
  import { ApiLambdaFunction } from "./ApiLambdaFunction.js";
2
2
  import { OpenSearch } from "./OpenSearch.js";
3
- import { Postgres } from "./Postgres.js";
4
- import { RdsProxy } from "./RdsProxy.js";
3
+ import { AuroraPostgresCluster } from "./AuroraPostgresCluster.js";
5
4
  const definitions = [
6
5
  ApiLambdaFunction.def,
7
6
  OpenSearch.def,
8
- Postgres.def,
9
- RdsProxy.def
7
+ AuroraPostgresCluster.def
10
8
  ];
11
9
  const extensions_definitions = definitions;
12
10
  export default extensions_definitions;
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/definitions.js","sources":["../../src/extensions/definitions.ts"],"sourcesContent":["import { ApiLambdaFunction } from \"./ApiLambdaFunction.js\";\nimport { OpenSearch } from \"./OpenSearch.js\";\nimport { Postgres } from \"./Postgres.js\";\nimport { RdsProxy } from \"./RdsProxy.js\";\nimport { type ExtensionDefinitionModel } from \"@webiny/project/defineExtension\";\n\nconst definitions = [\n ApiLambdaFunction.def,\n OpenSearch.def,\n Postgres.def,\n RdsProxy.def\n] as unknown as ExtensionDefinitionModel<any>[];\n\nexport default definitions;\n"],"names":["definitions","ApiLambdaFunction","OpenSearch","Postgres","RdsProxy"],"mappings":";;;;AAMA,MAAMA,cAAc;IAChBC,kBAAkB,GAAG;IACrBC,WAAW,GAAG;IACdC,SAAS,GAAG;IACZC,SAAS,GAAG;CACf;AAED,+BAAeJ"}
1
+ {"version":3,"file":"extensions/definitions.js","sources":["../../src/extensions/definitions.ts"],"sourcesContent":["import { ApiLambdaFunction } from \"./ApiLambdaFunction.js\";\nimport { OpenSearch } from \"./OpenSearch.js\";\nimport { AuroraPostgresCluster } from \"./AuroraPostgresCluster.js\";\nimport { type ExtensionDefinitionModel } from \"@webiny/project/defineExtension\";\n\nconst definitions = [\n ApiLambdaFunction.def,\n OpenSearch.def,\n AuroraPostgresCluster.def\n] as unknown as ExtensionDefinitionModel<any>[];\n\nexport default definitions;\n"],"names":["definitions","ApiLambdaFunction","OpenSearch","AuroraPostgresCluster"],"mappings":";;;AAKA,MAAMA,cAAc;IAChBC,kBAAkB,GAAG;IACrBC,WAAW,GAAG;IACdC,sBAAsB,GAAG;CAC5B;AAED,+BAAeH"}
@@ -1,9 +1,9 @@
1
1
  export * from "./OpenSearch.js";
2
- export * from "./Postgres.js";
3
- export * from "./RdsProxy.js";
2
+ export * from "./AuroraPostgresCluster.js";
3
+ export { AuroraPostgres } from "@webiny/project-extensions-aws/extensions/index.js";
4
4
  export { AwsDefaultRegion, AutoInstall } from "@webiny/project-extensions-aws/extensions/index.js";
5
5
  export * from "./ProjectAws.js";
6
6
  export * from "./ApiLambdaFunction.js";
7
7
  export * from "./ApiRoute.js";
8
- export { Smtp as MailerSmtp } from "@webiny/project/extensions/api/index.js";
9
8
  export { ApiWebFunction } from "@webiny/project-extensions-aws/extensions/index.js";
9
+ export { MailerSmtp } from "@webiny/mailer-smtp";
@@ -1,8 +1,7 @@
1
1
  export * from "./OpenSearch.js";
2
- export * from "./Postgres.js";
3
- export * from "./RdsProxy.js";
2
+ export * from "./AuroraPostgresCluster.js";
4
3
  export * from "./ProjectAws.js";
5
4
  export * from "./ApiLambdaFunction.js";
6
5
  export * from "./ApiRoute.js";
7
- export { ApiWebFunction, AutoInstall, AwsDefaultRegion } from "@webiny/project-extensions-aws/extensions/index.js";
8
- export { Smtp as MailerSmtp } from "@webiny/project/extensions/api/index.js";
6
+ export { ApiWebFunction, AuroraPostgres, AutoInstall, AwsDefaultRegion } from "@webiny/project-extensions-aws/extensions/index.js";
7
+ export { MailerSmtp } from "@webiny/mailer-smtp";
@@ -1,14 +1,12 @@
1
1
  import { registerExtensionImplementation } from "@webiny/project/extensions/hosting/index.js";
2
- import { ApiLambdaFunction, OpenSearch, Postgres, RdsProxy } from "@webiny/project-extensions-aws/extensions/index.js";
2
+ import { ApiLambdaFunction, AuroraPostgresCluster, OpenSearch } from "@webiny/project-extensions-aws/extensions/index.js";
3
3
  import { ApiRoute } from "@webiny/project/extensions/api/index.js";
4
4
  import { ApiLambdaFunction as external_ApiLambdaFunction_js_ApiLambdaFunction } from "./ApiLambdaFunction.js";
5
5
  import { ApiRoute as external_ApiRoute_js_ApiRoute } from "./ApiRoute.js";
6
6
  import { OpenSearch as external_OpenSearch_js_OpenSearch } from "./OpenSearch.js";
7
- import { Postgres as external_Postgres_js_Postgres } from "./Postgres.js";
8
- import { RdsProxy as external_RdsProxy_js_RdsProxy } from "./RdsProxy.js";
7
+ import { AuroraPostgresCluster as external_AuroraPostgresCluster_js_AuroraPostgresCluster } from "./AuroraPostgresCluster.js";
9
8
  registerExtensionImplementation("aws", OpenSearch, external_OpenSearch_js_OpenSearch);
10
- registerExtensionImplementation("aws", Postgres, external_Postgres_js_Postgres);
11
- registerExtensionImplementation("aws", RdsProxy, external_RdsProxy_js_RdsProxy);
9
+ registerExtensionImplementation("aws", AuroraPostgresCluster, external_AuroraPostgresCluster_js_AuroraPostgresCluster);
12
10
  registerExtensionImplementation("aws", ApiRoute, external_ApiRoute_js_ApiRoute);
13
11
  registerExtensionImplementation("aws", ApiLambdaFunction, external_ApiLambdaFunction_js_ApiLambdaFunction);
14
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/registerExtensionImplementations.js","sources":["../../src/extensions/registerExtensionImplementations.ts"],"sourcesContent":["import { registerExtensionImplementation } from \"@webiny/project/extensions/hosting/index.js\";\nimport { ApiLambdaFunction as ApiLambdaFunctionSpec } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiRoute as ApiRouteSpec } from \"@webiny/project/extensions/api/index.js\";\nimport { OpenSearch as OpenSearchSpec } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { Postgres as PostgresSpec } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { RdsProxy as RdsProxySpec } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiLambdaFunction } from \"./ApiLambdaFunction.js\";\nimport { ApiRoute } from \"./ApiRoute.js\";\nimport { OpenSearch } from \"./OpenSearch.js\";\nimport { Postgres } from \"./Postgres.js\";\nimport { RdsProxy } from \"./RdsProxy.js\";\n\n/*\n * The shared namespaces in `@webiny/extensions` (exported through `webiny/extensions`) only hold\n * specs of these extensions, because what they render depends on code from this package. Running\n * this module makes the shared `Infra.OpenSearch`, `Infra.Postgres`, `Infra.RdsProxy`, `Api.Route`\n * and `Infra.Api.LambdaFunction` render the full components below. `ProjectAws.tsx` imports it,\n * so it runs before any project config renders.\n */\nregisterExtensionImplementation(\"aws\", OpenSearchSpec, OpenSearch);\nregisterExtensionImplementation(\"aws\", PostgresSpec, Postgres);\nregisterExtensionImplementation(\"aws\", RdsProxySpec, RdsProxy);\nregisterExtensionImplementation(\"aws\", ApiRouteSpec, ApiRoute);\nregisterExtensionImplementation(\"aws\", ApiLambdaFunctionSpec, ApiLambdaFunction);\n"],"names":["registerExtensionImplementation","OpenSearchSpec","OpenSearch","PostgresSpec","Postgres","RdsProxySpec","RdsProxy","ApiRouteSpec","ApiRoute","ApiLambdaFunctionSpec","ApiLambdaFunction"],"mappings":";;;;;;;;AAmBAA,gCAAgC,OAAOC,YAAgBC;AACvDF,gCAAgC,OAAOG,UAAcC;AACrDJ,gCAAgC,OAAOK,UAAcC;AACrDN,gCAAgC,OAAOO,UAAcC;AACrDR,gCAAgC,OAAOS,mBAAuBC"}
1
+ {"version":3,"file":"extensions/registerExtensionImplementations.js","sources":["../../src/extensions/registerExtensionImplementations.ts"],"sourcesContent":["import { registerExtensionImplementation } from \"@webiny/project/extensions/hosting/index.js\";\nimport { ApiLambdaFunction as ApiLambdaFunctionSpec } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiRoute as ApiRouteSpec } from \"@webiny/project/extensions/api/index.js\";\nimport { OpenSearch as OpenSearchSpec } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { AuroraPostgresCluster as AuroraPostgresClusterSpec } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiLambdaFunction } from \"./ApiLambdaFunction.js\";\nimport { ApiRoute } from \"./ApiRoute.js\";\nimport { OpenSearch } from \"./OpenSearch.js\";\nimport { AuroraPostgresCluster } from \"./AuroraPostgresCluster.js\";\n\n/*\n * The shared namespaces in `@webiny/extensions` (exported through `webiny/extensions`) only hold\n * specs of these extensions, because what they render depends on code from this package. Running\n * this module makes the shared `Infra.OpenSearch`, `Api.Route` and `Infra.Api.LambdaFunction`, and\n * the internal Aurora cluster `Infra.AuroraPostgres` renders, render the full components below. `ProjectAws.tsx` imports it,\n * so it runs before any project config renders.\n */\nregisterExtensionImplementation(\"aws\", OpenSearchSpec, OpenSearch);\nregisterExtensionImplementation(\"aws\", AuroraPostgresClusterSpec, AuroraPostgresCluster);\nregisterExtensionImplementation(\"aws\", ApiRouteSpec, ApiRoute);\nregisterExtensionImplementation(\"aws\", ApiLambdaFunctionSpec, ApiLambdaFunction);\n"],"names":["registerExtensionImplementation","OpenSearchSpec","OpenSearch","AuroraPostgresClusterSpec","AuroraPostgresCluster","ApiRouteSpec","ApiRoute","ApiLambdaFunctionSpec","ApiLambdaFunction"],"mappings":";;;;;;;AAiBAA,gCAAgC,OAAOC,YAAgBC;AACvDF,gCAAgC,OAAOG,uBAA2BC;AAClEJ,gCAAgC,OAAOK,UAAcC;AACrDN,gCAAgC,OAAOO,mBAAuBC"}
package/infra.d.ts CHANGED
@@ -43,14 +43,11 @@ export declare const Infra: {
43
43
  }, import("zod/v4/core").$strip>;
44
44
  }, import("zod/v4/core").$strip>>;
45
45
  }, import("zod/v4/core").$strip>>;
46
- Postgres: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
46
+ AuroraPostgres: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
47
47
  minCapacity: import("zod").ZodOptional<import("zod").ZodNumber>;
48
48
  maxCapacity: import("zod").ZodOptional<import("zod").ZodNumber>;
49
49
  readers: import("zod").ZodOptional<import("zod").ZodNumber>;
50
- poolSize: import("zod").ZodOptional<import("zod").ZodNumber>;
51
- }, import("zod/v4/core").$strip>>;
52
- RdsProxy: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
53
- enabled: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>;
50
+ rdsProxy: import("zod").ZodOptional<import("zod").ZodBoolean>;
54
51
  }, import("zod/v4/core").$strip>>;
55
52
  BlueGreenDeployments: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
56
53
  enabled: import("zod").ZodDefault<import("zod").ZodBoolean>;
@@ -256,9 +253,6 @@ export declare const Infra: {
256
253
  username: import("zod").ZodOptional<import("zod").ZodString>;
257
254
  password: import("zod").ZodOptional<import("zod").ZodString>;
258
255
  }, import("zod/v4/core").$strip>>;
259
- RdsProxy: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
260
- enabled: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>;
261
- }, import("zod/v4/core").$strip>>;
262
256
  S3Bucket: {
263
257
  Versioning: import("@webiny/project/defineExtension/defineExtension.js").ExtensionComponent<import("zod").ZodObject<{
264
258
  enabled: import("zod").ZodBoolean;
package/infra.js CHANGED
@@ -1,9 +1,7 @@
1
1
  import { AdminAfterBuild, AdminBeforeBuild, AdminBeforeWatch, ApiAfterBuild, ApiBeforeBuild, ApiBeforeWatch, CoreAfterBuild, CoreBeforeBuild, CoreBeforeWatch, EnvVar, ProductionEnvironments } from "@webiny/project/extensions/index.js";
2
- import { AdminAfterDeploy, AdminBeforeDeploy, AdminStackOutputValue, ApiAfterDeploy, ApiBeforeDeploy, ApiMaxBundleSize, ApiStackOutputValue, ApiWebFunction, CoreAfterDeploy, CoreBeforeDeploy, CoreStackOutputValue, Encryption, Hashing, PulumiResourceNamePrefix } from "@webiny/project-extensions-aws/extensions/index.js";
2
+ import { AdminAfterDeploy, AdminBeforeDeploy, AdminStackOutputValue, ApiAfterDeploy, ApiBeforeDeploy, ApiMaxBundleSize, ApiStackOutputValue, ApiWebFunction, AuroraPostgres, CoreAfterDeploy, CoreBeforeDeploy, CoreStackOutputValue, Encryption, Hashing, PulumiResourceNamePrefix } from "@webiny/project-extensions-aws/extensions/index.js";
3
3
  import { AdminCustomDomains, AdminPulumi, ApiCustomDomains, ApiPulumi, AwsTags, BlueGreenDeployments, CorePulumi, DynamoDbPitr, S3BucketVersioning, Vpc } from "./pulumi/extensions/index.js";
4
4
  import { OpenSearch } from "./extensions/OpenSearch.js";
5
- import { Postgres } from "./extensions/Postgres.js";
6
- import { RdsProxy } from "./extensions/RdsProxy.js";
7
5
  import { AwsDefaultRegion } from "@webiny/project-extensions-aws/extensions/AwsDefaultRegion.js";
8
6
  import { ApiLambdaFunction } from "./extensions/ApiLambdaFunction.js";
9
7
  import { CiIs, CiIsNot, EnvIs, EnvIsNot, EnvIsNotProd, EnvIsProd, useEnv } from "@webiny/project/extensions/infra/index.js";
@@ -20,15 +18,14 @@ const Infra = {
20
18
  },
21
19
  Encryption: Encryption,
22
20
  Vpc: Vpc,
23
- Postgres: Postgres,
24
- RdsProxy: RdsProxy,
21
+ AuroraPostgres: AuroraPostgres,
25
22
  BlueGreenDeployments: BlueGreenDeployments,
26
23
  OpenSearch: OpenSearch,
27
24
  PulumiResourceNamePrefix: PulumiResourceNamePrefix,
28
25
  ProductionEnvironments: ProductionEnvironments,
29
26
  EnvVar: EnvVar,
30
- DynamoDb: DynamoDb,
31
- S3Bucket: S3Bucket,
27
+ DynamoDb,
28
+ S3Bucket,
32
29
  Aws: {
33
30
  DefaultRegion: AwsDefaultRegion,
34
31
  Tags: AwsTags
@@ -75,10 +72,9 @@ const Infra = {
75
72
  AfterDeploy: CoreAfterDeploy,
76
73
  Pulumi: CorePulumi,
77
74
  StackOutputValue: CoreStackOutputValue,
78
- DynamoDb: DynamoDb,
75
+ DynamoDb,
79
76
  OpenSearch: OpenSearch,
80
- RdsProxy: RdsProxy,
81
- S3Bucket: S3Bucket
77
+ S3Bucket
82
78
  }
83
79
  };
84
80
  export { Infra, useEnv };
package/infra.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"infra.js","sources":["../src/infra.ts"],"sourcesContent":["import {\n AdminAfterBuild,\n AdminBeforeBuild,\n AdminBeforeWatch,\n ApiAfterBuild,\n ApiBeforeBuild,\n ApiBeforeWatch,\n CoreAfterBuild,\n CoreBeforeBuild,\n CoreBeforeWatch,\n ProductionEnvironments\n} from \"@webiny/project/extensions/index.js\";\nimport { AdminAfterDeploy } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { AdminBeforeDeploy } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiAfterDeploy } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiBeforeDeploy } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { CoreAfterDeploy } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { CoreBeforeDeploy } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { PulumiResourceNamePrefix } from \"@webiny/project-extensions-aws/extensions/index.js\";\n\nimport { CorePulumi, ApiPulumi, AdminPulumi } from \"./pulumi/extensions/index.js\";\n\nimport {\n AdminCustomDomains,\n ApiCustomDomains,\n AwsTags,\n BlueGreenDeployments,\n DynamoDbPitr,\n S3BucketVersioning,\n Vpc\n} from \"./pulumi/extensions/index.js\";\n\nimport { OpenSearch } from \"./extensions/OpenSearch.js\";\nimport { Postgres } from \"./extensions/Postgres.js\";\nimport { RdsProxy } from \"./extensions/RdsProxy.js\";\nimport { AdminStackOutputValue } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiStackOutputValue } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { CoreStackOutputValue } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { AwsDefaultRegion } from \"@webiny/project-extensions-aws/extensions/AwsDefaultRegion.js\";\nimport { ApiLambdaFunction } from \"./extensions/ApiLambdaFunction.js\";\nimport { EnvVar } from \"@webiny/project/extensions/index.js\";\nimport { Encryption } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { Hashing } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiMaxBundleSize } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiWebFunction } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport {\n EnvIs,\n EnvIsNot,\n EnvIsProd,\n EnvIsNotProd,\n useEnv,\n CiIs,\n CiIsNot\n} from \"@webiny/project/extensions/infra/index.js\";\n\nexport { useEnv };\n\n// Core app resources. Exposed under Infra.Core, and top-level for backward compatibility.\nconst DynamoDb = {\n Pitr: DynamoDbPitr\n};\n\nconst S3Bucket = {\n Versioning: S3BucketVersioning\n};\n\nexport const Infra = {\n // Grouped crypto config surface.\n Crypto: {\n Encryption,\n Hashing\n },\n // Kept top-level for backward compatibility (prefer Infra.Crypto.Encryption going forward).\n Encryption,\n Vpc,\n Postgres,\n // Alias of Infra.Core.RdsProxy (prefer Infra.Core.RdsProxy going forward).\n RdsProxy,\n BlueGreenDeployments,\n // Kept top-level for backward compatibility (prefer Infra.Core.OpenSearch going forward).\n OpenSearch,\n PulumiResourceNamePrefix,\n ProductionEnvironments,\n EnvVar,\n // Kept top-level for backward compatibility (prefer Infra.Core.DynamoDb and Infra.Core.S3Bucket).\n DynamoDb,\n S3Bucket,\n Aws: {\n DefaultRegion: AwsDefaultRegion,\n Tags: AwsTags\n },\n Env: {\n useEnv,\n Is: EnvIs,\n IsNot: EnvIsNot,\n IsProd: EnvIsProd,\n IsNotProd: EnvIsNotProd\n },\n Ci: {\n Is: CiIs,\n IsNot: CiIsNot\n },\n Admin: {\n BeforeBuild: AdminBeforeBuild,\n BeforeDeploy: AdminBeforeDeploy,\n BeforeWatch: AdminBeforeWatch,\n AfterBuild: AdminAfterBuild,\n AfterDeploy: AdminAfterDeploy,\n Pulumi: AdminPulumi,\n CustomDomains: AdminCustomDomains,\n StackOutputValue: AdminStackOutputValue\n },\n Api: {\n BeforeBuild: ApiBeforeBuild,\n BeforeDeploy: ApiBeforeDeploy,\n BeforeWatch: ApiBeforeWatch,\n AfterBuild: ApiAfterBuild,\n AfterDeploy: ApiAfterDeploy,\n Pulumi: ApiPulumi,\n CustomDomains: ApiCustomDomains,\n StackOutputValue: ApiStackOutputValue,\n LambdaFunction: ApiLambdaFunction,\n MaxBundleSize: ApiMaxBundleSize,\n WebFunction: ApiWebFunction\n },\n Core: {\n BeforeBuild: CoreBeforeBuild,\n BeforeDeploy: CoreBeforeDeploy,\n BeforeWatch: CoreBeforeWatch,\n AfterBuild: CoreAfterBuild,\n AfterDeploy: CoreAfterDeploy,\n Pulumi: CorePulumi,\n StackOutputValue: CoreStackOutputValue,\n DynamoDb,\n OpenSearch,\n RdsProxy,\n S3Bucket\n }\n};\n"],"names":["DynamoDb","DynamoDbPitr","S3Bucket","S3BucketVersioning","Infra","Encryption","Hashing","Vpc","Postgres","RdsProxy","BlueGreenDeployments","OpenSearch","PulumiResourceNamePrefix","ProductionEnvironments","EnvVar","AwsDefaultRegion","AwsTags","useEnv","EnvIs","EnvIsNot","EnvIsProd","EnvIsNotProd","CiIs","CiIsNot","AdminBeforeBuild","AdminBeforeDeploy","AdminBeforeWatch","AdminAfterBuild","AdminAfterDeploy","AdminPulumi","AdminCustomDomains","AdminStackOutputValue","ApiBeforeBuild","ApiBeforeDeploy","ApiBeforeWatch","ApiAfterBuild","ApiAfterDeploy","ApiPulumi","ApiCustomDomains","ApiStackOutputValue","ApiLambdaFunction","ApiMaxBundleSize","ApiWebFunction","CoreBeforeBuild","CoreBeforeDeploy","CoreBeforeWatch","CoreAfterBuild","CoreAfterDeploy","CorePulumi","CoreStackOutputValue"],"mappings":";;;;;;;;;AA0DA,MAAMA,WAAW;IACb,MAAMC;AACV;AAEA,MAAMC,WAAW;IACb,YAAYC;AAChB;AAEO,MAAMC,QAAQ;IAEjB,QAAQ;QACJC,YAAUA;QACVC,SAAOA;IACX;IAEAD,YAAUA;IACVE,KAAGA;IACHC,UAAQA;IAERC,UAAQA;IACRC,sBAAoBA;IAEpBC,YAAUA;IACVC,0BAAwBA;IACxBC,wBAAsBA;IACtBC,QAAMA;IAENd,UAAAA;IACAE,UAAAA;IACA,KAAK;QACD,eAAea;QACf,MAAMC;IACV;IACA,KAAK;QACDC,QAAMA;QACN,IAAIC;QACJ,OAAOC;QACP,QAAQC;QACR,WAAWC;IACf;IACA,IAAI;QACA,IAAIC;QACJ,OAAOC;IACX;IACA,OAAO;QACH,aAAaC;QACb,cAAcC;QACd,aAAaC;QACb,YAAYC;QACZ,aAAaC;QACb,QAAQC;QACR,eAAeC;QACf,kBAAkBC;IACtB;IACA,KAAK;QACD,aAAaC;QACb,cAAcC;QACd,aAAaC;QACb,YAAYC;QACZ,aAAaC;QACb,QAAQC;QACR,eAAeC;QACf,kBAAkBC;QAClB,gBAAgBC;QAChB,eAAeC;QACf,aAAaC;IACjB;IACA,MAAM;QACF,aAAaC;QACb,cAAcC;QACd,aAAaC;QACb,YAAYC;QACZ,aAAaC;QACb,QAAQC;QACR,kBAAkBC;QAClBjD,UAAAA;QACAW,YAAUA;QACVF,UAAQA;QACRP,UAAAA;IACJ;AACJ"}
1
+ {"version":3,"file":"infra.js","sources":["../src/infra.ts"],"sourcesContent":["import {\n AdminAfterBuild,\n AdminBeforeBuild,\n AdminBeforeWatch,\n ApiAfterBuild,\n ApiBeforeBuild,\n ApiBeforeWatch,\n CoreAfterBuild,\n CoreBeforeBuild,\n CoreBeforeWatch,\n ProductionEnvironments\n} from \"@webiny/project/extensions/index.js\";\nimport { AdminAfterDeploy } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { AdminBeforeDeploy } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiAfterDeploy } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiBeforeDeploy } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { CoreAfterDeploy } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { CoreBeforeDeploy } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { PulumiResourceNamePrefix } from \"@webiny/project-extensions-aws/extensions/index.js\";\n\nimport { CorePulumi, ApiPulumi, AdminPulumi } from \"./pulumi/extensions/index.js\";\n\nimport {\n AdminCustomDomains,\n ApiCustomDomains,\n AwsTags,\n BlueGreenDeployments,\n DynamoDbPitr,\n S3BucketVersioning,\n Vpc\n} from \"./pulumi/extensions/index.js\";\n\nimport { OpenSearch } from \"./extensions/OpenSearch.js\";\nimport { AuroraPostgres } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { AdminStackOutputValue } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiStackOutputValue } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { CoreStackOutputValue } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { AwsDefaultRegion } from \"@webiny/project-extensions-aws/extensions/AwsDefaultRegion.js\";\nimport { ApiLambdaFunction } from \"./extensions/ApiLambdaFunction.js\";\nimport { EnvVar } from \"@webiny/project/extensions/index.js\";\nimport { Encryption } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { Hashing } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiMaxBundleSize } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport { ApiWebFunction } from \"@webiny/project-extensions-aws/extensions/index.js\";\nimport {\n EnvIs,\n EnvIsNot,\n EnvIsProd,\n EnvIsNotProd,\n useEnv,\n CiIs,\n CiIsNot\n} from \"@webiny/project/extensions/infra/index.js\";\n\nexport { useEnv };\n\n// Core app resources. Exposed under Infra.Core, and top-level for backward compatibility.\nconst DynamoDb = {\n Pitr: DynamoDbPitr\n};\n\nconst S3Bucket = {\n Versioning: S3BucketVersioning\n};\n\nexport const Infra = {\n // Grouped crypto config surface.\n Crypto: {\n Encryption,\n Hashing\n },\n // Kept top-level for backward compatibility (prefer Infra.Crypto.Encryption going forward).\n Encryption,\n Vpc,\n AuroraPostgres,\n BlueGreenDeployments,\n // Kept top-level for backward compatibility (prefer Infra.Core.OpenSearch going forward).\n OpenSearch,\n PulumiResourceNamePrefix,\n ProductionEnvironments,\n EnvVar,\n // Kept top-level for backward compatibility (prefer Infra.Core.DynamoDb and Infra.Core.S3Bucket).\n DynamoDb,\n S3Bucket,\n Aws: {\n DefaultRegion: AwsDefaultRegion,\n Tags: AwsTags\n },\n Env: {\n useEnv,\n Is: EnvIs,\n IsNot: EnvIsNot,\n IsProd: EnvIsProd,\n IsNotProd: EnvIsNotProd\n },\n Ci: {\n Is: CiIs,\n IsNot: CiIsNot\n },\n Admin: {\n BeforeBuild: AdminBeforeBuild,\n BeforeDeploy: AdminBeforeDeploy,\n BeforeWatch: AdminBeforeWatch,\n AfterBuild: AdminAfterBuild,\n AfterDeploy: AdminAfterDeploy,\n Pulumi: AdminPulumi,\n CustomDomains: AdminCustomDomains,\n StackOutputValue: AdminStackOutputValue\n },\n Api: {\n BeforeBuild: ApiBeforeBuild,\n BeforeDeploy: ApiBeforeDeploy,\n BeforeWatch: ApiBeforeWatch,\n AfterBuild: ApiAfterBuild,\n AfterDeploy: ApiAfterDeploy,\n Pulumi: ApiPulumi,\n CustomDomains: ApiCustomDomains,\n StackOutputValue: ApiStackOutputValue,\n LambdaFunction: ApiLambdaFunction,\n MaxBundleSize: ApiMaxBundleSize,\n WebFunction: ApiWebFunction\n },\n Core: {\n BeforeBuild: CoreBeforeBuild,\n BeforeDeploy: CoreBeforeDeploy,\n BeforeWatch: CoreBeforeWatch,\n AfterBuild: CoreAfterBuild,\n AfterDeploy: CoreAfterDeploy,\n Pulumi: CorePulumi,\n StackOutputValue: CoreStackOutputValue,\n DynamoDb,\n OpenSearch,\n S3Bucket\n }\n};\n"],"names":["DynamoDb","DynamoDbPitr","S3Bucket","S3BucketVersioning","Infra","Encryption","Hashing","Vpc","AuroraPostgres","BlueGreenDeployments","OpenSearch","PulumiResourceNamePrefix","ProductionEnvironments","EnvVar","AwsDefaultRegion","AwsTags","useEnv","EnvIs","EnvIsNot","EnvIsProd","EnvIsNotProd","CiIs","CiIsNot","AdminBeforeBuild","AdminBeforeDeploy","AdminBeforeWatch","AdminAfterBuild","AdminAfterDeploy","AdminPulumi","AdminCustomDomains","AdminStackOutputValue","ApiBeforeBuild","ApiBeforeDeploy","ApiBeforeWatch","ApiAfterBuild","ApiAfterDeploy","ApiPulumi","ApiCustomDomains","ApiStackOutputValue","ApiLambdaFunction","ApiMaxBundleSize","ApiWebFunction","CoreBeforeBuild","CoreBeforeDeploy","CoreBeforeWatch","CoreAfterBuild","CoreAfterDeploy","CorePulumi","CoreStackOutputValue"],"mappings":";;;;;;;AAyDA,MAAMA,WAAW;IACb,MAAMC;AACV;AAEA,MAAMC,WAAW;IACb,YAAYC;AAChB;AAEO,MAAMC,QAAQ;IAEjB,QAAQ;QACJC,YAAUA;QACVC,SAAOA;IACX;IAEAD,YAAUA;IACVE,KAAGA;IACHC,gBAAcA;IACdC,sBAAoBA;IAEpBC,YAAUA;IACVC,0BAAwBA;IACxBC,wBAAsBA;IACtBC,QAAMA;IAENb;IACAE;IACA,KAAK;QACD,eAAeY;QACf,MAAMC;IACV;IACA,KAAK;QACDC,QAAMA;QACN,IAAIC;QACJ,OAAOC;QACP,QAAQC;QACR,WAAWC;IACf;IACA,IAAI;QACA,IAAIC;QACJ,OAAOC;IACX;IACA,OAAO;QACH,aAAaC;QACb,cAAcC;QACd,aAAaC;QACb,YAAYC;QACZ,aAAaC;QACb,QAAQC;QACR,eAAeC;QACf,kBAAkBC;IACtB;IACA,KAAK;QACD,aAAaC;QACb,cAAcC;QACd,aAAaC;QACb,YAAYC;QACZ,aAAaC;QACb,QAAQC;QACR,eAAeC;QACf,kBAAkBC;QAClB,gBAAgBC;QAChB,eAAeC;QACf,aAAaC;IACjB;IACA,MAAM;QACF,aAAaC;QACb,cAAcC;QACd,aAAaC;QACb,YAAYC;QACZ,aAAaC;QACb,QAAQC;QACR,kBAAkBC;QAClBhD;QACAU,YAAUA;QACVR;IACJ;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/project-aws",
3
- "version": "6.6.0-alpha.12",
3
+ "version": "6.6.0-alpha.13",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -17,20 +17,21 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "@pulumi/aws": "^7.54.0",
21
- "@pulumi/pulumi": "^3.273.0",
22
- "@pulumi/random": "4.21.4",
23
- "@vercel/nft": "1.11.0",
24
- "@webiny/aws-layers": "6.6.0-alpha.12",
25
- "@webiny/aws-sdk": "6.6.0-alpha.12",
26
- "@webiny/cli-core": "6.6.0-alpha.12",
20
+ "@pulumi/aws": "^7.55.0",
21
+ "@pulumi/pulumi": "^3.277.0",
22
+ "@pulumi/random": "4.21.6",
23
+ "@vercel/nft": "1.11.11",
24
+ "@webiny/aws-layers": "6.6.0-alpha.13",
25
+ "@webiny/aws-sdk": "6.6.0-alpha.13",
26
+ "@webiny/cli-core": "6.6.0-alpha.13",
27
27
  "@webiny/di": "2.0.0",
28
- "@webiny/global-config": "6.6.0-alpha.12",
29
- "@webiny/project": "6.6.0-alpha.12",
30
- "@webiny/project-extensions-aws": "6.6.0-alpha.12",
31
- "@webiny/pulumi": "6.6.0-alpha.12",
32
- "@webiny/pulumi-sdk": "6.6.0-alpha.12",
33
- "@webiny/utils": "6.6.0-alpha.12",
28
+ "@webiny/global-config": "6.6.0-alpha.13",
29
+ "@webiny/mailer-smtp": "6.6.0-alpha.13",
30
+ "@webiny/project": "6.6.0-alpha.13",
31
+ "@webiny/project-extensions-aws": "6.6.0-alpha.13",
32
+ "@webiny/pulumi": "6.6.0-alpha.13",
33
+ "@webiny/pulumi-sdk": "6.6.0-alpha.13",
34
+ "@webiny/utils": "6.6.0-alpha.13",
34
35
  "adm-zip": "0.6.1",
35
36
  "chalk": "6.0.1",
36
37
  "execa": "10.2.1",
@@ -40,9 +41,9 @@
40
41
  "invariant": "2.2.4",
41
42
  "lodash": "4.18.1",
42
43
  "mime": "4.1.2",
43
- "minimatch": "11.0.3",
44
+ "minimatch": "11.0.9",
44
45
  "mqtt": "5.16.1",
45
- "p-retry": "8.0.1",
46
+ "p-retry": "9.0.0",
46
47
  "react": "19.3.1",
47
48
  "replace-in-path": "1.1.0",
48
49
  "zod": "4.6.7"
@@ -51,9 +52,9 @@
51
52
  "@types/adm-zip": "0.6.0",
52
53
  "@types/lodash": "4.17.27",
53
54
  "@types/ncp": "2.0.8",
54
- "@webiny/build-tools": "6.6.0-alpha.12",
55
+ "@webiny/build-tools": "6.6.0-alpha.13",
55
56
  "typescript": "7.0.2",
56
- "vitest": "5.0.5"
57
+ "vitest": "5.1.1"
57
58
  },
58
59
  "adio": {
59
60
  "ignoreDirs": [
package/project.d.ts CHANGED
@@ -39,6 +39,7 @@ export declare const Project: {
39
39
  }, import("zod/v4/core").$strip>>;
40
40
  lexicalGeneration: import("zod").ZodOptional<import("zod").ZodBoolean>;
41
41
  adminAssistant: import("zod").ZodOptional<import("zod").ZodBoolean>;
42
+ remoteComponents: import("zod").ZodOptional<import("zod").ZodBoolean>;
42
43
  cms: import("zod").ZodOptional<import("zod").ZodObject<{
43
44
  entryGeneration: import("zod").ZodOptional<import("zod").ZodBoolean>;
44
45
  entryComparison: import("zod").ZodOptional<import("zod").ZodBoolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"pulumi/apps/admin/createAdminPulumiApp.js","sources":["../../../../src/pulumi/apps/admin/createAdminPulumiApp.ts"],"sourcesContent":["import { createReactPulumiApp } from \"~/pulumi/apps/index.js\";\nimport { getAwsProjectSdk } from \"~/pulumi/getAwsProjectSdk.js\";\nimport {\n AdminPulumi,\n SetAdminCustomDomains\n} from \"@webiny/project-extensions-aws/abstractions/features/pulumi/index.js\";\nimport { adminPulumi } from \"~/pulumi/features/AdminPulumi/index.js\";\nimport { DefaultSetAdminCustomDomains } from \"~/pulumi/features/DefaultSetAdminCustomDomains.js\";\nimport { AdminCustomDomains as adminCustomDomainsExt } from \"@webiny/project-extensions-aws/extensions/AdminCustomDomains.js\";\nimport { getDistributionUrl } from \"~/pulumi/utils/index.js\";\n\nexport type AdminPulumiApp = ReturnType<typeof createReactPulumiApp>;\n\nexport const createAdminPulumiApp = async () => {\n const sdk = await getAwsProjectSdk();\n const projectConfig = await sdk.getProjectConfig();\n const baseApp = createReactPulumiApp({\n name: \"admin\",\n folder: \"apps/admin\",\n domains: () => {\n const [adminDomains] = projectConfig.extensionsByType(adminCustomDomainsExt);\n\n if (adminDomains) {\n const { domains, sslMethod, certificateArn, minimumProtocolVersion } =\n adminDomains.params;\n return {\n domains,\n sslSupportMethod: sslMethod,\n acmCertificateArn: certificateArn,\n minimumProtocolVersion\n };\n }\n\n return undefined;\n },\n pulumi: async app => {\n // Overrides must be applied via a handler, registered at the very start of the program.\n // By doing this, we're ensuring user's adjustments are not applied to late.\n sdk.getContainer().registerComposite(adminPulumi);\n\n // Make the `SetAdminCustomDomains` service injectable into user-defined `AdminPulumi`\n // implementations. This allows applying custom domains using dynamically created\n // Pulumi resources (e.g. ACM certificates), from within a single implementation file.\n // We register an instance (bound to the current `app`) so that user implementations\n // only need to pass the custom domain params - not the `app` itself.\n sdk.getContainer().registerInstance(\n SetAdminCustomDomains,\n new DefaultSetAdminCustomDomains(app as AdminPulumiApp)\n );\n\n const pulumiHandlers = sdk.getContainer().resolve(AdminPulumi);\n\n app.addHandler(() => {\n return pulumiHandlers.execute(app as AdminPulumiApp);\n });\n }\n });\n\n // `createReactPulumiApp` already adds service manifests: one set, published once (with\n // `<Infra.Postgres />`, one invocation of the api's schema setup, with `admin` and any manifest\n // an `AdminPulumi` extension adds).\n const app = baseApp;\n\n app.addHandler(() => {\n app.addServiceManifest({\n name: \"admin\",\n manifest: {\n // Read by the API through `PublicUrls.getAdminUrl()`.\n url: getDistributionUrl(baseApp.resources.cloudfront),\n cloudfront: {\n distributionId: baseApp.resources.cloudfront.output.id,\n domain: baseApp.resources.cloudfront.output.domainName.apply(\n v => `https://${v}`\n )\n }\n }\n });\n });\n\n return app;\n};\n"],"names":["createAdminPulumiApp","sdk","getAwsProjectSdk","projectConfig","baseApp","createReactPulumiApp","adminDomains","adminCustomDomainsExt","domains","sslMethod","certificateArn","minimumProtocolVersion","app","adminPulumi","SetAdminCustomDomains","DefaultSetAdminCustomDomains","pulumiHandlers","AdminPulumi","getDistributionUrl","v"],"mappings":";;;;;;;AAaO,MAAMA,uBAAuB;IAChC,MAAMC,MAAM,MAAMC;IAClB,MAAMC,gBAAgB,MAAMF,IAAI,gBAAgB;IAChD,MAAMG,UAAUC,qBAAqB;QACjC,MAAM;QACN,QAAQ;QACR,SAAS;YACL,MAAM,CAACC,aAAa,GAAGH,cAAc,gBAAgB,CAACI;YAEtD,IAAID,cAAc;gBACd,MAAM,EAAEE,OAAO,EAAEC,SAAS,EAAEC,cAAc,EAAEC,sBAAsB,EAAE,GAChEL,aAAa,MAAM;gBACvB,OAAO;oBACHE;oBACA,kBAAkBC;oBAClB,mBAAmBC;oBACnBC;gBACJ;YACJ;QAGJ;QACA,QAAQ,OAAMC;YAGVX,IAAI,YAAY,GAAG,iBAAiB,CAACY;YAOrCZ,IAAI,YAAY,GAAG,gBAAgB,CAC/Ba,uBACA,IAAIC,6BAA6BH;YAGrC,MAAMI,iBAAiBf,IAAI,YAAY,GAAG,OAAO,CAACgB;YAElDL,IAAI,UAAU,CAAC,IACJI,eAAe,OAAO,CAACJ;QAEtC;IACJ;IAKA,MAAMA,MAAMR;IAEZQ,IAAI,UAAU,CAAC;QACXA,IAAI,kBAAkB,CAAC;YACnB,MAAM;YACN,UAAU;gBAEN,KAAKM,mBAAmBd,QAAQ,SAAS,CAAC,UAAU;gBACpD,YAAY;oBACR,gBAAgBA,QAAQ,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;oBACtD,QAAQA,QAAQ,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CACxDe,CAAAA,IAAK,CAAC,QAAQ,EAAEA,GAAG;gBAE3B;YACJ;QACJ;IACJ;IAEA,OAAOP;AACX"}
1
+ {"version":3,"file":"pulumi/apps/admin/createAdminPulumiApp.js","sources":["../../../../src/pulumi/apps/admin/createAdminPulumiApp.ts"],"sourcesContent":["import { createReactPulumiApp } from \"~/pulumi/apps/index.js\";\nimport { getAwsProjectSdk } from \"~/pulumi/getAwsProjectSdk.js\";\nimport {\n AdminPulumi,\n SetAdminCustomDomains\n} from \"@webiny/project-extensions-aws/abstractions/features/pulumi/index.js\";\nimport { adminPulumi } from \"~/pulumi/features/AdminPulumi/index.js\";\nimport { DefaultSetAdminCustomDomains } from \"~/pulumi/features/DefaultSetAdminCustomDomains.js\";\nimport { AdminCustomDomains as adminCustomDomainsExt } from \"@webiny/project-extensions-aws/extensions/AdminCustomDomains.js\";\nimport { getDistributionUrl } from \"~/pulumi/utils/index.js\";\n\nexport type AdminPulumiApp = ReturnType<typeof createReactPulumiApp>;\n\nexport const createAdminPulumiApp = async () => {\n const sdk = await getAwsProjectSdk();\n const projectConfig = await sdk.getProjectConfig();\n const baseApp = createReactPulumiApp({\n name: \"admin\",\n folder: \"apps/admin\",\n domains: () => {\n const [adminDomains] = projectConfig.extensionsByType(adminCustomDomainsExt);\n\n if (adminDomains) {\n const { domains, sslMethod, certificateArn, minimumProtocolVersion } =\n adminDomains.params;\n return {\n domains,\n sslSupportMethod: sslMethod,\n acmCertificateArn: certificateArn,\n minimumProtocolVersion\n };\n }\n\n return undefined;\n },\n pulumi: async app => {\n // Overrides must be applied via a handler, registered at the very start of the program.\n // By doing this, we're ensuring user's adjustments are not applied to late.\n sdk.getContainer().registerComposite(adminPulumi);\n\n // Make the `SetAdminCustomDomains` service injectable into user-defined `AdminPulumi`\n // implementations. This allows applying custom domains using dynamically created\n // Pulumi resources (e.g. ACM certificates), from within a single implementation file.\n // We register an instance (bound to the current `app`) so that user implementations\n // only need to pass the custom domain params - not the `app` itself.\n sdk.getContainer().registerInstance(\n SetAdminCustomDomains,\n new DefaultSetAdminCustomDomains(app as AdminPulumiApp)\n );\n\n const pulumiHandlers = sdk.getContainer().resolve(AdminPulumi);\n\n app.addHandler(() => {\n return pulumiHandlers.execute(app as AdminPulumiApp);\n });\n }\n });\n\n // `createReactPulumiApp` already adds service manifests: one set, published once (with\n // `<Infra.AuroraPostgres />`, one invocation of the api's schema setup, with `admin` and any\n // manifest an `AdminPulumi` extension adds).\n const app = baseApp;\n\n app.addHandler(() => {\n app.addServiceManifest({\n name: \"admin\",\n manifest: {\n // Read by the API through `PublicUrls.getAdminUrl()`.\n url: getDistributionUrl(baseApp.resources.cloudfront),\n cloudfront: {\n distributionId: baseApp.resources.cloudfront.output.id,\n domain: baseApp.resources.cloudfront.output.domainName.apply(\n v => `https://${v}`\n )\n }\n }\n });\n });\n\n return app;\n};\n"],"names":["createAdminPulumiApp","sdk","getAwsProjectSdk","projectConfig","baseApp","createReactPulumiApp","adminDomains","adminCustomDomainsExt","domains","sslMethod","certificateArn","minimumProtocolVersion","app","adminPulumi","SetAdminCustomDomains","DefaultSetAdminCustomDomains","pulumiHandlers","AdminPulumi","getDistributionUrl","v"],"mappings":";;;;;;;AAaO,MAAMA,uBAAuB;IAChC,MAAMC,MAAM,MAAMC;IAClB,MAAMC,gBAAgB,MAAMF,IAAI,gBAAgB;IAChD,MAAMG,UAAUC,qBAAqB;QACjC,MAAM;QACN,QAAQ;QACR,SAAS;YACL,MAAM,CAACC,aAAa,GAAGH,cAAc,gBAAgB,CAACI;YAEtD,IAAID,cAAc;gBACd,MAAM,EAAEE,OAAO,EAAEC,SAAS,EAAEC,cAAc,EAAEC,sBAAsB,EAAE,GAChEL,aAAa,MAAM;gBACvB,OAAO;oBACHE;oBACA,kBAAkBC;oBAClB,mBAAmBC;oBACnBC;gBACJ;YACJ;QAGJ;QACA,QAAQ,OAAMC;YAGVX,IAAI,YAAY,GAAG,iBAAiB,CAACY;YAOrCZ,IAAI,YAAY,GAAG,gBAAgB,CAC/Ba,uBACA,IAAIC,6BAA6BH;YAGrC,MAAMI,iBAAiBf,IAAI,YAAY,GAAG,OAAO,CAACgB;YAElDL,IAAI,UAAU,CAAC,IACJI,eAAe,OAAO,CAACJ;QAEtC;IACJ;IAKA,MAAMA,MAAMR;IAEZQ,IAAI,UAAU,CAAC;QACXA,IAAI,kBAAkB,CAAC;YACnB,MAAM;YACN,UAAU;gBAEN,KAAKM,mBAAmBd,QAAQ,SAAS,CAAC,UAAU;gBACpD,YAAY;oBACR,gBAAgBA,QAAQ,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;oBACtD,QAAQA,QAAQ,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CACxDe,CAAAA,IAAK,CAAC,QAAQ,EAAEA,GAAG;gBAE3B;YACJ;QACJ;IACJ;IAEA,OAAOP;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"pulumi/apps/api/ApiGraphql.js","sources":["../../../../src/pulumi/apps/api/ApiGraphql.ts"],"sourcesContent":["import path from \"path\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport type { PulumiApp, PulumiAppModule } from \"@webiny/pulumi\";\nimport { createAppModule } from \"@webiny/pulumi\";\nimport { createLambdaRole, getCommonLambdaEnvVariables } from \"../lambdaUtils.js\";\nimport { CoreOutput, VpcConfig } from \"~/pulumi/apps/index.js\";\nimport { getAwsAccountId, getAwsRegion } from \"../awsUtils.js\";\nimport { LAMBDA_RUNTIME } from \"~/pulumi/constants.js\";\nimport { ApiGraphqlWeb } from \"./ApiGraphqlWeb.js\";\nimport { isRouteNameAllowed } from \"./isRouteNameAllowed.js\";\n\ninterface GraphqlParams {\n env: Record<string, any>;\n}\n\nexport interface AddRouteParams {\n /**\n * Must be in kebab case (a-z, 0-9 and -) when the route goes to API Gateway.\n */\n name: string;\n path: `/${string}`;\n method: \"DELETE\" | \"GET\" | \"HEAD\" | \"PATCH\" | \"POST\" | \"PUT\" | \"OPTIONS\" | \"ANY\";\n}\n\nconst EMPTY_TRASH_BIN_EVENT_RULE_NAME = `empty-trash-bin-event-rule`;\nconst EMPTY_TRASH_BIN_EVENT_PERMISSION_NAME = `empty-trash-bin-event-target-permission`;\nconst EMPTY_TRASH_BIN_EVENT_RULE_TARGET = `empty-trash-bin-event-rule-target`;\n\nexport type ApiGraphql = PulumiAppModule<typeof ApiGraphql>;\n\nexport const ApiGraphql = createAppModule({\n name: \"ApiGraphql\",\n config(app: PulumiApp, params: GraphqlParams) {\n const policy = createGraphqlLambdaPolicy(app);\n const role = createLambdaRole(app, {\n name: \"api-lambda-role\",\n policy: policy.output\n });\n\n const graphql = app.addResource(aws.lambda.Function, {\n name: \"graphql\",\n config: {\n description: \"Webiny's GraphQL APIs\",\n runtime: LAMBDA_RUNTIME,\n handler: \"handler.handler\",\n role: role.output.arn,\n timeout: 30,\n memorySize: 1024,\n code: new pulumi.asset.AssetArchive({\n \".\": new pulumi.asset.FileArchive(\n path.join(app.paths.workspace, \"graphql/build\")\n )\n }),\n environment: {\n variables: getCommonLambdaEnvVariables().apply(value => ({\n ...value,\n ...params.env,\n AWS_NODEJS_CONNECTION_REUSE_ENABLED: \"1\"\n }))\n },\n vpcConfig: app.getModule(VpcConfig).functionVpcConfig,\n loggingConfig: {\n logFormat: \"JSON\"\n }\n }\n });\n\n // Create event rule.\n const eventRule = app.addResource(aws.cloudwatch.EventRule, {\n name: EMPTY_TRASH_BIN_EVENT_RULE_NAME,\n config: {\n description: \"Enable us to empty the trash-bin ever day\",\n scheduleExpression: \"cron(0 3 * * ? *)\"\n }\n });\n\n // Add required permission to the target lambda.\n app.addResource(aws.lambda.Permission, {\n name: EMPTY_TRASH_BIN_EVENT_PERMISSION_NAME,\n config: {\n action: \"lambda:InvokeFunction\",\n function: graphql.output.arn,\n principal: \"events.amazonaws.com\",\n statementId: \"allow-rule-invoke-\" + EMPTY_TRASH_BIN_EVENT_RULE_NAME\n }\n });\n\n // Target the main graphql lambda.\n app.addResource(aws.cloudwatch.EventTarget, {\n name: EMPTY_TRASH_BIN_EVENT_RULE_TARGET,\n config: {\n rule: eventRule.output.name,\n arn: graphql.output.arn,\n input: JSON.stringify({\n source: \"webiny.events\",\n \"detail-type\": \"WebinyEmptyTrashBin\"\n })\n }\n });\n\n return {\n role,\n policy,\n functions: {\n graphql\n },\n addRoute: (routeParams: AddRouteParams) => {\n // With the web function there is no HTTP API Gateway: the route goes to the web\n // function, whose router matches the method. The name isn't used here, so it isn't\n // checked either.\n const graphqlWeb = app.getModule(ApiGraphqlWeb, { optional: true });\n if (graphqlWeb) {\n graphqlWeb.addRoute(routeParams.path);\n return;\n }\n\n if (!isRouteNameAllowed(routeParams.name)) {\n console.log(`Route name is not allowed: \"${routeParams.name}\".`);\n return;\n }\n\n const apiGateway: any = app.resources.apiGateway;\n if (!apiGateway) {\n console.log(\n \"Could not add route because there is no apiGateway in the resources.\"\n );\n return;\n }\n return apiGateway.addRoute(routeParams.name, {\n path: routeParams.path,\n method: routeParams.method,\n function: graphql.output.arn\n });\n }\n };\n }\n});\n\nfunction createGraphqlLambdaPolicy(app: PulumiApp) {\n const coreOutput = app.getModule(CoreOutput);\n const awsAccountId = getAwsAccountId(app);\n const awsRegion = getAwsRegion(app);\n\n return app.addResource(aws.iam.Policy, {\n name: \"ApiGraphqlLambdaPolicy\",\n config: {\n description: \"This policy enables access to Dynamodb, S3, Lambda and Cognito IDP\",\n // Core is pulumi.Output, so we need to run apply() to resolve policy based on it\n policy: pulumi.all([coreOutput]).apply(([core]) => {\n const policy: aws.iam.PolicyDocument = {\n Version: \"2012-10-17\",\n Statement: [\n // The core's DynamoDB tables: only the OpenSearch one, if any, with\n // `<Infra.Postgres />`.\n ...createDynamoDbStatements(core),\n {\n Sid: \"PermissionForS3\",\n Effect: \"Allow\",\n Action: [\n \"s3:ListBucket\",\n \"s3:GetObjectAcl\",\n \"s3:DeleteObject\",\n \"s3:PutObjectAcl\",\n \"s3:PutObject\",\n \"s3:GetObject\"\n ],\n Resource: [\n pulumi.interpolate`arn:aws:s3:::${core.fileManagerBucketId}`,\n pulumi.interpolate`arn:aws:s3:::${core.fileManagerBucketId}/*`\n ]\n },\n {\n Sid: \"PermissionForLambda\",\n Effect: \"Allow\",\n Action: [\"lambda:InvokeFunction\"],\n Resource: pulumi.interpolate`arn:aws:lambda:${awsRegion}:${awsAccountId}:function:*`\n },\n {\n Sid: \"PermissionForCognitoIdp\",\n Effect: \"Allow\",\n Action: \"cognito-idp:*\",\n Resource: `${core.cognitoUserPoolArn}`\n },\n {\n Sid: \"PermissionForEventBus\",\n Effect: \"Allow\",\n Action: \"events:PutEvents\",\n Resource: core.eventBusArn\n },\n {\n Sid: \"PermissionForCloudfront\",\n Effect: \"Allow\",\n Action: \"cloudfront:CreateInvalidation\",\n Resource: pulumi.interpolate`arn:aws:cloudfront::${awsAccountId}:distribution/*`\n },\n // Attach permissions for elastic search domain as well (if ES is enabled).\n ...(core.opensearchDomainArn\n ? [\n {\n Sid: \"PermissionForOS\",\n Effect: \"Allow\" as const,\n Action: \"es:*\",\n Resource: [\n `${core.opensearchDomainArn}`,\n `${core.opensearchDomainArn}/*`\n ]\n }\n ]\n : [])\n ]\n };\n\n return policy;\n })\n }\n });\n}\n\n/*\n * Every DynamoDB action on the core's tables that exist: the primary and audit logs ones (none with\n * `<Infra.Postgres />`) and the OpenSearch one (with OpenSearch). No statement when there are none.\n */\nfunction createDynamoDbStatements(core: {\n primaryDynamodbTableArn: string | undefined;\n auditLogsDynamodbTableArn: string | undefined;\n opensearchDynamodbTableArn: string | undefined;\n}): aws.iam.PolicyStatement[] {\n const tableArns = [\n core.primaryDynamodbTableArn,\n core.auditLogsDynamodbTableArn,\n core.opensearchDynamodbTableArn\n ].filter((arn): arn is string => Boolean(arn));\n\n if (!tableArns.length) {\n return [];\n }\n\n return [\n {\n Sid: \"PermissionForDynamodb\",\n Effect: \"Allow\",\n Action: [\n \"dynamodb:BatchGetItem\",\n \"dynamodb:BatchWriteItem\",\n \"dynamodb:ConditionCheckItem\",\n \"dynamodb:CreateBackup\",\n \"dynamodb:CreateTable\",\n \"dynamodb:CreateTableReplica\",\n \"dynamodb:DeleteBackup\",\n \"dynamodb:DeleteItem\",\n \"dynamodb:DeleteTable\",\n \"dynamodb:DeleteTableReplica\",\n \"dynamodb:DescribeBackup\",\n \"dynamodb:DescribeContinuousBackups\",\n \"dynamodb:DescribeContributorInsights\",\n \"dynamodb:DescribeExport\",\n \"dynamodb:DescribeKinesisStreamingDestination\",\n \"dynamodb:DescribeLimits\",\n \"dynamodb:DescribeReservedCapacity\",\n \"dynamodb:DescribeReservedCapacityOfferings\",\n \"dynamodb:DescribeStream\",\n \"dynamodb:DescribeTable\",\n \"dynamodb:DescribeTableReplicaAutoScaling\",\n \"dynamodb:DescribeTimeToLive\",\n \"dynamodb:DisableKinesisStreamingDestination\",\n \"dynamodb:EnableKinesisStreamingDestination\",\n \"dynamodb:ExportTableToPointInTime\",\n \"dynamodb:GetItem\",\n \"dynamodb:GetRecords\",\n \"dynamodb:GetShardIterator\",\n \"dynamodb:ListBackups\",\n \"dynamodb:ListContributorInsights\",\n \"dynamodb:ListExports\",\n \"dynamodb:ListStreams\",\n \"dynamodb:ListTables\",\n \"dynamodb:ListTagsOfResource\",\n \"dynamodb:PartiQLDelete\",\n \"dynamodb:PartiQLInsert\",\n \"dynamodb:PartiQLSelect\",\n \"dynamodb:PartiQLUpdate\",\n \"dynamodb:PurchaseReservedCapacityOfferings\",\n \"dynamodb:PutItem\",\n \"dynamodb:Query\",\n \"dynamodb:RestoreTableFromBackup\",\n \"dynamodb:RestoreTableToPointInTime\",\n \"dynamodb:Scan\",\n \"dynamodb:UpdateContinuousBackups\",\n \"dynamodb:UpdateContributorInsights\",\n \"dynamodb:UpdateItem\",\n \"dynamodb:UpdateTable\",\n \"dynamodb:UpdateTableReplicaAutoScaling\",\n \"dynamodb:UpdateTimeToLive\"\n ],\n Resource: tableArns.flatMap(arn => [arn, `${arn}/*`])\n }\n ];\n}\n"],"names":["EMPTY_TRASH_BIN_EVENT_RULE_NAME","EMPTY_TRASH_BIN_EVENT_PERMISSION_NAME","EMPTY_TRASH_BIN_EVENT_RULE_TARGET","ApiGraphql","createAppModule","app","params","policy","createGraphqlLambdaPolicy","role","createLambdaRole","graphql","aws","LAMBDA_RUNTIME","pulumi","path","getCommonLambdaEnvVariables","value","VpcConfig","eventRule","JSON","routeParams","graphqlWeb","ApiGraphqlWeb","isRouteNameAllowed","console","apiGateway","coreOutput","CoreOutput","awsAccountId","getAwsAccountId","awsRegion","getAwsRegion","core","createDynamoDbStatements","tableArns","arn","Boolean"],"mappings":";;;;;;;;;;AAyBA,MAAMA,kCAAkC;AACxC,MAAMC,wCAAwC;AAC9C,MAAMC,oCAAoC;AAInC,MAAMC,aAAaC,gBAAgB;IACtC,MAAM;IACN,QAAOC,GAAc,EAAEC,MAAqB;QACxC,MAAMC,SAASC,0BAA0BH;QACzC,MAAMI,OAAOC,iBAAiBL,KAAK;YAC/B,MAAM;YACN,QAAQE,OAAO,MAAM;QACzB;QAEA,MAAMI,UAAUN,IAAI,WAAW,CAACO,uCAAAA,MAAAA,CAAAA,QAAmB,EAAE;YACjD,MAAM;YACN,QAAQ;gBACJ,aAAa;gBACb,SAASC;gBACT,SAAS;gBACT,MAAMJ,KAAK,MAAM,CAAC,GAAG;gBACrB,SAAS;gBACT,YAAY;gBACZ,MAAM,IAAIK,0CAAAA,KAAAA,CAAAA,YAAyB,CAAC;oBAChC,KAAK,IAAIA,0CAAAA,KAAAA,CAAAA,WAAwB,CAC7BC,KAAK,IAAI,CAACV,IAAI,KAAK,CAAC,SAAS,EAAE;gBAEvC;gBACA,aAAa;oBACT,WAAWW,8BAA8B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,KAAK,mBAAmB,GACtB;4BACI;gCACI,KAAK;gCACL,QAAQ;gCACR,QAAQ;gCACR,UAAU;oCACN,GAAGA,KAAK,mBAAmB,EAAE;oCAC7B,GAAGA,KAAK,mBAAmB,CAAC,EAAE,CAAC;iCAClC;4BACL;yBACH,GACD,EAAE;qBACX;gBACL;gBAEA,OAAO1B;YACX;QACJ;IACJ;AACJ;AAMA,SAAS2B,yBAAyBD,IAIjC;IACG,MAAME,YAAY;QACdF,KAAK,uBAAuB;QAC5BA,KAAK,yBAAyB;QAC9BA,KAAK,0BAA0B;KAClC,CAAC,MAAM,CAAC,CAACG,MAAuBC,QAAQD;IAEzC,IAAI,CAACD,UAAU,MAAM,EACjB,OAAO,EAAE;IAGb,OAAO;QACH;YACI,KAAK;YACL,QAAQ;YACR,QAAQ;gBACJ;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;aACH;YACD,UAAUA,UAAU,OAAO,CAACC,CAAAA,MAAO;oBAACA;oBAAK,GAAGA,IAAI,EAAE,CAAC;iBAAC;QACxD;KACH;AACL"}
1
+ {"version":3,"file":"pulumi/apps/api/ApiGraphql.js","sources":["../../../../src/pulumi/apps/api/ApiGraphql.ts"],"sourcesContent":["import path from \"path\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport type { PulumiApp, PulumiAppModule } from \"@webiny/pulumi\";\nimport { createAppModule } from \"@webiny/pulumi\";\nimport { createLambdaRole, getCommonLambdaEnvVariables } from \"../lambdaUtils.js\";\nimport { CoreOutput, VpcConfig } from \"~/pulumi/apps/index.js\";\nimport { getAwsAccountId, getAwsRegion } from \"../awsUtils.js\";\nimport { LAMBDA_RUNTIME } from \"~/pulumi/constants.js\";\nimport { ApiGraphqlWeb } from \"./ApiGraphqlWeb.js\";\nimport { isRouteNameAllowed } from \"./isRouteNameAllowed.js\";\n\ninterface GraphqlParams {\n env: Record<string, any>;\n}\n\nexport interface AddRouteParams {\n /**\n * Must be in kebab case (a-z, 0-9 and -) when the route goes to API Gateway.\n */\n name: string;\n path: `/${string}`;\n method: \"DELETE\" | \"GET\" | \"HEAD\" | \"PATCH\" | \"POST\" | \"PUT\" | \"OPTIONS\" | \"ANY\";\n}\n\nconst EMPTY_TRASH_BIN_EVENT_RULE_NAME = `empty-trash-bin-event-rule`;\nconst EMPTY_TRASH_BIN_EVENT_PERMISSION_NAME = `empty-trash-bin-event-target-permission`;\nconst EMPTY_TRASH_BIN_EVENT_RULE_TARGET = `empty-trash-bin-event-rule-target`;\n\nexport type ApiGraphql = PulumiAppModule<typeof ApiGraphql>;\n\nexport const ApiGraphql = createAppModule({\n name: \"ApiGraphql\",\n config(app: PulumiApp, params: GraphqlParams) {\n const policy = createGraphqlLambdaPolicy(app);\n const role = createLambdaRole(app, {\n name: \"api-lambda-role\",\n policy: policy.output\n });\n\n const graphql = app.addResource(aws.lambda.Function, {\n name: \"graphql\",\n config: {\n description: \"Webiny's GraphQL APIs\",\n runtime: LAMBDA_RUNTIME,\n handler: \"handler.handler\",\n role: role.output.arn,\n timeout: 30,\n memorySize: 1024,\n code: new pulumi.asset.AssetArchive({\n \".\": new pulumi.asset.FileArchive(\n path.join(app.paths.workspace, \"graphql/build\")\n )\n }),\n environment: {\n variables: getCommonLambdaEnvVariables().apply(value => ({\n ...value,\n ...params.env,\n AWS_NODEJS_CONNECTION_REUSE_ENABLED: \"1\"\n }))\n },\n vpcConfig: app.getModule(VpcConfig).functionVpcConfig,\n loggingConfig: {\n logFormat: \"JSON\"\n }\n }\n });\n\n // Create event rule.\n const eventRule = app.addResource(aws.cloudwatch.EventRule, {\n name: EMPTY_TRASH_BIN_EVENT_RULE_NAME,\n config: {\n description: \"Enable us to empty the trash-bin ever day\",\n scheduleExpression: \"cron(0 3 * * ? *)\"\n }\n });\n\n // Add required permission to the target lambda.\n app.addResource(aws.lambda.Permission, {\n name: EMPTY_TRASH_BIN_EVENT_PERMISSION_NAME,\n config: {\n action: \"lambda:InvokeFunction\",\n function: graphql.output.arn,\n principal: \"events.amazonaws.com\",\n statementId: \"allow-rule-invoke-\" + EMPTY_TRASH_BIN_EVENT_RULE_NAME\n }\n });\n\n // Target the main graphql lambda.\n app.addResource(aws.cloudwatch.EventTarget, {\n name: EMPTY_TRASH_BIN_EVENT_RULE_TARGET,\n config: {\n rule: eventRule.output.name,\n arn: graphql.output.arn,\n input: JSON.stringify({\n source: \"webiny.events\",\n \"detail-type\": \"WebinyEmptyTrashBin\"\n })\n }\n });\n\n return {\n role,\n policy,\n functions: {\n graphql\n },\n addRoute: (routeParams: AddRouteParams) => {\n // With the web function there is no HTTP API Gateway: the route goes to the web\n // function, whose router matches the method. The name isn't used here, so it isn't\n // checked either.\n const graphqlWeb = app.getModule(ApiGraphqlWeb, { optional: true });\n if (graphqlWeb) {\n graphqlWeb.addRoute(routeParams.path);\n return;\n }\n\n if (!isRouteNameAllowed(routeParams.name)) {\n console.log(`Route name is not allowed: \"${routeParams.name}\".`);\n return;\n }\n\n const apiGateway: any = app.resources.apiGateway;\n if (!apiGateway) {\n console.log(\n \"Could not add route because there is no apiGateway in the resources.\"\n );\n return;\n }\n return apiGateway.addRoute(routeParams.name, {\n path: routeParams.path,\n method: routeParams.method,\n function: graphql.output.arn\n });\n }\n };\n }\n});\n\nfunction createGraphqlLambdaPolicy(app: PulumiApp) {\n const coreOutput = app.getModule(CoreOutput);\n const awsAccountId = getAwsAccountId(app);\n const awsRegion = getAwsRegion(app);\n\n return app.addResource(aws.iam.Policy, {\n name: \"ApiGraphqlLambdaPolicy\",\n config: {\n description: \"This policy enables access to Dynamodb, S3, Lambda and Cognito IDP\",\n // Core is pulumi.Output, so we need to run apply() to resolve policy based on it\n policy: pulumi.all([coreOutput]).apply(([core]) => {\n const policy: aws.iam.PolicyDocument = {\n Version: \"2012-10-17\",\n Statement: [\n // The core's DynamoDB tables: only the OpenSearch one, if any, with\n // `<Infra.AuroraPostgres />`.\n ...createDynamoDbStatements(core),\n {\n Sid: \"PermissionForS3\",\n Effect: \"Allow\",\n Action: [\n \"s3:ListBucket\",\n \"s3:GetObjectAcl\",\n \"s3:DeleteObject\",\n \"s3:PutObjectAcl\",\n \"s3:PutObject\",\n \"s3:GetObject\"\n ],\n Resource: [\n pulumi.interpolate`arn:aws:s3:::${core.fileManagerBucketId}`,\n pulumi.interpolate`arn:aws:s3:::${core.fileManagerBucketId}/*`\n ]\n },\n {\n Sid: \"PermissionForLambda\",\n Effect: \"Allow\",\n Action: [\"lambda:InvokeFunction\"],\n Resource: pulumi.interpolate`arn:aws:lambda:${awsRegion}:${awsAccountId}:function:*`\n },\n {\n Sid: \"PermissionForCognitoIdp\",\n Effect: \"Allow\",\n Action: \"cognito-idp:*\",\n Resource: `${core.cognitoUserPoolArn}`\n },\n {\n Sid: \"PermissionForEventBus\",\n Effect: \"Allow\",\n Action: \"events:PutEvents\",\n Resource: core.eventBusArn\n },\n {\n Sid: \"PermissionForCloudfront\",\n Effect: \"Allow\",\n Action: \"cloudfront:CreateInvalidation\",\n Resource: pulumi.interpolate`arn:aws:cloudfront::${awsAccountId}:distribution/*`\n },\n // Attach permissions for elastic search domain as well (if ES is enabled).\n ...(core.opensearchDomainArn\n ? [\n {\n Sid: \"PermissionForOS\",\n Effect: \"Allow\" as const,\n Action: \"es:*\",\n Resource: [\n `${core.opensearchDomainArn}`,\n `${core.opensearchDomainArn}/*`\n ]\n }\n ]\n : [])\n ]\n };\n\n return policy;\n })\n }\n });\n}\n\n/*\n * Every DynamoDB action on the core's tables that exist: the primary and audit logs ones (none with\n * `<Infra.AuroraPostgres />`) and the OpenSearch one (with OpenSearch). No statement without\n * tables.\n */\nfunction createDynamoDbStatements(core: {\n primaryDynamodbTableArn: string | undefined;\n auditLogsDynamodbTableArn: string | undefined;\n opensearchDynamodbTableArn: string | undefined;\n}): aws.iam.PolicyStatement[] {\n const tableArns = [\n core.primaryDynamodbTableArn,\n core.auditLogsDynamodbTableArn,\n core.opensearchDynamodbTableArn\n ].filter((arn): arn is string => Boolean(arn));\n\n if (!tableArns.length) {\n return [];\n }\n\n return [\n {\n Sid: \"PermissionForDynamodb\",\n Effect: \"Allow\",\n Action: [\n \"dynamodb:BatchGetItem\",\n \"dynamodb:BatchWriteItem\",\n \"dynamodb:ConditionCheckItem\",\n \"dynamodb:CreateBackup\",\n \"dynamodb:CreateTable\",\n \"dynamodb:CreateTableReplica\",\n \"dynamodb:DeleteBackup\",\n \"dynamodb:DeleteItem\",\n \"dynamodb:DeleteTable\",\n \"dynamodb:DeleteTableReplica\",\n \"dynamodb:DescribeBackup\",\n \"dynamodb:DescribeContinuousBackups\",\n \"dynamodb:DescribeContributorInsights\",\n \"dynamodb:DescribeExport\",\n \"dynamodb:DescribeKinesisStreamingDestination\",\n \"dynamodb:DescribeLimits\",\n \"dynamodb:DescribeReservedCapacity\",\n \"dynamodb:DescribeReservedCapacityOfferings\",\n \"dynamodb:DescribeStream\",\n \"dynamodb:DescribeTable\",\n \"dynamodb:DescribeTableReplicaAutoScaling\",\n \"dynamodb:DescribeTimeToLive\",\n \"dynamodb:DisableKinesisStreamingDestination\",\n \"dynamodb:EnableKinesisStreamingDestination\",\n \"dynamodb:ExportTableToPointInTime\",\n \"dynamodb:GetItem\",\n \"dynamodb:GetRecords\",\n \"dynamodb:GetShardIterator\",\n \"dynamodb:ListBackups\",\n \"dynamodb:ListContributorInsights\",\n \"dynamodb:ListExports\",\n \"dynamodb:ListStreams\",\n \"dynamodb:ListTables\",\n \"dynamodb:ListTagsOfResource\",\n \"dynamodb:PartiQLDelete\",\n \"dynamodb:PartiQLInsert\",\n \"dynamodb:PartiQLSelect\",\n \"dynamodb:PartiQLUpdate\",\n \"dynamodb:PurchaseReservedCapacityOfferings\",\n \"dynamodb:PutItem\",\n \"dynamodb:Query\",\n \"dynamodb:RestoreTableFromBackup\",\n \"dynamodb:RestoreTableToPointInTime\",\n \"dynamodb:Scan\",\n \"dynamodb:UpdateContinuousBackups\",\n \"dynamodb:UpdateContributorInsights\",\n \"dynamodb:UpdateItem\",\n \"dynamodb:UpdateTable\",\n \"dynamodb:UpdateTableReplicaAutoScaling\",\n \"dynamodb:UpdateTimeToLive\"\n ],\n Resource: tableArns.flatMap(arn => [arn, `${arn}/*`])\n }\n ];\n}\n"],"names":["EMPTY_TRASH_BIN_EVENT_RULE_NAME","EMPTY_TRASH_BIN_EVENT_PERMISSION_NAME","EMPTY_TRASH_BIN_EVENT_RULE_TARGET","ApiGraphql","createAppModule","app","params","policy","createGraphqlLambdaPolicy","role","createLambdaRole","graphql","aws","LAMBDA_RUNTIME","pulumi","path","getCommonLambdaEnvVariables","value","VpcConfig","eventRule","JSON","routeParams","graphqlWeb","ApiGraphqlWeb","isRouteNameAllowed","console","apiGateway","coreOutput","CoreOutput","awsAccountId","getAwsAccountId","awsRegion","getAwsRegion","core","createDynamoDbStatements","tableArns","arn","Boolean"],"mappings":";;;;;;;;;;AAyBA,MAAMA,kCAAkC;AACxC,MAAMC,wCAAwC;AAC9C,MAAMC,oCAAoC;AAInC,MAAMC,aAAaC,gBAAgB;IACtC,MAAM;IACN,QAAOC,GAAc,EAAEC,MAAqB;QACxC,MAAMC,SAASC,0BAA0BH;QACzC,MAAMI,OAAOC,iBAAiBL,KAAK;YAC/B,MAAM;YACN,QAAQE,OAAO,MAAM;QACzB;QAEA,MAAMI,UAAUN,IAAI,WAAW,CAACO,uCAAAA,MAAAA,CAAAA,QAAmB,EAAE;YACjD,MAAM;YACN,QAAQ;gBACJ,aAAa;gBACb,SAASC;gBACT,SAAS;gBACT,MAAMJ,KAAK,MAAM,CAAC,GAAG;gBACrB,SAAS;gBACT,YAAY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wBACA;4BACI,KAAK;4BACL,QAAQ;4BACR,QAAQ;4BACR,UAAUA,KAAK,WAAW;wBAC9B;wBACA;4BACI,KAAK;4BACL,QAAQ;4BACR,QAAQ;4BACR,UAAUnB,0CAAAA,WAAkB,CAAC,oBAAoB,EAAEe,aAAa,eAAe,CAAC;wBACpF;2BAEII,KAAK,mBAAmB,GACtB;4BACI;gCACI,KAAK;gCACL,QAAQ;gCACR,QAAQ;gCACR,UAAU;oCACN,GAAGA,KAAK,mBAAmB,EAAE;oCAC7B,GAAGA,KAAK,mBAAmB,CAAC,EAAE,CAAC;iCAClC;4BACL;yBACH,GACD,EAAE;qBACX;gBACL;gBAEA,OAAO1B;YACX;QACJ;IACJ;AACJ;AAOA,SAAS2B,yBAAyBD,IAIjC;IACG,MAAME,YAAY;QACdF,KAAK,uBAAuB;QAC5BA,KAAK,yBAAyB;QAC9BA,KAAK,0BAA0B;KAClC,CAAC,MAAM,CAAC,CAACG,MAAuBC,QAAQD;IAEzC,IAAI,CAACD,UAAU,MAAM,EACjB,OAAO,EAAE;IAGb,OAAO;QACH;YACI,KAAK;YACL,QAAQ;YACR,QAAQ;gBACJ;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;gBACA;aACH;YACD,UAAUA,UAAU,OAAO,CAACC,CAAAA,MAAO;oBAACA;oBAAK,GAAGA,IAAI,EAAE,CAAC;iBAAC;QACxD;KACH;AACL"}
@@ -1 +1 @@
1
- {"version":3,"file":"pulumi/apps/api/ApiGraphqlWeb.js","sources":["../../../../src/pulumi/apps/api/ApiGraphqlWeb.ts"],"sourcesContent":["import path from \"path\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\nimport type { PulumiApp } from \"@webiny/pulumi\";\nimport type { PulumiAppModule } from \"@webiny/pulumi\";\nimport { createAppModule } from \"@webiny/pulumi\";\nimport { ApiGraphql } from \"./ApiGraphql.js\";\n\nexport interface GraphqlWebVpc {\n subnetIds: pulumi.Input<pulumi.Input<string>[]>;\n securityGroupIds: pulumi.Input<pulumi.Input<string>[]>;\n}\n\ninterface GraphqlWebParams {\n /**\n * The project's Pulumi resource name prefix, so the function's name carries it like the other\n * resources' names do.\n */\n namePrefix: string;\n /**\n * The subnets and security groups the regular Lambdas use, when the project has a VPC. The web\n * function reaches them through an egress network connector.\n */\n vpc: GraphqlWebVpc | null;\n /**\n * Env for the web function only, on top of the `graphql` Lambda's (and over it, for a variable\n * both have). The `graphql` Lambda and the functions that copy its env don't get it.\n */\n env?: Record<string, string>;\n}\n\nexport type ApiGraphqlWeb = PulumiAppModule<typeof ApiGraphqlWeb>;\n\n/**\n * Serves the API's HTTP routes from a Lambda web function. On by default;\n * `<Infra.Api.WebFunction enabled={false} />` turns it off.\n *\n * A web function runs `build-web/index.mjs` as a plain Node HTTP server. It only serves HTTP, so the\n * `graphql` Lambda stays: background tasks, EventBridge rules, EventBridge Scheduler and the WebSocket\n * API still invoke it. CloudFront reaches the endpoint through an OAC, and the resource policy that\n * lets it do so is created in ApiCloudfront, because it needs the distribution's ARN. With a VPC, the\n * function's outbound traffic goes through an egress network connector into the same subnets the\n * regular Lambdas use.\n */\nexport const ApiGraphqlWeb = createAppModule({\n name: \"ApiGraphqlWeb\",\n config(app: PulumiApp, params: GraphqlWebParams) {\n const graphql = app.getModule(ApiGraphql);\n\n // Lambda pins each revision to an S3 object version, so the bucket must be versioned. Never\n // add a lifecycle rule that expires old versions: a revision whose object version is gone\n // moves to Failed for good.\n const codeBucket = app.addResource(aws.s3.Bucket, {\n name: \"graphql-web-code\",\n config: {\n forceDestroy: true\n }\n });\n\n app.addResource(aws.s3.BucketPublicAccessBlock, {\n name: \"graphql-web-code-private\",\n config: {\n bucket: codeBucket.output.id,\n blockPublicAcls: true,\n blockPublicPolicy: true,\n ignorePublicAcls: true,\n restrictPublicBuckets: true\n }\n });\n\n const versioning = app.addResource(aws.s3.BucketVersioning, {\n name: \"graphql-web-code-versioning\",\n config: {\n bucket: codeBucket.output.id,\n versioningConfiguration: { status: \"Enabled\" }\n }\n });\n\n const buildWebFolder = path.join(app.paths.workspace, \"graphql/build-web\");\n const bundle = app.addResource(aws.s3.BucketObjectv2, {\n name: \"graphql-web-code-bundle\",\n config: {\n bucket: codeBucket.output.id,\n key: \"web.zip\",\n source: new pulumi.asset.AssetArchive({\n \".\": new pulumi.asset.FileArchive(buildWebFolder)\n })\n },\n opts: { dependsOn: [versioning.output] }\n });\n\n // Web functions need an explicit name. The suffix is generated once per stack, so nothing\n // else renames the function. Deriving the name from the `graphql` Lambda's did: `webiny\n // watch` makes the next deploy replace that Lambda under a new name, which replaced the web\n // function and its endpoint domain too.\n const nameSuffix = app.addResource(random.RandomId, {\n name: \"graphql-web-name-suffix\",\n config: { byteLength: 4 }\n });\n const functionName = pulumi.interpolate`${params.namePrefix}graphql-web-${nameSuffix.output.hex}`;\n\n const fn = app.addResource(aws.lambdaweb.Function, {\n name: \"graphql-web\",\n config: {\n functionName\n },\n // Replacing a web function fails: Pulumi deletes the old revision while the old endpoint\n // still routes to it, which Lambda refuses. `functionName` is the only input that forces\n // a replacement, so once the function exists, a different name (a changed resource name\n // prefix, for example) is ignored rather than applied.\n opts: { ignoreChanges: [\"functionName\"] }\n });\n\n const logGroup = app.addResource(aws.cloudwatch.LogGroup, {\n name: \"graphql-web-logs\",\n config: {\n name: pulumi.interpolate`/aws/lambda/web/${fn.output.functionName}`,\n retentionInDays: 30\n }\n });\n\n // Lambda reads the code itself, and only for this function's revisions.\n const codeAccess = app.addResource(aws.s3.BucketPolicy, {\n name: \"graphql-web-code-read\",\n config: {\n bucket: codeBucket.output.id,\n policy: pulumi.jsonStringify({\n Version: \"2012-10-17\",\n Statement: [\n {\n Effect: \"Allow\",\n Principal: { Service: \"lambda.amazonaws.com\" },\n Action: [\"s3:GetObject\", \"s3:GetObjectVersion\"],\n Resource: pulumi.interpolate`${codeBucket.output.arn}/*`,\n Condition: {\n ArnLike: {\n \"aws:SourceArn\": pulumi.interpolate`${fn.output.arn}/revision/*`\n }\n }\n }\n ]\n })\n }\n });\n\n let egressNetworkConnectorArn: pulumi.Output<string> | undefined;\n const revisionDependencies: pulumi.Input<pulumi.Resource>[] = [\n logGroup.output,\n codeAccess.output\n ];\n if (params.vpc) {\n const connector = createNetworkConnector(app, params.vpc);\n egressNetworkConnectorArn = connector.output.latestVersionArn;\n revisionDependencies.push(connector.output);\n }\n\n const graphqlEnvironment = graphql.functions.graphql.output.environment;\n const revision = app.addResource(aws.lambdaweb.FunctionRevision, {\n name: \"graphql-web-revision\",\n config: {\n functionName: fn.output.functionName,\n buildConfig: {\n runtimeConfig: { runtime: \"nodejs24.x\" },\n codeConfig: {\n s3Object: {\n bucket: bundle.output.bucket,\n key: bundle.output.key,\n versionId: bundle.output.versionId\n }\n }\n },\n serviceConfig: {\n // Same role and permissions as the `graphql` Lambda. It already trusts\n // `lambda.amazonaws.com`.\n executionRoleArn: graphql.role.output.arn,\n timeoutSeconds: 60,\n // Default is 64. One environment has a fixed 2 GB, and building the GraphQL schema\n // is memory heavy, so start lower.\n maxConcurrencyPerEnvironment: 16,\n environmentVariables: getWebFunctionEnvVariables(\n graphqlEnvironment,\n params.env\n ),\n // Unset without a VPC: the function then reaches public endpoints directly.\n egressNetworkConnectorArn,\n telemetryConfig: {\n loggingConfig: { logGroup: logGroup.output.name }\n }\n }\n },\n opts: { dependsOn: revisionDependencies }\n });\n\n const endpoint = app.addResource(aws.lambdaweb.FunctionEndpoint, {\n name: \"graphql-web-endpoint\",\n config: {\n functionName: fn.output.functionName,\n endpointName: \"main\",\n endpointType: \"HomeRegion\",\n authType: \"IamAuth\",\n // Traffic moves only when Pulumi repoints `revisionWeights`, so the replaced revision\n // can be deleted right after.\n autoDeploymentMode: \"Disabled\",\n revisionWeights: [{ revisionId: revision.output.revisionId, weight: 100 }]\n }\n });\n\n // Paths of `<Api.Route>` routes. Whoever routes HTTP to the web function (ApiCloudfront)\n // listens with `onRoute`; routes added before it listens are replayed to it.\n const routePaths: string[] = [];\n const routeListeners: Array<(routePath: string) => void> = [];\n\n return {\n fn,\n revision,\n endpoint,\n codeBucket,\n logGroup,\n addRoute(routePath: string) {\n routePaths.push(routePath);\n for (const listener of routeListeners) {\n listener(routePath);\n }\n },\n onRoute(listener: (routePath: string) => void) {\n for (const routePath of routePaths) {\n listener(routePath);\n }\n routeListeners.push(listener);\n }\n };\n }\n});\n\n/**\n * A web function runs outside the VPC. Its outbound traffic enters the VPC through an egress network\n * connector: network interfaces in the given subnets, with the given security groups, created and\n * managed by Lambda through the operator role. Same subnets and security groups as the regular\n * Lambdas, so the connector's traffic gets the same routes (NAT gateway, VPC endpoints) and the same\n * access to VPC-only resources such as OpenSearch.\n */\nfunction createNetworkConnector(app: PulumiApp, vpc: GraphqlWebVpc) {\n const operatorRole = app.addResource(aws.iam.Role, {\n name: \"graphql-web-network-connector-operator\",\n config: {\n assumeRolePolicy: JSON.stringify({\n Version: \"2012-10-17\",\n Statement: [\n {\n Effect: \"Allow\",\n // The Lambda docs name `lambda.amazonaws.com`, the provider's example names\n // `network-connectors.lambda.amazonaws.com`. Trusting both covers either.\n Principal: {\n Service: [\n \"lambda.amazonaws.com\",\n \"network-connectors.lambda.amazonaws.com\"\n ]\n },\n Action: \"sts:AssumeRole\"\n }\n ]\n })\n }\n });\n\n const operatorPolicy = app.addResource(aws.iam.RolePolicy, {\n name: \"graphql-web-network-connector-operator-policy\",\n config: {\n role: operatorRole.output.id,\n policy: JSON.stringify({\n Version: \"2012-10-17\",\n Statement: [\n {\n Sid: \"CreateENI\",\n Effect: \"Allow\",\n Action: \"ec2:CreateNetworkInterface\",\n Resource: [\n \"arn:aws:ec2:*:*:network-interface/*\",\n \"arn:aws:ec2:*:*:subnet/*\",\n \"arn:aws:ec2:*:*:security-group/*\"\n ]\n },\n {\n Sid: \"TagENI\",\n Effect: \"Allow\",\n Action: \"ec2:CreateTags\",\n Resource: \"arn:aws:ec2:*:*:network-interface/*\",\n Condition: {\n StringEquals: {\n \"ec2:ManagedResourceOperator\":\n \"network-connectors.lambda.amazonaws.com\"\n }\n }\n }\n ]\n })\n }\n });\n\n return app.addResource(aws.lambda.CoreNetworkConnector, {\n name: \"graphql-web-network-connector\",\n config: {\n operatorRole: operatorRole.output.arn,\n configuration: {\n vpcEgressConfiguration: {\n associatedComputeResourceTypes: [\"WebFunction\"],\n networkProtocol: \"IPv4\",\n subnetIds: vpc.subnetIds,\n securityGroupIds: vpc.securityGroupIds\n }\n }\n },\n // Lambda assumes the role while it creates the network interfaces.\n opts: { dependsOn: [operatorPolicy.output] }\n });\n}\n\n/**\n * The `graphql` Lambda's final environment, read from its output so that variables added later (by a\n * project's `ApiPulumi` handler, for example) reach the web function too. The web function rejects a\n * variable with an empty value, so those are left out; several usually are (OpenSearch, Okta).\n * `webFunctionEnv` (the module's `env`) goes on top.\n */\nfunction getWebFunctionEnvVariables(\n graphqlEnvironment: aws.lambda.Function[\"environment\"],\n webFunctionEnv: Record<string, string> = {}\n) {\n return graphqlEnvironment.apply(environment => {\n const overlaid: Record<string, string | undefined> = {\n ...environment?.variables,\n ...webFunctionEnv\n };\n const nodeOptions = [overlaid.NODE_OPTIONS, \"--max-old-space-size=1536\"]\n .filter(Boolean)\n .join(\" \");\n\n const variables: Record<string, string | undefined> = {\n ...overlaid,\n AWS_LAMBDA_NODEJS_ENTRYPOINT: \"index.mjs\",\n NODE_OPTIONS: nodeOptions\n };\n\n const result: Record<string, string> = {};\n for (const [name, value] of Object.entries(variables)) {\n if (value === undefined || value === null || value === \"\") {\n continue;\n }\n result[name] = value;\n }\n return result;\n });\n}\n"],"names":["ApiGraphqlWeb","createAppModule","app","params","graphql","ApiGraphql","codeBucket","aws","versioning","buildWebFolder","path","bundle","pulumi","nameSuffix","random","functionName","fn","logGroup","codeAccess","egressNetworkConnectorArn","revisionDependencies","connector","createNetworkConnector","graphqlEnvironment","revision","getWebFunctionEnvVariables","endpoint","routePaths","routeListeners","routePath","listener","vpc","operatorRole","JSON","operatorPolicy","webFunctionEnv","environment","overlaid","nodeOptions","Boolean","variables","result","name","value","Object"],"mappings":";;;;;;AA6CO,MAAMA,gBAAgBC,gBAAgB;IACzC,MAAM;IACN,QAAOC,GAAc,EAAEC,MAAwB;QAC3C,MAAMC,UAAUF,IAAI,SAAS,CAACG;QAK9B,MAAMC,aAAaJ,IAAI,WAAW,CAACK,uCAAAA,EAAAA,CAAAA,MAAa,EAAE;YAC9C,MAAM;YACN,QAAQ;gBACJ,cAAc;YAClB;QACJ;QAEAL,IAAI,WAAW,CAACK,uCAAAA,EAAAA,CAAAA,uBAA8B,EAAE;YAC5C,MAAM;YACN,QAAQ;gBACJ,QAAQD,WAAW,MAAM,CAAC,EAAE;gBAC5B,iBAAiB;gBACjB,mBAAmB;gBACnB,kBAAkB;gBAClB,uBAAuB;YAC3B;QACJ;QAEA,MAAME,aAAaN,IAAI,WAAW,CAACK,uCAAAA,EAAAA,CAAAA,gBAAuB,EAAE;YACxD,MAAM;YACN,QAAQ;gBACJ,QAAQD,WAAW,MAAM,CAAC,EAAE;gBAC5B,yBAAyB;oBAAE,QAAQ;gBAAU;YACjD;QACJ;QAEA,MAAMG,iBAAiBC,KAAK,IAAI,CAACR,IAAI,KAAK,CAAC,SAAS,EAAE;QACtD,MAAMS,SAAST,IAAI,WAAW,CAACK,uCAAAA,EAAAA,CAAAA,cAAqB,EAAE;YAClD,MAAM;YACN,QAAQ;gBACJ,QAAQD,WAAW,MAAM,CAAC,EAAE;gBAC5B,KAAK;gBACL,QAAQ,IAAIM,0CAAAA,KAAAA,CAAAA,YAAyB,CAAC;oBAClC,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C,GAAG;YACrC,eAAe;gBACX,wBAAwB;oBACpB,gCAAgC;wBAAC;qBAAc;oBAC/C,iBAAiB;oBACjB,WAAWD,IAAI,SAAS;oBACxB,kBAAkBA,IAAI,gBAAgB;gBAC1C;YACJ;QACJ;QAEA,MAAM;YAAE,WAAW;gBAACG,eAAe,MAAM;aAAC;QAAC;IAC/C;AACJ;AAQA,SAAST,2BACLF,kBAAsD,EACtDY,iBAAyC,CAAC,CAAC;IAE3C,OAAOZ,mBAAmB,KAAK,CAACa,CAAAA;QAC5B,MAAMC,WAA+C;YACjD,GAAGD,aAAa,SAAS;YACzB,GAAGD,cAAc;QACrB;QACA,MAAMG,cAAc;YAACD,SAAS,YAAY;YAAE;SAA4B,CACnE,MAAM,CAACE,SACP,IAAI,CAAC;QAEV,MAAMC,YAAgD;YAClD,GAAGH,QAAQ;YACX,8BAA8B;YAC9B,cAAcC;QAClB;QAEA,MAAMG,SAAiC,CAAC;QACxC,KAAK,MAAM,CAACC,MAAMC,MAAM,IAAIC,OAAO,OAAO,CAACJ,WACvC,IAAIG,QAAAA,SAAyCA,AAAU,OAAVA,OAG7CF,MAAM,CAACC,KAAK,GAAGC;QAEnB,OAAOF;IACX;AACJ"}
1
+ {"version":3,"file":"pulumi/apps/api/ApiGraphqlWeb.js","sources":["../../../../src/pulumi/apps/api/ApiGraphqlWeb.ts"],"sourcesContent":["import path from \"path\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\nimport type { PulumiApp } from \"@webiny/pulumi\";\nimport type { PulumiAppModule } from \"@webiny/pulumi\";\nimport { createAppModule } from \"@webiny/pulumi\";\nimport { ApiGraphql } from \"./ApiGraphql.js\";\n\nexport interface GraphqlWebVpc {\n subnetIds: pulumi.Input<pulumi.Input<string>[]>;\n securityGroupIds: pulumi.Input<pulumi.Input<string>[]>;\n}\n\ninterface GraphqlWebParams {\n /**\n * The project's Pulumi resource name prefix, so the function's name carries it like the other\n * resources' names do.\n */\n namePrefix: string;\n /**\n * The subnets and security groups the regular Lambdas use, when the project has a VPC. The web\n * function reaches them through an egress network connector.\n */\n vpc: GraphqlWebVpc | null;\n /**\n * Env for the web function only, on top of the `graphql` Lambda's (and over it, for a variable\n * both have). The `graphql` Lambda and the functions that copy its env don't get it.\n */\n env?: Record<string, string>;\n}\n\nexport type ApiGraphqlWeb = PulumiAppModule<typeof ApiGraphqlWeb>;\n\n/**\n * Serves the API's HTTP routes from a Lambda web function. On by default;\n * `<Infra.Api.WebFunction enabled={false} />` turns it off.\n *\n * A web function runs `build-web/index.mjs` as a plain Node HTTP server. It only serves HTTP, so the\n * `graphql` Lambda stays: background tasks, EventBridge rules, EventBridge Scheduler and the WebSocket\n * API still invoke it. CloudFront reaches the endpoint through an OAC, and the resource policy that\n * lets it do so is created in ApiCloudfront, because it needs the distribution's ARN. With a VPC, the\n * function's outbound traffic goes through an egress network connector into the same subnets the\n * regular Lambdas use.\n */\nexport const ApiGraphqlWeb = createAppModule({\n name: \"ApiGraphqlWeb\",\n config(app: PulumiApp, params: GraphqlWebParams) {\n const graphql = app.getModule(ApiGraphql);\n\n // Lambda pins each revision to an S3 object version, so the bucket must be versioned. Never\n // add a lifecycle rule that expires old versions: a revision whose object version is gone\n // moves to Failed for good.\n const codeBucket = app.addResource(aws.s3.Bucket, {\n name: \"graphql-web-code\",\n config: {\n forceDestroy: true\n }\n });\n\n app.addResource(aws.s3.BucketPublicAccessBlock, {\n name: \"graphql-web-code-private\",\n config: {\n bucket: codeBucket.output.id,\n blockPublicAcls: true,\n blockPublicPolicy: true,\n ignorePublicAcls: true,\n restrictPublicBuckets: true\n }\n });\n\n const versioning = app.addResource(aws.s3.BucketVersioning, {\n name: \"graphql-web-code-versioning\",\n config: {\n bucket: codeBucket.output.id,\n versioningConfiguration: { status: \"Enabled\" }\n }\n });\n\n const buildWebFolder = path.join(app.paths.workspace, \"graphql/build-web\");\n const bundle = app.addResource(aws.s3.BucketObjectv2, {\n name: \"graphql-web-code-bundle\",\n config: {\n bucket: codeBucket.output.id,\n key: \"web.zip\",\n source: new pulumi.asset.AssetArchive({\n \".\": new pulumi.asset.FileArchive(buildWebFolder)\n })\n },\n opts: { dependsOn: [versioning.output] }\n });\n\n // Web functions need an explicit name. The suffix is generated once per stack, so nothing\n // else renames the function. Deriving the name from the `graphql` Lambda's did: `webiny\n // watch` makes the next deploy replace that Lambda under a new name, which replaced the web\n // function and its endpoint domain too.\n const nameSuffix = app.addResource(random.RandomId, {\n name: \"graphql-web-name-suffix\",\n config: { byteLength: 4 }\n });\n const functionName = pulumi.interpolate`${params.namePrefix}graphql-web-${nameSuffix.output.hex}`;\n\n const fn = app.addResource(aws.lambdaweb.Function, {\n name: \"graphql-web\",\n config: {\n functionName\n },\n // Replacing a web function fails: Pulumi deletes the old revision while the old endpoint\n // still routes to it, which Lambda refuses. `functionName` is the only input that forces\n // a replacement, so once the function exists, a different name (a changed resource name\n // prefix, for example) is ignored rather than applied.\n opts: { ignoreChanges: [\"functionName\"] }\n });\n\n const logGroup = app.addResource(aws.cloudwatch.LogGroup, {\n name: \"graphql-web-logs\",\n config: {\n name: pulumi.interpolate`/aws/lambda/web/${fn.output.functionName}`,\n retentionInDays: 30\n }\n });\n\n // Lambda reads the code itself, and only for this function's revisions.\n const codeAccess = app.addResource(aws.s3.BucketPolicy, {\n name: \"graphql-web-code-read\",\n config: {\n bucket: codeBucket.output.id,\n policy: pulumi.jsonStringify({\n Version: \"2012-10-17\",\n Statement: [\n {\n Effect: \"Allow\",\n Principal: { Service: \"lambda.amazonaws.com\" },\n Action: [\"s3:GetObject\", \"s3:GetObjectVersion\"],\n Resource: pulumi.interpolate`${codeBucket.output.arn}/*`,\n Condition: {\n ArnLike: {\n \"aws:SourceArn\": pulumi.interpolate`${fn.output.arn}/revision/*`\n }\n }\n }\n ]\n })\n }\n });\n\n let egressNetworkConnectorArn: pulumi.Output<string> | undefined;\n const revisionDependencies: pulumi.Input<pulumi.Resource>[] = [\n logGroup.output,\n codeAccess.output\n ];\n if (params.vpc) {\n const connector = createNetworkConnector(app, params.vpc);\n egressNetworkConnectorArn = connector.output.latestVersionArn;\n revisionDependencies.push(connector.output);\n }\n\n const graphqlEnvironment = graphql.functions.graphql.output.environment;\n const revision = app.addResource(aws.lambdaweb.FunctionRevision, {\n name: \"graphql-web-revision\",\n config: {\n functionName: fn.output.functionName,\n buildConfig: {\n runtimeConfig: { runtime: \"nodejs24.x\" },\n codeConfig: {\n s3Object: {\n bucket: bundle.output.bucket,\n key: bundle.output.key,\n versionId: bundle.output.versionId\n }\n }\n },\n serviceConfig: {\n // Same role and permissions as the `graphql` Lambda. It already trusts\n // `lambda.amazonaws.com`.\n executionRoleArn: graphql.role.output.arn,\n timeoutSeconds: 60,\n // Default is 64. One environment has a fixed 2 GB, and building the GraphQL schema\n // is memory heavy, so start lower. On Postgres, the web function's connection pool\n // matches it (`POSTGRES_DEFAULT_POOL_SIZE` in `AuroraPostgresCluster.ts`): change\n // both together.\n maxConcurrencyPerEnvironment: 16,\n environmentVariables: getWebFunctionEnvVariables(\n graphqlEnvironment,\n params.env\n ),\n // Unset without a VPC: the function then reaches public endpoints directly.\n egressNetworkConnectorArn,\n telemetryConfig: {\n loggingConfig: { logGroup: logGroup.output.name }\n }\n }\n },\n opts: { dependsOn: revisionDependencies }\n });\n\n const endpoint = app.addResource(aws.lambdaweb.FunctionEndpoint, {\n name: \"graphql-web-endpoint\",\n config: {\n functionName: fn.output.functionName,\n endpointName: \"main\",\n endpointType: \"HomeRegion\",\n authType: \"IamAuth\",\n // Traffic moves only when Pulumi repoints `revisionWeights`, so the replaced revision\n // can be deleted right after.\n autoDeploymentMode: \"Disabled\",\n revisionWeights: [{ revisionId: revision.output.revisionId, weight: 100 }]\n }\n });\n\n // Paths of `<Api.Route>` routes. Whoever routes HTTP to the web function (ApiCloudfront)\n // listens with `onRoute`; routes added before it listens are replayed to it.\n const routePaths: string[] = [];\n const routeListeners: Array<(routePath: string) => void> = [];\n\n return {\n fn,\n revision,\n endpoint,\n codeBucket,\n logGroup,\n addRoute(routePath: string) {\n routePaths.push(routePath);\n for (const listener of routeListeners) {\n listener(routePath);\n }\n },\n onRoute(listener: (routePath: string) => void) {\n for (const routePath of routePaths) {\n listener(routePath);\n }\n routeListeners.push(listener);\n }\n };\n }\n});\n\n/**\n * A web function runs outside the VPC. Its outbound traffic enters the VPC through an egress network\n * connector: network interfaces in the given subnets, with the given security groups, created and\n * managed by Lambda through the operator role. Same subnets and security groups as the regular\n * Lambdas, so the connector's traffic gets the same routes (NAT gateway, VPC endpoints) and the same\n * access to VPC-only resources such as OpenSearch.\n */\nfunction createNetworkConnector(app: PulumiApp, vpc: GraphqlWebVpc) {\n const operatorRole = app.addResource(aws.iam.Role, {\n name: \"graphql-web-network-connector-operator\",\n config: {\n assumeRolePolicy: JSON.stringify({\n Version: \"2012-10-17\",\n Statement: [\n {\n Effect: \"Allow\",\n // The Lambda docs name `lambda.amazonaws.com`, the provider's example names\n // `network-connectors.lambda.amazonaws.com`. Trusting both covers either.\n Principal: {\n Service: [\n \"lambda.amazonaws.com\",\n \"network-connectors.lambda.amazonaws.com\"\n ]\n },\n Action: \"sts:AssumeRole\"\n }\n ]\n })\n }\n });\n\n const operatorPolicy = app.addResource(aws.iam.RolePolicy, {\n name: \"graphql-web-network-connector-operator-policy\",\n config: {\n role: operatorRole.output.id,\n policy: JSON.stringify({\n Version: \"2012-10-17\",\n Statement: [\n {\n Sid: \"CreateENI\",\n Effect: \"Allow\",\n Action: \"ec2:CreateNetworkInterface\",\n Resource: [\n \"arn:aws:ec2:*:*:network-interface/*\",\n \"arn:aws:ec2:*:*:subnet/*\",\n \"arn:aws:ec2:*:*:security-group/*\"\n ]\n },\n {\n Sid: \"TagENI\",\n Effect: \"Allow\",\n Action: \"ec2:CreateTags\",\n Resource: \"arn:aws:ec2:*:*:network-interface/*\",\n Condition: {\n StringEquals: {\n \"ec2:ManagedResourceOperator\":\n \"network-connectors.lambda.amazonaws.com\"\n }\n }\n }\n ]\n })\n }\n });\n\n return app.addResource(aws.lambda.CoreNetworkConnector, {\n name: \"graphql-web-network-connector\",\n config: {\n operatorRole: operatorRole.output.arn,\n configuration: {\n vpcEgressConfiguration: {\n associatedComputeResourceTypes: [\"WebFunction\"],\n networkProtocol: \"IPv4\",\n subnetIds: vpc.subnetIds,\n securityGroupIds: vpc.securityGroupIds\n }\n }\n },\n // Lambda assumes the role while it creates the network interfaces.\n opts: { dependsOn: [operatorPolicy.output] }\n });\n}\n\n/**\n * The `graphql` Lambda's final environment, read from its output so that variables added later (by a\n * project's `ApiPulumi` handler, for example) reach the web function too. The web function rejects a\n * variable with an empty value, so those are left out; several usually are (OpenSearch, Okta).\n * `webFunctionEnv` (the module's `env`) goes on top.\n */\nfunction getWebFunctionEnvVariables(\n graphqlEnvironment: aws.lambda.Function[\"environment\"],\n webFunctionEnv: Record<string, string> = {}\n) {\n return graphqlEnvironment.apply(environment => {\n const overlaid: Record<string, string | undefined> = {\n ...environment?.variables,\n ...webFunctionEnv\n };\n const nodeOptions = [overlaid.NODE_OPTIONS, \"--max-old-space-size=1536\"]\n .filter(Boolean)\n .join(\" \");\n\n const variables: Record<string, string | undefined> = {\n ...overlaid,\n AWS_LAMBDA_NODEJS_ENTRYPOINT: \"index.mjs\",\n NODE_OPTIONS: nodeOptions\n };\n\n const result: Record<string, string> = {};\n for (const [name, value] of Object.entries(variables)) {\n if (value === undefined || value === null || value === \"\") {\n continue;\n }\n result[name] = value;\n }\n return result;\n });\n}\n"],"names":["ApiGraphqlWeb","createAppModule","app","params","graphql","ApiGraphql","codeBucket","aws","versioning","buildWebFolder","path","bundle","pulumi","nameSuffix","random","functionName","fn","logGroup","codeAccess","egressNetworkConnectorArn","revisionDependencies","connector","createNetworkConnector","graphqlEnvironment","revision","getWebFunctionEnvVariables","endpoint","routePaths","routeListeners","routePath","listener","vpc","operatorRole","JSON","operatorPolicy","webFunctionEnv","environment","overlaid","nodeOptions","Boolean","variables","result","name","value","Object"],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mBAAmB,KAAK,CAACa,CAAAA;QAC5B,MAAMC,WAA+C;YACjD,GAAGD,aAAa,SAAS;YACzB,GAAGD,cAAc;QACrB;QACA,MAAMG,cAAc;YAACD,SAAS,YAAY;YAAE;SAA4B,CACnE,MAAM,CAACE,SACP,IAAI,CAAC;QAEV,MAAMC,YAAgD;YAClD,GAAGH,QAAQ;YACX,8BAA8B;YAC9B,cAAcC;QAClB;QAEA,MAAMG,SAAiC,CAAC;QACxC,KAAK,MAAM,CAACC,MAAMC,MAAM,IAAIC,OAAO,OAAO,CAACJ,WACvC,IAAIG,QAAAA,SAAyCA,AAAU,OAAVA,OAG7CF,MAAM,CAACC,KAAK,GAAGC;QAEnB,OAAOF;IACX;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"pulumi/apps/api/ApiOutput.js","sources":["../../../../src/pulumi/apps/api/ApiOutput.ts"],"sourcesContent":["import type { PulumiAppModule } from \"@webiny/pulumi\";\nimport { createAppModule } from \"@webiny/pulumi\";\nimport { getStackOutput } from \"~/pulumi/getStackOutput.js\";\nimport { type IDefaultStackOutput } from \"~/pulumi/types.js\";\n\nexport type ApiOutput = PulumiAppModule<typeof ApiOutput>;\n\nexport const ApiOutput = createAppModule({\n name: \"ApiOutput\",\n config(app) {\n return app.addHandler(async () => {\n const output = await getStackOutput<IDefaultStackOutput>(\"api\");\n\n if (!output) {\n throw new Error(\"API application is not deployed.\");\n }\n\n return {\n apiDomain: output[\"apiDomain\"],\n apiUrl: output[\"apiUrl\"],\n graphqlLambdaRole: output[\"graphqlLambdaRole\"],\n graphqlLambdaRoleName: output[\"graphqlLambdaRoleName\"],\n cognitoAppClientId: output[\"cognitoAppClientId\"],\n cognitoUserPoolId: output[\"cognitoUserPoolId\"],\n cognitoUserPoolPasswordPolicy: output[\"cognitoUserPoolPasswordPolicy\"],\n dynamoDbTable: output[\"dynamoDbTable\"],\n region: output[\"region\"],\n websocketApiId: output[\"websocketApiId\"],\n websocketApiUrl: output[\"websocketApiUrl\"],\n graphqlLambdaName: output[\"graphqlLambdaName\"],\n backgroundTaskLambdaArn: output[\"backgroundTaskLambdaArn\"],\n backgroundTaskStepFunctionArn: output[\"backgroundTaskStepFunctionArn\"],\n fileManagerManageLambdaArn: output[\"fileManagerManageLambdaArn\"],\n fileManagerManageLambdaRole: output[\"fileManagerManageLambdaRole\"],\n fileManagerManageLambdaRoleName: output[\"fileManagerManageLambdaRoleName\"],\n fileManagerDownloadLambdaArn: output[\"fileManagerDownloadLambdaArn\"],\n // Set with `<Infra.Postgres />` only.\n schemaSetupLambdaArn: output[\"schemaSetupLambdaArn\"]\n };\n });\n }\n});\n"],"names":["ApiOutput","createAppModule","app","output","getStackOutput","Error"],"mappings":";;AAOO,MAAMA,YAAYC,gBAAgB;IACrC,MAAM;IACN,QAAOC,GAAG;QACN,OAAOA,IAAI,UAAU,CAAC;YAClB,MAAMC,SAAS,MAAMC,eAAoC;YAEzD,IAAI,CAACD,QACD,MAAM,IAAIE,MAAM;YAGpB,OAAO;gBACH,WAAWF,MAAM,CAAC,YAAY;gBAC9B,QAAQA,MAAM,CAAC,SAAS;gBACxB,mBAAmBA,MAAM,CAAC,oBAAoB;gBAC9C,uBAAuBA,MAAM,CAAC,wBAAwB;gBACtD,oBAAoBA,MAAM,CAAC,qBAAqB;gBAChD,mBAAmBA,MAAM,CAAC,oBAAoB;gBAC9C,+BAA+BA,MAAM,CAAC,gCAAgC;gBACtE,eAAeA,MAAM,CAAC,gBAAgB;gBACtC,QAAQA,MAAM,CAAC,SAAS;gBACxB,gBAAgBA,MAAM,CAAC,iBAAiB;gBACxC,iBAAiBA,MAAM,CAAC,kBAAkB;gBAC1C,mBAAmBA,MAAM,CAAC,oBAAoB;gBAC9C,yBAAyBA,MAAM,CAAC,0BAA0B;gBAC1D,+BAA+BA,MAAM,CAAC,gCAAgC;gBACtE,4BAA4BA,MAAM,CAAC,6BAA6B;gBAChE,6BAA6BA,MAAM,CAAC,8BAA8B;gBAClE,iCAAiCA,MAAM,CAAC,kCAAkC;gBAC1E,8BAA8BA,MAAM,CAAC,+BAA+B;gBAEpE,sBAAsBA,MAAM,CAAC,uBAAuB;YACxD;QACJ;IACJ;AACJ"}
1
+ {"version":3,"file":"pulumi/apps/api/ApiOutput.js","sources":["../../../../src/pulumi/apps/api/ApiOutput.ts"],"sourcesContent":["import type { PulumiAppModule } from \"@webiny/pulumi\";\nimport { createAppModule } from \"@webiny/pulumi\";\nimport { getStackOutput } from \"~/pulumi/getStackOutput.js\";\nimport { type IDefaultStackOutput } from \"~/pulumi/types.js\";\n\nexport type ApiOutput = PulumiAppModule<typeof ApiOutput>;\n\nexport const ApiOutput = createAppModule({\n name: \"ApiOutput\",\n config(app) {\n return app.addHandler(async () => {\n const output = await getStackOutput<IDefaultStackOutput>(\"api\");\n\n if (!output) {\n throw new Error(\"API application is not deployed.\");\n }\n\n return {\n apiDomain: output[\"apiDomain\"],\n apiUrl: output[\"apiUrl\"],\n graphqlLambdaRole: output[\"graphqlLambdaRole\"],\n graphqlLambdaRoleName: output[\"graphqlLambdaRoleName\"],\n cognitoAppClientId: output[\"cognitoAppClientId\"],\n cognitoUserPoolId: output[\"cognitoUserPoolId\"],\n cognitoUserPoolPasswordPolicy: output[\"cognitoUserPoolPasswordPolicy\"],\n dynamoDbTable: output[\"dynamoDbTable\"],\n region: output[\"region\"],\n websocketApiId: output[\"websocketApiId\"],\n websocketApiUrl: output[\"websocketApiUrl\"],\n graphqlLambdaName: output[\"graphqlLambdaName\"],\n backgroundTaskLambdaArn: output[\"backgroundTaskLambdaArn\"],\n backgroundTaskStepFunctionArn: output[\"backgroundTaskStepFunctionArn\"],\n fileManagerManageLambdaArn: output[\"fileManagerManageLambdaArn\"],\n fileManagerManageLambdaRole: output[\"fileManagerManageLambdaRole\"],\n fileManagerManageLambdaRoleName: output[\"fileManagerManageLambdaRoleName\"],\n fileManagerDownloadLambdaArn: output[\"fileManagerDownloadLambdaArn\"],\n // Set with `<Infra.AuroraPostgres />` only.\n schemaSetupLambdaArn: output[\"schemaSetupLambdaArn\"]\n };\n });\n }\n});\n"],"names":["ApiOutput","createAppModule","app","output","getStackOutput","Error"],"mappings":";;AAOO,MAAMA,YAAYC,gBAAgB;IACrC,MAAM;IACN,QAAOC,GAAG;QACN,OAAOA,IAAI,UAAU,CAAC;YAClB,MAAMC,SAAS,MAAMC,eAAoC;YAEzD,IAAI,CAACD,QACD,MAAM,IAAIE,MAAM;YAGpB,OAAO;gBACH,WAAWF,MAAM,CAAC,YAAY;gBAC9B,QAAQA,MAAM,CAAC,SAAS;gBACxB,mBAAmBA,MAAM,CAAC,oBAAoB;gBAC9C,uBAAuBA,MAAM,CAAC,wBAAwB;gBACtD,oBAAoBA,MAAM,CAAC,qBAAqB;gBAChD,mBAAmBA,MAAM,CAAC,oBAAoB;gBAC9C,+BAA+BA,MAAM,CAAC,gCAAgC;gBACtE,eAAeA,MAAM,CAAC,gBAAgB;gBACtC,QAAQA,MAAM,CAAC,SAAS;gBACxB,gBAAgBA,MAAM,CAAC,iBAAiB;gBACxC,iBAAiBA,MAAM,CAAC,kBAAkB;gBAC1C,mBAAmBA,MAAM,CAAC,oBAAoB;gBAC9C,yBAAyBA,MAAM,CAAC,0BAA0B;gBAC1D,+BAA+BA,MAAM,CAAC,gCAAgC;gBACtE,4BAA4BA,MAAM,CAAC,6BAA6B;gBAChE,6BAA6BA,MAAM,CAAC,8BAA8B;gBAClE,iCAAiCA,MAAM,CAAC,kCAAkC;gBAC1E,8BAA8BA,MAAM,CAAC,+BAA+B;gBAEpE,sBAAsBA,MAAM,CAAC,uBAAuB;YACxD;QACJ;IACJ;AACJ"}