@webiny/project-aws 0.0.0-unstable.a4f3e4ea8b → 0.0.0-unstable.a85ef555b2

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 (182) hide show
  1. package/_templates/appTemplates/api/graphql/package.json +3 -21
  2. package/_templates/appTemplates/api/graphql/src/index.ts +19 -89
  3. package/_templates/extensions/OpenSearch/api/graphql/src/index.ts +17 -101
  4. package/_templates/extensions/OpenSearch/coreDdbToEsHandler/dynamoToElastic/src/index.ts +15 -9
  5. package/abstractions/ApiGqlClient.js +1 -1
  6. package/abstractions/ApiGqlClient.js.map +1 -1
  7. package/abstractions/InvokeLambdaFunction.js +1 -1
  8. package/abstractions/InvokeLambdaFunction.js.map +1 -1
  9. package/abstractions/services/ApiStackOutputService.d.ts +14 -1
  10. package/abstractions/services/ApiStackOutputService.js.map +1 -1
  11. package/admin.d.ts +6 -0
  12. package/admin.js +4 -2
  13. package/admin.js.map +1 -1
  14. package/apps/createApiApp.d.ts +8 -0
  15. package/extensions/ApiRoute.d.ts +1 -1
  16. package/extensions/ApiRoute.js +16 -30
  17. package/extensions/ApiRoute.js.map +1 -1
  18. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.d.ts +1 -1
  19. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js +1 -2
  20. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js.map +1 -1
  21. package/extensions/ProjectAws/BuildAppWorkspace.d.ts +3 -2
  22. package/extensions/ProjectAws/BuildAppWorkspace.js +38 -11
  23. package/extensions/ProjectAws/BuildAppWorkspace.js.map +1 -1
  24. package/extensions/ProjectAws/BuildProjectWorkspace.d.ts +12 -0
  25. package/extensions/ProjectAws/BuildProjectWorkspace.js +30 -0
  26. package/extensions/ProjectAws/BuildProjectWorkspace.js.map +1 -0
  27. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.d.ts +11 -0
  28. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js +30 -0
  29. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js.map +1 -0
  30. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.d.ts +11 -0
  31. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js +30 -0
  32. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js.map +1 -0
  33. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.d.ts +11 -0
  34. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js +30 -0
  35. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js.map +1 -0
  36. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js +1 -1
  37. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js.map +1 -1
  38. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.d.ts +11 -0
  39. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js +31 -0
  40. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js.map +1 -0
  41. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.d.ts +13 -0
  42. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js +34 -0
  43. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js.map +1 -0
  44. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js +2 -3
  45. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js.map +1 -1
  46. package/extensions/ProjectAws/TelemetryNoLongerNewUser.d.ts +8 -0
  47. package/extensions/ProjectAws/TelemetryNoLongerNewUser.js +14 -0
  48. package/extensions/ProjectAws/TelemetryNoLongerNewUser.js.map +1 -0
  49. package/extensions/ProjectAws/UploadAdminAppToS3.js +1 -1
  50. package/extensions/ProjectAws/UploadAdminAppToS3.js.map +1 -1
  51. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.d.ts +12 -0
  52. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js +31 -0
  53. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js.map +1 -0
  54. package/extensions/ProjectAws/ValidateProductionPulumiState.d.ts +12 -0
  55. package/extensions/ProjectAws/ValidateProductionPulumiState.js +33 -0
  56. package/extensions/ProjectAws/ValidateProductionPulumiState.js.map +1 -0
  57. package/extensions/ProjectAws/definitions.js +1 -3
  58. package/extensions/ProjectAws/definitions.js.map +1 -1
  59. package/extensions/ProjectAws.js +18 -4
  60. package/extensions/ProjectAws.js.map +1 -1
  61. package/extensions/RegisterRoutesPulumi.js +3 -6
  62. package/extensions/RegisterRoutesPulumi.js.map +1 -1
  63. package/extensions/definitions.js +0 -2
  64. package/extensions/definitions.js.map +1 -1
  65. package/extensions/index.d.ts +0 -1
  66. package/extensions/index.js +0 -1
  67. package/extensions/routePath.d.ts +20 -0
  68. package/extensions/routePath.js +13 -0
  69. package/extensions/routePath.js.map +1 -0
  70. package/features/InvokeLambdaFunction.js +1 -1
  71. package/features/InvokeLambdaFunction.js.map +1 -1
  72. package/features/Watch/AwsWatch.d.ts +17 -0
  73. package/features/Watch/AwsWatch.js +108 -0
  74. package/features/Watch/AwsWatch.js.map +1 -0
  75. package/features/Watch/getIotEndpoint.d.ts +2 -0
  76. package/features/Watch/getIotEndpoint.js +18 -0
  77. package/features/Watch/getIotEndpoint.js.map +1 -0
  78. package/features/Watch/handler/handler.zip +0 -0
  79. package/features/Watch/replaceLambdaFunctions.d.ts +19 -0
  80. package/features/Watch/replaceLambdaFunctions.js +72 -0
  81. package/features/Watch/replaceLambdaFunctions.js.map +1 -0
  82. package/index.d.ts +1 -0
  83. package/index.js +1 -0
  84. package/infra.d.ts +44 -0
  85. package/infra.js +18 -4
  86. package/infra.js.map +1 -1
  87. package/package.json +19 -16
  88. package/project.d.ts +27 -17
  89. package/project.js +3 -2
  90. package/project.js.map +1 -1
  91. package/pulumi/apps/admin/createAdminPulumiApp.js +4 -2
  92. package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
  93. package/pulumi/apps/api/ApiCloudfront.js +105 -2
  94. package/pulumi/apps/api/ApiCloudfront.js.map +1 -1
  95. package/pulumi/apps/api/ApiGraphqlStream.d.ts +29 -0
  96. package/pulumi/apps/api/ApiGraphqlStream.js +58 -0
  97. package/pulumi/apps/api/ApiGraphqlStream.js.map +1 -0
  98. package/pulumi/apps/api/ApiOutput.d.ts +6 -6
  99. package/pulumi/apps/api/ApiOutput.js +1 -1
  100. package/pulumi/apps/api/ApiOutput.js.map +1 -1
  101. package/pulumi/apps/api/createApiPulumiApp.d.ts +8 -0
  102. package/pulumi/apps/api/createApiPulumiApp.js +28 -20
  103. package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
  104. package/pulumi/apps/api/index.d.ts +1 -0
  105. package/pulumi/apps/api/index.js +1 -0
  106. package/pulumi/apps/awsUtils.d.ts +1 -1
  107. package/pulumi/apps/awsUtils.js +2 -2
  108. package/pulumi/apps/awsUtils.js.map +1 -1
  109. package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js +2 -2
  110. package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js.map +1 -1
  111. package/pulumi/apps/blueGreen/domains/getApplicationDomains.js +1 -1
  112. package/pulumi/apps/blueGreen/domains/getApplicationDomains.js.map +1 -1
  113. package/pulumi/apps/blueGreen/types.d.ts +0 -3
  114. package/pulumi/apps/common/CoreOutput.d.ts +2 -1
  115. package/pulumi/apps/common/CoreOutput.js +2 -2
  116. package/pulumi/apps/common/CoreOutput.js.map +1 -1
  117. package/pulumi/apps/core/CoreAuditLogsDynamo.d.ts +1 -0
  118. package/pulumi/apps/core/CoreAuditLogsDynamo.js +3 -0
  119. package/pulumi/apps/core/CoreAuditLogsDynamo.js.map +1 -1
  120. package/pulumi/apps/core/CoreDynamo.d.ts +1 -0
  121. package/pulumi/apps/core/CoreDynamo.js +3 -0
  122. package/pulumi/apps/core/CoreDynamo.js.map +1 -1
  123. package/pulumi/apps/core/CoreFileManager.d.ts +2 -0
  124. package/pulumi/apps/core/CoreFileManager.js +11 -1
  125. package/pulumi/apps/core/CoreFileManager.js.map +1 -1
  126. package/pulumi/apps/core/CoreOpenSearch.d.ts +1 -0
  127. package/pulumi/apps/core/CoreOpenSearch.js +3 -0
  128. package/pulumi/apps/core/CoreOpenSearch.js.map +1 -1
  129. package/pulumi/apps/core/createCorePulumiApp.js +16 -7
  130. package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
  131. package/pulumi/apps/extensions/isProductionDefaultEnabled.d.ts +16 -0
  132. package/pulumi/apps/extensions/isProductionDefaultEnabled.js +9 -0
  133. package/pulumi/apps/extensions/isProductionDefaultEnabled.js.map +1 -0
  134. package/pulumi/apps/react/createReactPulumiApp.js +2 -2
  135. package/pulumi/apps/react/createReactPulumiApp.js.map +1 -1
  136. package/pulumi/apps/syncSystem/SyncSystemLambda.d.ts +1 -1
  137. package/pulumi/apps/syncSystem/SyncSystemLambda.js +1 -1
  138. package/pulumi/apps/syncSystem/SyncSystemLambda.js.map +1 -1
  139. package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js +2 -2
  140. package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js.map +1 -1
  141. package/pulumi/apps/syncSystem/getSyncSystemOutput.d.ts +1 -1
  142. package/pulumi/apps/syncSystem/getSyncSystemOutput.js +1 -1
  143. package/pulumi/apps/syncSystem/getSyncSystemOutput.js.map +1 -1
  144. package/pulumi/extensions/DynamoDbPitr.d.ts +4 -0
  145. package/pulumi/extensions/DynamoDbPitr.js +15 -0
  146. package/pulumi/extensions/DynamoDbPitr.js.map +1 -0
  147. package/pulumi/extensions/S3BucketVersioning.d.ts +4 -0
  148. package/pulumi/extensions/S3BucketVersioning.js +15 -0
  149. package/pulumi/extensions/S3BucketVersioning.js.map +1 -0
  150. package/pulumi/extensions/index.d.ts +9 -3
  151. package/pulumi/extensions/index.js +6 -2
  152. package/pulumi/extensions/index.js.map +1 -1
  153. package/pulumi/getAwsProjectSdk.d.ts +12 -0
  154. package/pulumi/getAwsProjectSdk.js +6 -0
  155. package/pulumi/getAwsProjectSdk.js.map +1 -0
  156. package/pulumi/getStackOutput.d.ts +7 -0
  157. package/pulumi/getStackOutput.js +8 -0
  158. package/pulumi/getStackOutput.js.map +1 -0
  159. package/pulumi/types.d.ts +2 -1
  160. package/pulumi/utils/getDistributionUrl.d.ts +9 -0
  161. package/pulumi/utils/getDistributionUrl.js +8 -0
  162. package/pulumi/utils/getDistributionUrl.js.map +1 -0
  163. package/pulumi/utils/index.d.ts +1 -0
  164. package/pulumi/utils/index.js +1 -0
  165. package/pulumi/utils/lambdaEnvVariables.js +4 -16
  166. package/pulumi/utils/lambdaEnvVariables.js.map +1 -1
  167. package/registerAwsProjectFeatures.d.ts +8 -0
  168. package/registerAwsProjectFeatures.js +55 -0
  169. package/registerAwsProjectFeatures.js.map +1 -0
  170. package/services/GetPulumiService/GetPulumiService.d.ts +8 -0
  171. package/services/GetPulumiService/GetPulumiService.js +44 -0
  172. package/services/GetPulumiService/GetPulumiService.js.map +1 -0
  173. package/utils/getPulumiBaseTemplatesFolderPath.d.ts +1 -0
  174. package/utils/getPulumiBaseTemplatesFolderPath.js +10 -0
  175. package/utils/getPulumiBaseTemplatesFolderPath.js.map +1 -0
  176. package/utils/index.d.ts +1 -0
  177. package/utils/index.js +1 -0
  178. package/_templates/appTemplates/api/graphql/src/security.ts +0 -43
  179. package/_templates/extensions/sqlite/api/graphql/src/index.ts +0 -90
  180. package/extensions/Encryption.d.ts +0 -10
  181. package/extensions/Encryption.js +0 -36
  182. package/extensions/Encryption.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { getStackOutput } from "@webiny/project";
1
+ import { getStackOutput } from "../../../getStackOutput.js";
2
2
  const apps = [
3
3
  "api",
4
4
  "admin"
@@ -1 +1 @@
1
- {"version":3,"file":"pulumi/apps/blueGreen/domains/getApplicationDomains.js","sources":["../../../../../src/pulumi/apps/blueGreen/domains/getApplicationDomains.ts"],"sourcesContent":["import { type AppName, getStackOutput } from \"@webiny/project\";\nimport { type IDefaultStackOutput } from \"~/pulumi/types.js\";\n\nexport interface IGetStacksStack {\n name: string;\n env: string;\n variant: string | undefined;\n}\n\nexport interface IGetApplicationStacks {\n stacks: IGetStacksStack[];\n}\n\nconst apps: AppName[] = [\"api\", \"admin\"];\n\ninterface IPromiseResult {\n app: string;\n env: string;\n variant: string | undefined;\n name: string;\n stack: IDefaultStackOutput;\n}\n\nexport interface IGetApplicationStacksResultStack {\n env: string;\n variant: string | undefined;\n api: string;\n admin: string;\n}\n\nexport interface IGetApplicationStacksResult {\n [name: string]: IGetApplicationStacksResultStack;\n}\n\nconst removeProtocol = (url: string): string => {\n return url.replace(/^https?:\\/\\//, \"\");\n};\n\nconst getApiDomainName = (results: IPromiseResult[], name: string): string => {\n const api = results.find(r => r.name === name && r.app === \"api\");\n if (!api?.stack?.apiDomain) {\n throw new Error(`Missing API stack for \"${name}\" deployment.`);\n }\n return removeProtocol(api.stack.apiDomain);\n};\n\nconst getAdminDomainName = (results: IPromiseResult[], name: string): string => {\n const admin = results.find(r => r.name === name && r.app === \"admin\");\n if (!admin?.stack?.appDomain) {\n throw new Error(`Missing Admin stack for \"${name}\" deployment.`);\n }\n return removeProtocol(admin.stack.appDomain);\n};\n\nconst getEnv = (results: IPromiseResult[], name: string): string => {\n const env = results.find(r => r.name === name);\n if (!env) {\n throw new Error(`Missing environment for \"${name}\" deployment.`);\n }\n return env.env;\n};\n\nconst getVariant = (results: IPromiseResult[], name: string): string | undefined => {\n const variant = results.find(r => r.name === name);\n if (!variant) {\n throw new Error(`Missing variant for \"${name}\" deployment.`);\n }\n return variant.variant;\n};\n\nexport const getApplicationDomains = async (\n params: IGetApplicationStacks\n): Promise<IGetApplicationStacksResult> => {\n const promises: Promise<IPromiseResult>[] = [];\n\n for (const stack of params.stacks) {\n for (const app of apps) {\n promises.push(\n new Promise<IPromiseResult>(async resolve => {\n const result = await getStackOutput<IDefaultStackOutput>(app);\n\n resolve({\n env: stack.env,\n variant: stack.variant,\n name: stack.name,\n app,\n stack: result!\n });\n })\n );\n }\n }\n const results = await Promise.all(promises);\n const deployments: IGetApplicationStacksResult = {};\n const names = params.stacks.map(s => s.name);\n try {\n for (const name of names) {\n const env = getEnv(results, name);\n const variant = getVariant(results, name);\n const api = getApiDomainName(results, name);\n const admin = getAdminDomainName(results, name);\n\n deployments[name] = {\n env,\n variant,\n api,\n admin\n };\n }\n return deployments;\n } catch (ex) {\n console.error(ex.message);\n throw ex;\n }\n};\n"],"names":["apps","removeProtocol","url","getApiDomainName","results","name","api","r","Error","getAdminDomainName","admin","getEnv","env","getVariant","variant","getApplicationDomains","params","promises","stack","app","Promise","resolve","result","getStackOutput","deployments","names","s","ex","console"],"mappings":";AAaA,MAAMA,OAAkB;IAAC;IAAO;CAAQ;AAqBxC,MAAMC,iBAAiB,CAACC,MACbA,IAAI,OAAO,CAAC,gBAAgB;AAGvC,MAAMC,mBAAmB,CAACC,SAA2BC;IACjD,MAAMC,MAAMF,QAAQ,IAAI,CAACG,CAAAA,IAAKA,EAAE,IAAI,KAAKF,QAAQE,AAAU,UAAVA,EAAE,GAAG;IACtD,IAAI,CAACD,KAAK,OAAO,WACb,MAAM,IAAIE,MAAM,CAAC,uBAAuB,EAAEH,KAAK,aAAa,CAAC;IAEjE,OAAOJ,eAAeK,IAAI,KAAK,CAAC,SAAS;AAC7C;AAEA,MAAMG,qBAAqB,CAACL,SAA2BC;IACnD,MAAMK,QAAQN,QAAQ,IAAI,CAACG,CAAAA,IAAKA,EAAE,IAAI,KAAKF,QAAQE,AAAU,YAAVA,EAAE,GAAG;IACxD,IAAI,CAACG,OAAO,OAAO,WACf,MAAM,IAAIF,MAAM,CAAC,yBAAyB,EAAEH,KAAK,aAAa,CAAC;IAEnE,OAAOJ,eAAeS,MAAM,KAAK,CAAC,SAAS;AAC/C;AAEA,MAAMC,SAAS,CAACP,SAA2BC;IACvC,MAAMO,MAAMR,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"}
1
+ {"version":3,"file":"pulumi/apps/blueGreen/domains/getApplicationDomains.js","sources":["../../../../../src/pulumi/apps/blueGreen/domains/getApplicationDomains.ts"],"sourcesContent":["import { type AppName } from \"@webiny/project\";\nimport { getStackOutput } from \"~/pulumi/getStackOutput.js\";\nimport { type IDefaultStackOutput } from \"~/pulumi/types.js\";\n\nexport interface IGetStacksStack {\n name: string;\n env: string;\n variant: string | undefined;\n}\n\nexport interface IGetApplicationStacks {\n stacks: IGetStacksStack[];\n}\n\nconst apps: AppName[] = [\"api\", \"admin\"];\n\ninterface IPromiseResult {\n app: string;\n env: string;\n variant: string | undefined;\n name: string;\n stack: IDefaultStackOutput;\n}\n\nexport interface IGetApplicationStacksResultStack {\n env: string;\n variant: string | undefined;\n api: string;\n admin: string;\n}\n\nexport interface IGetApplicationStacksResult {\n [name: string]: IGetApplicationStacksResultStack;\n}\n\nconst removeProtocol = (url: string): string => {\n return url.replace(/^https?:\\/\\//, \"\");\n};\n\nconst getApiDomainName = (results: IPromiseResult[], name: string): string => {\n const api = results.find(r => r.name === name && r.app === \"api\");\n if (!api?.stack?.apiDomain) {\n throw new Error(`Missing API stack for \"${name}\" deployment.`);\n }\n return removeProtocol(api.stack.apiDomain);\n};\n\nconst getAdminDomainName = (results: IPromiseResult[], name: string): string => {\n const admin = results.find(r => r.name === name && r.app === \"admin\");\n if (!admin?.stack?.appDomain) {\n throw new Error(`Missing Admin stack for \"${name}\" deployment.`);\n }\n return removeProtocol(admin.stack.appDomain);\n};\n\nconst getEnv = (results: IPromiseResult[], name: string): string => {\n const env = results.find(r => r.name === name);\n if (!env) {\n throw new Error(`Missing environment for \"${name}\" deployment.`);\n }\n return env.env;\n};\n\nconst getVariant = (results: IPromiseResult[], name: string): string | undefined => {\n const variant = results.find(r => r.name === name);\n if (!variant) {\n throw new Error(`Missing variant for \"${name}\" deployment.`);\n }\n return variant.variant;\n};\n\nexport const getApplicationDomains = async (\n params: IGetApplicationStacks\n): Promise<IGetApplicationStacksResult> => {\n const promises: Promise<IPromiseResult>[] = [];\n\n for (const stack of params.stacks) {\n for (const app of apps) {\n promises.push(\n new Promise<IPromiseResult>(async resolve => {\n const result = await getStackOutput<IDefaultStackOutput>(app);\n\n resolve({\n env: stack.env,\n variant: stack.variant,\n name: stack.name,\n app,\n stack: result!\n });\n })\n );\n }\n }\n const results = await Promise.all(promises);\n const deployments: IGetApplicationStacksResult = {};\n const names = params.stacks.map(s => s.name);\n try {\n for (const name of names) {\n const env = getEnv(results, name);\n const variant = getVariant(results, name);\n const api = getApiDomainName(results, name);\n const admin = getAdminDomainName(results, name);\n\n deployments[name] = {\n env,\n variant,\n api,\n admin\n };\n }\n return deployments;\n } catch (ex) {\n console.error(ex.message);\n throw ex;\n }\n};\n"],"names":["apps","removeProtocol","url","getApiDomainName","results","name","api","r","Error","getAdminDomainName","admin","getEnv","env","getVariant","variant","getApplicationDomains","params","promises","stack","app","Promise","resolve","result","getStackOutput","deployments","names","s","ex","console"],"mappings":";AAcA,MAAMA,OAAkB;IAAC;IAAO;CAAQ;AAqBxC,MAAMC,iBAAiB,CAACC,MACbA,IAAI,OAAO,CAAC,gBAAgB;AAGvC,MAAMC,mBAAmB,CAACC,SAA2BC;IACjD,MAAMC,MAAMF,QAAQ,IAAI,CAACG,CAAAA,IAAKA,EAAE,IAAI,KAAKF,QAAQE,AAAU,UAAVA,EAAE,GAAG;IACtD,IAAI,CAACD,KAAK,OAAO,WACb,MAAM,IAAIE,MAAM,CAAC,uBAAuB,EAAEH,KAAK,aAAa,CAAC;IAEjE,OAAOJ,eAAeK,IAAI,KAAK,CAAC,SAAS;AAC7C;AAEA,MAAMG,qBAAqB,CAACL,SAA2BC;IACnD,MAAMK,QAAQN,QAAQ,IAAI,CAACG,CAAAA,IAAKA,EAAE,IAAI,KAAKF,QAAQE,AAAU,YAAVA,EAAE,GAAG;IACxD,IAAI,CAACG,OAAO,OAAO,WACf,MAAM,IAAIF,MAAM,CAAC,yBAAyB,EAAEH,KAAK,aAAa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;gBACAI;YACJ;QACJ;QACA,OAAOc;IACX,EAAE,OAAOG,IAAI;QACTC,QAAQ,KAAK,CAACD,GAAG,OAAO;QACxB,MAAMA;IACV;AACJ"}
@@ -69,9 +69,6 @@ export type IResolvedDomains = IResolvedDomain[];
69
69
  export interface IBlueGreenStackOutput extends IStackOutput {
70
70
  distributionDomain: string;
71
71
  distributionUrl: string;
72
- /**
73
- * TODO fix later
74
- */
75
72
  environments?: IResolvedDomains;
76
73
  domains?: string[];
77
74
  }
@@ -1,4 +1,5 @@
1
1
  import { type PulumiAppModule } from "@webiny/pulumi";
2
+ import type { IApiStackOutputPasswordPolicy } from "../../../abstractions/index.js";
2
3
  export type CoreOutput = PulumiAppModule<typeof CoreOutput>;
3
4
  export interface ICoreOutput {
4
5
  deploymentId: string;
@@ -8,7 +9,7 @@ export interface ICoreOutput {
8
9
  cognitoUserPoolArn: string;
9
10
  cognitoAppClientId: string;
10
11
  cognitoUserPoolId: string;
11
- cognitoUserPoolPasswordPolicy: string;
12
+ cognitoUserPoolPasswordPolicy: IApiStackOutputPasswordPolicy;
12
13
  fileManagerBucketId: string;
13
14
  fileManagerBucketArn: string;
14
15
  primaryDynamodbTableArn: string;
@@ -1,10 +1,10 @@
1
1
  import { createAppModule } from "@webiny/pulumi";
2
- import { ProjectSdk } from "@webiny/project";
2
+ import { getAwsProjectSdk } from "../../getAwsProjectSdk.js";
3
3
  const CoreOutput = createAppModule({
4
4
  name: "CoreOutput",
5
5
  config (app) {
6
6
  return app.addHandler(async ()=>{
7
- const sdk = await ProjectSdk.init();
7
+ const sdk = await getAwsProjectSdk();
8
8
  const output = await sdk.getAppStackOutput("core");
9
9
  if (!output) throw new Error("Core application is not deployed.");
10
10
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"pulumi/apps/common/CoreOutput.js","sources":["../../../../src/pulumi/apps/common/CoreOutput.ts"],"sourcesContent":["import { createAppModule, type PulumiAppModule } from \"@webiny/pulumi\";\nimport { ProjectSdk } from \"@webiny/project\";\n\nexport type CoreOutput = PulumiAppModule<typeof CoreOutput>;\n\nexport interface ICoreOutput {\n deploymentId: string;\n region: string;\n dynamoDbTable: string;\n iotAuthorizerName: string;\n cognitoUserPoolArn: string;\n cognitoAppClientId: string;\n cognitoUserPoolId: string;\n cognitoUserPoolPasswordPolicy: string;\n fileManagerBucketId: string;\n fileManagerBucketArn: string;\n primaryDynamodbTableArn: string;\n primaryDynamodbTableName: string;\n primaryDynamodbTableHashKey: string;\n primaryDynamodbTableRangeKey: string;\n auditLogsDynamodbTableArn: string;\n auditLogsDynamodbTableName: string;\n auditLogsDynamodbTableHashKey: string;\n auditLogsDynamodbTableRangeKey: string;\n eventBusName: string;\n eventBusArn: string;\n vpcPublicSubnetIds: string[] | undefined;\n vpcPrivateSubnetIds: string[] | undefined;\n vpcSecurityGroupIds: string[] | undefined;\n opensearchDomainArn: string | undefined;\n opensearchDomainEndpoint: string | undefined;\n opensearchDynamodbTableHashKey: string;\n opensearchDynamodbTableRangeKey: string;\n opensearchDynamodbTableArn: string | undefined;\n opensearchDynamodbTableName: string | undefined;\n}\n\nexport const CoreOutput = createAppModule({\n name: \"CoreOutput\",\n config(app) {\n return app.addHandler(async () => {\n const sdk = await ProjectSdk.init();\n\n const output = await sdk.getAppStackOutput(\"core\");\n if (!output) {\n throw new Error(\"Core application is not deployed.\");\n }\n\n return {\n fileManagerBucketId: output[\"fileManagerBucketId\"],\n primaryDynamodbTableArn: output[\"primaryDynamodbTableArn\"],\n primaryDynamodbTableName: output[\"primaryDynamodbTableName\"],\n primaryDynamodbTableHashKey: output[\"primaryDynamodbTableHashKey\"],\n primaryDynamodbTableRangeKey: output[\"primaryDynamodbTableRangeKey\"],\n auditLogsDynamodbTableArn: output[\"auditLogsDynamodbTableArn\"],\n auditLogsDynamodbTableName: output[\"auditLogsDynamodbTableName\"],\n auditLogsDynamodbTableHashKey: output[\"auditLogsDynamodbTableHashKey\"],\n auditLogsDynamodbTableRangeKey: output[\"auditLogsDynamodbTableRangeKey\"],\n cognitoUserPoolId: output[\"cognitoUserPoolId\"],\n cognitoUserPoolArn: output[\"cognitoUserPoolArn\"],\n cognitoUserPoolPasswordPolicy: output[\"cognitoUserPoolPasswordPolicy\"],\n cognitoAppClientId: output[\"cognitoAppClientId\"],\n eventBusName: output[\"eventBusName\"],\n eventBusArn: output[\"eventBusArn\"],\n // These outputs are optional, since VPC is not always enabled.\n vpcPublicSubnetIds: output[\"vpcPublicSubnetIds\"],\n vpcPrivateSubnetIds: output[\"vpcPrivateSubnetIds\"],\n vpcSecurityGroupIds: output[\"vpcSecurityGroupIds\"],\n // These outputs are optional, since Opensearch is not always enabled.\n opensearchDomainArn: output[\"opensearchDomainArn\"],\n opensearchDomainEndpoint: output[\"opensearchDomainEndpoint\"],\n opensearchDynamodbTableArn: output[\"opensearchDynamodbTableArn\"],\n opensearchDynamodbTableName: output[\"opensearchDynamodbTableName\"]\n } as ICoreOutput;\n });\n }\n});\n"],"names":["CoreOutput","createAppModule","app","sdk","ProjectSdk","output","Error"],"mappings":";;AAqCO,MAAMA,aAAaC,gBAAgB;IACtC,MAAM;IACN,QAAOC,GAAG;QACN,OAAOA,IAAI,UAAU,CAAC;YAClB,MAAMC,MAAM,MAAMC,WAAW,IAAI;YAEjC,MAAMC,SAAS,MAAMF,IAAI,iBAAiB,CAAC;YAC3C,IAAI,CAACE,QACD,MAAM,IAAIC,MAAM;YAGpB,OAAO;gBACH,qBAAqBD,MAAM,CAAC,sBAAsB;gBAClD,yBAAyBA,MAAM,CAAC,0BAA0B;gBAC1D,0BAA0BA,MAAM,CAAC,2BAA2B;gBAC5D,6BAA6BA,MAAM,CAAC,8BAA8B;gBAClE,8BAA8BA,MAAM,CAAC,+BAA+B;gBACpE,2BAA2BA,MAAM,CAAC,4BAA4B;gBAC9D,4BAA4BA,MAAM,CAAC,6BAA6B;gBAChE,+BAA+BA,MAAM,CAAC,gCAAgC;gBACtE,gCAAgCA,MAAM,CAAC,iCAAiC;gBACxE,mBAAmBA,MAAM,CAAC,oBAAoB;gBAC9C,oBAAoBA,MAAM,CAAC,qBAAqB;gBAChD,+BAA+BA,MAAM,CAAC,gCAAgC;gBACtE,oBAAoBA,MAAM,CAAC,qBAAqB;gBAChD,cAAcA,MAAM,CAAC,eAAe;gBACpC,aAAaA,MAAM,CAAC,cAAc;gBAElC,oBAAoBA,MAAM,CAAC,qBAAqB;gBAChD,qBAAqBA,MAAM,CAAC,sBAAsB;gBAClD,qBAAqBA,MAAM,CAAC,sBAAsB;gBAElD,qBAAqBA,MAAM,CAAC,sBAAsB;gBAClD,0BAA0BA,MAAM,CAAC,2BAA2B;gBAC5D,4BAA4BA,MAAM,CAAC,6BAA6B;gBAChE,6BAA6BA,MAAM,CAAC,8BAA8B;YACtE;QACJ;IACJ;AACJ"}
1
+ {"version":3,"file":"pulumi/apps/common/CoreOutput.js","sources":["../../../../src/pulumi/apps/common/CoreOutput.ts"],"sourcesContent":["import { createAppModule, type PulumiAppModule } from \"@webiny/pulumi\";\nimport { getAwsProjectSdk } from \"~/pulumi/getAwsProjectSdk.js\";\nimport type { IApiStackOutputPasswordPolicy } from \"~/abstractions/index.js\";\n\nexport type CoreOutput = PulumiAppModule<typeof CoreOutput>;\n\nexport interface ICoreOutput {\n deploymentId: string;\n region: string;\n dynamoDbTable: string;\n iotAuthorizerName: string;\n cognitoUserPoolArn: string;\n cognitoAppClientId: string;\n cognitoUserPoolId: string;\n cognitoUserPoolPasswordPolicy: IApiStackOutputPasswordPolicy;\n fileManagerBucketId: string;\n fileManagerBucketArn: string;\n primaryDynamodbTableArn: string;\n primaryDynamodbTableName: string;\n primaryDynamodbTableHashKey: string;\n primaryDynamodbTableRangeKey: string;\n auditLogsDynamodbTableArn: string;\n auditLogsDynamodbTableName: string;\n auditLogsDynamodbTableHashKey: string;\n auditLogsDynamodbTableRangeKey: string;\n eventBusName: string;\n eventBusArn: string;\n vpcPublicSubnetIds: string[] | undefined;\n vpcPrivateSubnetIds: string[] | undefined;\n vpcSecurityGroupIds: string[] | undefined;\n opensearchDomainArn: string | undefined;\n opensearchDomainEndpoint: string | undefined;\n opensearchDynamodbTableHashKey: string;\n opensearchDynamodbTableRangeKey: string;\n opensearchDynamodbTableArn: string | undefined;\n opensearchDynamodbTableName: string | undefined;\n}\n\nexport const CoreOutput = createAppModule({\n name: \"CoreOutput\",\n config(app) {\n return app.addHandler(async () => {\n const sdk = await getAwsProjectSdk();\n\n const output = await sdk.getAppStackOutput(\"core\");\n if (!output) {\n throw new Error(\"Core application is not deployed.\");\n }\n\n return {\n fileManagerBucketId: output[\"fileManagerBucketId\"],\n primaryDynamodbTableArn: output[\"primaryDynamodbTableArn\"],\n primaryDynamodbTableName: output[\"primaryDynamodbTableName\"],\n primaryDynamodbTableHashKey: output[\"primaryDynamodbTableHashKey\"],\n primaryDynamodbTableRangeKey: output[\"primaryDynamodbTableRangeKey\"],\n auditLogsDynamodbTableArn: output[\"auditLogsDynamodbTableArn\"],\n auditLogsDynamodbTableName: output[\"auditLogsDynamodbTableName\"],\n auditLogsDynamodbTableHashKey: output[\"auditLogsDynamodbTableHashKey\"],\n auditLogsDynamodbTableRangeKey: output[\"auditLogsDynamodbTableRangeKey\"],\n cognitoUserPoolId: output[\"cognitoUserPoolId\"],\n cognitoUserPoolArn: output[\"cognitoUserPoolArn\"],\n cognitoUserPoolPasswordPolicy: output[\"cognitoUserPoolPasswordPolicy\"],\n cognitoAppClientId: output[\"cognitoAppClientId\"],\n eventBusName: output[\"eventBusName\"],\n eventBusArn: output[\"eventBusArn\"],\n // These outputs are optional, since VPC is not always enabled.\n vpcPublicSubnetIds: output[\"vpcPublicSubnetIds\"],\n vpcPrivateSubnetIds: output[\"vpcPrivateSubnetIds\"],\n vpcSecurityGroupIds: output[\"vpcSecurityGroupIds\"],\n // These outputs are optional, since Opensearch is not always enabled.\n opensearchDomainArn: output[\"opensearchDomainArn\"],\n opensearchDomainEndpoint: output[\"opensearchDomainEndpoint\"],\n opensearchDynamodbTableArn: output[\"opensearchDynamodbTableArn\"],\n opensearchDynamodbTableName: output[\"opensearchDynamodbTableName\"]\n } as ICoreOutput;\n });\n }\n});\n"],"names":["CoreOutput","createAppModule","app","sdk","getAwsProjectSdk","output","Error"],"mappings":";;AAsCO,MAAMA,aAAaC,gBAAgB;IACtC,MAAM;IACN,QAAOC,GAAG;QACN,OAAOA,IAAI,UAAU,CAAC;YAClB,MAAMC,MAAM,MAAMC;YAElB,MAAMC,SAAS,MAAMF,IAAI,iBAAiB,CAAC;YAC3C,IAAI,CAACE,QACD,MAAM,IAAIC,MAAM;YAGpB,OAAO;gBACH,qBAAqBD,MAAM,CAAC,sBAAsB;gBAClD,yBAAyBA,MAAM,CAAC,0BAA0B;gBAC1D,0BAA0BA,MAAM,CAAC,2BAA2B;gBAC5D,6BAA6BA,MAAM,CAAC,8BAA8B;gBAClE,8BAA8BA,MAAM,CAAC,+BAA+B;gBACpE,2BAA2BA,MAAM,CAAC,4BAA4B;gBAC9D,4BAA4BA,MAAM,CAAC,6BAA6B;gBAChE,+BAA+BA,MAAM,CAAC,gCAAgC;gBACtE,gCAAgCA,MAAM,CAAC,iCAAiC;gBACxE,mBAAmBA,MAAM,CAAC,oBAAoB;gBAC9C,oBAAoBA,MAAM,CAAC,qBAAqB;gBAChD,+BAA+BA,MAAM,CAAC,gCAAgC;gBACtE,oBAAoBA,MAAM,CAAC,qBAAqB;gBAChD,cAAcA,MAAM,CAAC,eAAe;gBACpC,aAAaA,MAAM,CAAC,cAAc;gBAElC,oBAAoBA,MAAM,CAAC,qBAAqB;gBAChD,qBAAqBA,MAAM,CAAC,sBAAsB;gBAClD,qBAAqBA,MAAM,CAAC,sBAAsB;gBAElD,qBAAqBA,MAAM,CAAC,sBAAsB;gBAClD,0BAA0BA,MAAM,CAAC,2BAA2B;gBAC5D,4BAA4BA,MAAM,CAAC,6BAA6B;gBAChE,6BAA6BA,MAAM,CAAC,8BAA8B;YACtE;QACJ;IACJ;AACJ"}
@@ -2,4 +2,5 @@ import type { PulumiAppModule } from "@webiny/pulumi";
2
2
  export type CoreAuditLogsDynamo = PulumiAppModule<typeof CoreAuditLogsDynamo>;
3
3
  export declare const CoreAuditLogsDynamo: import("@webiny/pulumi").PulumiAppModuleDefinition<import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/dynamodb/table").Table>, {
4
4
  protect: boolean;
5
+ pointInTimeRecovery: boolean;
5
6
  }>;
@@ -236,6 +236,9 @@ const CoreAuditLogsDynamo = createAppModule({
236
236
  ttl: {
237
237
  attributeName: "expiresAt",
238
238
  enabled: true
239
+ },
240
+ pointInTimeRecovery: {
241
+ enabled: params.pointInTimeRecovery
239
242
  }
240
243
  },
241
244
  opts: {
@@ -1 +1 @@
1
- {"version":3,"file":"pulumi/apps/core/CoreAuditLogsDynamo.js","sources":["../../../../src/pulumi/apps/core/CoreAuditLogsDynamo.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport type { PulumiApp, PulumiAppModule } from \"@webiny/pulumi\";\nimport { createAppModule } from \"@webiny/pulumi\";\n\nexport type CoreAuditLogsDynamo = PulumiAppModule<typeof CoreAuditLogsDynamo>;\n\nexport const CoreAuditLogsDynamo = createAppModule({\n name: \"AuditLogsDynamoDb\",\n config(app: PulumiApp, params: { protect: boolean }) {\n return app.addResource(aws.dynamodb.Table, {\n name: \"webiny-audit-logs\",\n config: {\n attributes: [\n { name: \"PK\", type: \"S\" },\n { name: \"SK\", type: \"S\" },\n { name: \"GSI_TENANT\", type: \"S\" },\n { name: \"GSI1_PK\", type: \"S\" },\n { name: \"GSI1_SK\", type: \"N\" },\n { name: \"GSI2_PK\", type: \"S\" },\n { name: \"GSI2_SK\", type: \"N\" },\n { name: \"GSI3_PK\", type: \"S\" },\n { name: \"GSI3_SK\", type: \"N\" },\n { name: \"GSI4_PK\", type: \"S\" },\n { name: \"GSI4_SK\", type: \"N\" },\n { name: \"GSI5_PK\", type: \"S\" },\n { name: \"GSI5_SK\", type: \"N\" },\n { name: \"GSI6_PK\", type: \"S\" },\n { name: \"GSI6_SK\", type: \"N\" },\n { name: \"GSI7_PK\", type: \"S\" },\n { name: \"GSI7_SK\", type: \"N\" },\n { name: \"GSI8_PK\", type: \"S\" },\n { name: \"GSI8_SK\", type: \"N\" },\n { name: \"GSI9_PK\", type: \"S\" },\n { name: \"GSI9_SK\", type: \"N\" }\n ],\n billingMode: \"PAY_PER_REQUEST\",\n hashKey: \"PK\",\n rangeKey: \"SK\",\n globalSecondaryIndexes: [\n {\n name: \"GSI_TENANT\",\n keySchemas: [\n {\n attributeName: \"GSI_TENANT\",\n keyType: \"HASH\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI1\",\n keySchemas: [\n {\n attributeName: \"GSI1_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI1_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI2\",\n keySchemas: [\n {\n attributeName: \"GSI2_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI2_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI3\",\n keySchemas: [\n {\n attributeName: \"GSI3_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI3_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI4\",\n keySchemas: [\n {\n attributeName: \"GSI4_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI4_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI5\",\n keySchemas: [\n {\n attributeName: \"GSI5_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI5_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI6\",\n keySchemas: [\n {\n attributeName: \"GSI6_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI6_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI7\",\n keySchemas: [\n {\n attributeName: \"GSI7_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI7_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI8\",\n keySchemas: [\n {\n attributeName: \"GSI8_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI8_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI9\",\n keySchemas: [\n {\n attributeName: \"GSI9_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI9_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n }\n ],\n ttl: {\n attributeName: \"expiresAt\",\n enabled: true\n }\n },\n opts: {\n protect: params.protect\n }\n });\n }\n});\n"],"names":["CoreAuditLogsDynamo","createAppModule","app","params","aws"],"mappings":";;AAMO,MAAMA,sBAAsBC,gBAAgB;IAC/C,MAAM;IACN,QAAOC,GAAc,EAAEC,MAA4B;QAC/C,OAAOD,IAAI,WAAW,CAACE,uCAAAA,QAAAA,CAAAA,KAAkB,EAAE;YACvC,MAAM;YACN,QAAQ;gBACJ,YAAY;oBACR;wBAAE,MAAM;wBAAM,MAAM;oBAAI;oBACxB;wBAAE,MAAM;wBAAM,MAAM;oBAAI;oBACxB;wBAAE,MAAM;wBAAc,MAAM;oBAAI;oBAChC;wBAAE,MAAM;wBAAW,MAAM;oBAAI;oBAC7B;wBAAE,MAAM;wBAAW,MAAM;oBAAI;oBAC7B;wBAAE,MAAM;wBAAW,MAAM;oBAAI;oBAC7B;wBAAE,MAAM;wBAAW,MAAM;oBAAI;oBAC7B;wBAAE,MAAM;wBAAW,MAAM;oBAAI;oBAC7B;wBAAE,MAAM;wBAAW,MAAM;oBAAI;oBAC7B;wBAAE,MAA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CACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;oBACA;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;oBACA;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;oBACA;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;oBACA;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;iBACH;gBACD,KAAK;oBACD,eAAe;oBACf,SAAS;gBACb;YACJ;YACA,MAAM;gBACF,SAASD,OAAO,OAAO;YAC3B;QACJ;IACJ;AACJ"}
1
+ {"version":3,"file":"pulumi/apps/core/CoreAuditLogsDynamo.js","sources":["../../../../src/pulumi/apps/core/CoreAuditLogsDynamo.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport type { PulumiApp, PulumiAppModule } from \"@webiny/pulumi\";\nimport { createAppModule } from \"@webiny/pulumi\";\n\nexport type CoreAuditLogsDynamo = PulumiAppModule<typeof CoreAuditLogsDynamo>;\n\nexport const CoreAuditLogsDynamo = createAppModule({\n name: \"AuditLogsDynamoDb\",\n config(app: PulumiApp, params: { protect: boolean; pointInTimeRecovery: boolean }) {\n return app.addResource(aws.dynamodb.Table, {\n name: \"webiny-audit-logs\",\n config: {\n attributes: [\n { name: \"PK\", type: \"S\" },\n { name: \"SK\", type: \"S\" },\n { name: \"GSI_TENANT\", type: \"S\" },\n { name: \"GSI1_PK\", type: \"S\" },\n { name: \"GSI1_SK\", type: \"N\" },\n { name: \"GSI2_PK\", type: \"S\" },\n { name: \"GSI2_SK\", type: \"N\" },\n { name: \"GSI3_PK\", type: \"S\" },\n { name: \"GSI3_SK\", type: \"N\" },\n { name: \"GSI4_PK\", type: \"S\" },\n { name: \"GSI4_SK\", type: \"N\" },\n { name: \"GSI5_PK\", type: \"S\" },\n { name: \"GSI5_SK\", type: \"N\" },\n { name: \"GSI6_PK\", type: \"S\" },\n { name: \"GSI6_SK\", type: \"N\" },\n { name: \"GSI7_PK\", type: \"S\" },\n { name: \"GSI7_SK\", type: \"N\" },\n { name: \"GSI8_PK\", type: \"S\" },\n { name: \"GSI8_SK\", type: \"N\" },\n { name: \"GSI9_PK\", type: \"S\" },\n { name: \"GSI9_SK\", type: \"N\" }\n ],\n billingMode: \"PAY_PER_REQUEST\",\n hashKey: \"PK\",\n rangeKey: \"SK\",\n globalSecondaryIndexes: [\n {\n name: \"GSI_TENANT\",\n keySchemas: [\n {\n attributeName: \"GSI_TENANT\",\n keyType: \"HASH\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI1\",\n keySchemas: [\n {\n attributeName: \"GSI1_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI1_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI2\",\n keySchemas: [\n {\n attributeName: \"GSI2_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI2_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI3\",\n keySchemas: [\n {\n attributeName: \"GSI3_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI3_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI4\",\n keySchemas: [\n {\n attributeName: \"GSI4_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI4_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI5\",\n keySchemas: [\n {\n attributeName: \"GSI5_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI5_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI6\",\n keySchemas: [\n {\n attributeName: \"GSI6_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI6_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI7\",\n keySchemas: [\n {\n attributeName: \"GSI7_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI7_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI8\",\n keySchemas: [\n {\n attributeName: \"GSI8_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI8_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI9\",\n keySchemas: [\n {\n attributeName: \"GSI9_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI9_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n }\n ],\n ttl: {\n attributeName: \"expiresAt\",\n enabled: true\n },\n pointInTimeRecovery: {\n enabled: params.pointInTimeRecovery\n }\n },\n opts: {\n protect: params.protect\n }\n });\n }\n});\n"],"names":["CoreAuditLogsDynamo","createAppModule","app","params","aws"],"mappings":";;AAMO,MAAMA,sBAAsBC,gBAAgB;IAC/C,MAAM;IACN,QAAOC,GAAc,EAAEC,MAA0D;QAC7E,OAAOD,IAAI,WAAW,CAACE,uCAAAA,QAAAA,CAAAA,KAAkB,EAAE;YACvC,MAAM;YACN,QAAQ;gBACJ,YAAY;oBACR;wBAAE,MAAM;wBAAM,MAAM;oBAAI;oBACxB;wBAAE,MAAM;wBAAM,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ACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;oBACA;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;oBACA;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;oBACA;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;oBACA;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;oBACA;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;oBACA;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;iBACH;gBACD,KAAK;oBACD,eAAe;oBACf,SAAS;gBACb;gBACA,qBAAqB;oBACjB,SAASD,OAAO,mBAAmB;gBACvC;YACJ;YACA,MAAM;gBACF,SAASA,OAAO,OAAO;YAC3B;QACJ;IACJ;AACJ"}
@@ -2,4 +2,5 @@ import { type PulumiAppModule } from "@webiny/pulumi";
2
2
  export type CoreDynamo = PulumiAppModule<typeof CoreDynamo>;
3
3
  export declare const CoreDynamo: import("@webiny/pulumi").PulumiAppModuleDefinition<import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/dynamodb/table").Table>, {
4
4
  protect: boolean;
5
+ pointInTimeRecovery: boolean;
5
6
  }>;
@@ -82,6 +82,9 @@ const CoreDynamo = createAppModule({
82
82
  ttl: {
83
83
  attributeName: "expiresAt",
84
84
  enabled: true
85
+ },
86
+ pointInTimeRecovery: {
87
+ enabled: params.pointInTimeRecovery
85
88
  }
86
89
  },
87
90
  opts: {
@@ -1 +1 @@
1
- {"version":3,"file":"pulumi/apps/core/CoreDynamo.js","sources":["../../../../src/pulumi/apps/core/CoreDynamo.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { createAppModule, type PulumiApp, type PulumiAppModule } from \"@webiny/pulumi\";\n\nexport type CoreDynamo = PulumiAppModule<typeof CoreDynamo>;\n\nexport const CoreDynamo = createAppModule({\n name: \"DynamoDb\",\n config(app: PulumiApp, params: { protect: boolean }) {\n return app.addResource(aws.dynamodb.Table, {\n name: \"webiny\",\n config: {\n attributes: [\n { name: \"PK\", type: \"S\" },\n { name: \"SK\", type: \"S\" },\n { name: \"GSI_TENANT\", type: \"S\" },\n { name: \"GSI1_PK\", type: \"S\" },\n { name: \"GSI1_SK\", type: \"S\" },\n { name: \"GSI2_PK\", type: \"S\" },\n { name: \"GSI2_SK\", type: \"S\" }\n ],\n billingMode: \"PAY_PER_REQUEST\",\n hashKey: \"PK\",\n rangeKey: \"SK\",\n globalSecondaryIndexes: [\n {\n name: \"GSI_TENANT\",\n keySchemas: [\n {\n attributeName: \"GSI_TENANT\",\n keyType: \"HASH\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI1\",\n keySchemas: [\n {\n attributeName: \"GSI1_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI1_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"ALL\"\n },\n {\n name: \"GSI2\",\n keySchemas: [\n {\n attributeName: \"GSI2_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI2_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"ALL\"\n }\n ],\n ttl: {\n attributeName: \"expiresAt\",\n enabled: true\n }\n },\n opts: {\n protect: params.protect\n }\n });\n }\n});\n"],"names":["CoreDynamo","createAppModule","app","params","aws"],"mappings":";;AAKO,MAAMA,aAAaC,gBAAgB;IACtC,MAAM;IACN,QAAOC,GAAc,EAAEC,MAA4B;QAC/C,OAAOD,IAAI,WAAW,CAACE,uCAAAA,QAAAA,CAAAA,KAAkB,EAAE;YACvC,MAAM;YACN,QAAQ;gBACJ,YAAY;oBACR;wBAAE,MAAM;wBAAM,MAAM;oBAAI;oBACxB;wBAAE,MAAM;wBAAM,MAAM;oBAAI;oBACxB;wBAAE,MAAM;wBAAc,MAAM;oBAAI;oBAChC;wBAAE,MAAM;wBAAW,MAAM;oBAAI;oBAC7B;wBAAE,MAAM;wBAAW,MAAM;oBAAI;oBAC7B;wBAAE,MAAM;wBAAW,MAAM;oBAAI;oBAC7B;wBAAE,MAAM;wBAAW,MAAM;oBAAI;iBAChC;gBACD,aAAa;gBACb,SAAS;gBACT,UAAU;gBACV,wBAAwB;oBACpB;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;oBACA;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;oBACA;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;iBACH;gBACD,KAAK;oBACD,eAAe;oBACf,SAAS;gBACb;YACJ;YACA,MAAM;gBACF,SAASD,OAAO,OAAO;YAC3B;QACJ;IACJ;AACJ"}
1
+ {"version":3,"file":"pulumi/apps/core/CoreDynamo.js","sources":["../../../../src/pulumi/apps/core/CoreDynamo.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { createAppModule, type PulumiApp, type PulumiAppModule } from \"@webiny/pulumi\";\n\nexport type CoreDynamo = PulumiAppModule<typeof CoreDynamo>;\n\nexport const CoreDynamo = createAppModule({\n name: \"DynamoDb\",\n config(app: PulumiApp, params: { protect: boolean; pointInTimeRecovery: boolean }) {\n return app.addResource(aws.dynamodb.Table, {\n name: \"webiny\",\n config: {\n attributes: [\n { name: \"PK\", type: \"S\" },\n { name: \"SK\", type: \"S\" },\n { name: \"GSI_TENANT\", type: \"S\" },\n { name: \"GSI1_PK\", type: \"S\" },\n { name: \"GSI1_SK\", type: \"S\" },\n { name: \"GSI2_PK\", type: \"S\" },\n { name: \"GSI2_SK\", type: \"S\" }\n ],\n billingMode: \"PAY_PER_REQUEST\",\n hashKey: \"PK\",\n rangeKey: \"SK\",\n globalSecondaryIndexes: [\n {\n name: \"GSI_TENANT\",\n keySchemas: [\n {\n attributeName: \"GSI_TENANT\",\n keyType: \"HASH\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n },\n {\n name: \"GSI1\",\n keySchemas: [\n {\n attributeName: \"GSI1_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI1_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"ALL\"\n },\n {\n name: \"GSI2\",\n keySchemas: [\n {\n attributeName: \"GSI2_PK\",\n keyType: \"HASH\"\n },\n {\n attributeName: \"GSI2_SK\",\n keyType: \"RANGE\"\n }\n ],\n projectionType: \"ALL\"\n }\n ],\n ttl: {\n attributeName: \"expiresAt\",\n enabled: true\n },\n pointInTimeRecovery: {\n enabled: params.pointInTimeRecovery\n }\n },\n opts: {\n protect: params.protect\n }\n });\n }\n});\n"],"names":["CoreDynamo","createAppModule","app","params","aws"],"mappings":";;AAKO,MAAMA,aAAaC,gBAAgB;IACtC,MAAM;IACN,QAAOC,GAAc,EAAEC,MAA0D;QAC7E,OAAOD,IAAI,WAAW,CAACE,uCAAAA,QAAAA,CAAAA,KAAkB,EAAE;YACvC,MAAM;YACN,QAAQ;gBACJ,YAAY;oBACR;wBAAE,MAAM;wBAAM,MAAM;oBAAI;oBACxB;wBAAE,MAAM;wBAAM,MAAM;oBAAI;oBACxB;wBAAE,MAAM;wBAAc,MAAM;oBAAI;oBAChC;wBAAE,MAAM;wBAAW,MAAM;oBAAI;oBAC7B;wBAAE,MAAM;wBAAW,MAAM;oBAAI;oBAC7B;wBAAE,MAAM;wBAAW,MAAM;oBAAI;oBAC7B;wBAAE,MAAM;wBAAW,MAAM;oBAAI;iBAChC;gBACD,aAAa;gBACb,SAAS;gBACT,UAAU;gBACV,wBAAwB;oBACpB;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;oBACA;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;oBACA;wBACI,MAAM;wBACN,YAAY;4BACR;gCACI,eAAe;gCACf,SAAS;4BACb;4BACA;gCACI,eAAe;gCACf,SAAS;4BACb;yBACH;wBACD,gBAAgB;oBACpB;iBACH;gBACD,KAAK;oBACD,eAAe;oBACf,SAAS;gBACb;gBACA,qBAAqB;oBACjB,SAASD,OAAO,mBAAmB;gBACvC;YACJ;YACA,MAAM;gBACF,SAASA,OAAO,OAAO;YAC3B;QACJ;IACJ;AACJ"}
@@ -6,6 +6,8 @@ export declare const CoreFileManger: import("@webiny/pulumi").PulumiAppModuleDef
6
6
  bucketAcl: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/s3/bucketAcl").BucketAcl>;
7
7
  blockPublicAccessBlock: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/s3/bucketPublicAccessBlock").BucketPublicAccessBlock>;
8
8
  bucketCorsConfiguration: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/s3/bucketCorsConfiguration").BucketCorsConfiguration>;
9
+ bucketVersioning: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/s3/bucketVersioning").BucketVersioning> | null;
9
10
  }, {
10
11
  protect: boolean;
12
+ versioning: boolean;
11
13
  }>;
@@ -66,12 +66,22 @@ const CoreFileManger = createAppModule({
66
66
  restrictPublicBuckets: true
67
67
  }
68
68
  });
69
+ const bucketVersioning = params.versioning ? app.addResource(__rspack_external__pulumi_aws_9e2bee2d.s3.BucketVersioning, {
70
+ name: `${name}-versioning`,
71
+ config: {
72
+ bucket: bucket.output.id,
73
+ versioningConfiguration: {
74
+ status: "Enabled"
75
+ }
76
+ }
77
+ }) : null;
69
78
  return {
70
79
  bucket,
71
80
  bucketOwnershipControls,
72
81
  bucketAcl,
73
82
  blockPublicAccessBlock,
74
- bucketCorsConfiguration
83
+ bucketCorsConfiguration,
84
+ bucketVersioning
75
85
  };
76
86
  }
77
87
  });
@@ -1 +1 @@
1
- {"version":3,"file":"pulumi/apps/core/CoreFileManager.js","sources":["../../../../src/pulumi/apps/core/CoreFileManager.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { createAppModule, type PulumiApp, type PulumiAppModule } from \"@webiny/pulumi\";\n\nexport type CoreFileManger = PulumiAppModule<typeof CoreFileManger>;\n\nexport const CoreFileManger = createAppModule({\n name: \"FileManagerBucket\",\n config(app: PulumiApp, params: { protect: boolean }) {\n const name = \"fm-bucket\";\n\n const bucket = app.addResource(aws.s3.Bucket, {\n name,\n config: {\n // We definitely don't want to force-destroy if \"protected\" flag is true.\n forceDestroy: !params.protect\n },\n opts: {\n protect: params.protect\n }\n });\n\n const bucketOwnershipControls = app.addResource(aws.s3.BucketOwnershipControls, {\n name: `${name}-ownership-controls`,\n config: {\n bucket: bucket.output.id,\n rule: {\n objectOwnership: \"BucketOwnerPreferred\"\n }\n }\n });\n\n const bucketAcl = app.addResource(aws.s3.BucketAcl, {\n name: `${name}-acl`,\n config: {\n bucket: bucket.output.id,\n acl: aws.s3.CannedAcl.Private\n },\n opts: {\n dependsOn: [bucketOwnershipControls.output]\n }\n });\n\n // We need these rules to be able to upload to this bucket from the browser.\n const bucketCorsConfiguration = app.addResource(aws.s3.BucketCorsConfiguration, {\n name: `${name}-cors`,\n config: {\n bucket: bucket.output.id,\n corsRules: [\n {\n allowedHeaders: [\"*\"],\n allowedMethods: [\"POST\", \"GET\", \"PUT\"],\n allowedOrigins: [\"*\"],\n maxAgeSeconds: 3000\n }\n ]\n }\n });\n\n // Block any public access\n const blockPublicAccessBlock = app.addResource(aws.s3.BucketPublicAccessBlock, {\n name: `${name}-block-public-access`,\n config: {\n bucket: bucket.output.id,\n blockPublicAcls: true,\n blockPublicPolicy: true,\n ignorePublicAcls: true,\n restrictPublicBuckets: true\n }\n });\n\n return {\n bucket,\n bucketOwnershipControls,\n bucketAcl,\n blockPublicAccessBlock,\n bucketCorsConfiguration\n };\n }\n});\n"],"names":["CoreFileManger","createAppModule","app","params","name","bucket","aws","bucketOwnershipControls","bucketAcl","bucketCorsConfiguration","blockPublicAccessBlock"],"mappings":";;AAKO,MAAMA,iBAAiBC,gBAAgB;IAC1C,MAAM;IACN,QAAOC,GAAc,EAAEC,MAA4B;QAC/C,MAAMC,OAAO;QAEb,MAAMC,SAASH,IAAI,WAAW,CAACI,uCAAAA,EAAAA,CAAAA,MAAa,EAAE;YAC1CF;YACA,QAAQ;gBAEJ,cAAc,CAACD,OAAO,OAAO;YACjC;YACA,MAAM;gBACF,SAASA,OAAO,OAAO;YAC3B;QACJ;QAEA,MAAMI,0BAA0BL,IAAI,WAAW,CAACI,uCAAAA,EAAAA,CAAAA,uBAA8B,EAAE;YAC5E,MAAM,GAAGF,KAAK,mBAAmB,CAAC;YAClC,QAAQ;gBACJ,QAAQC,OAAO,MAAM,CAAC,EAAE;gBACxB,MAAM;oBACF,iBAAiB;gBACrB;YACJ;QACJ;QAEA,MAAMG,YAAYN,IAAI,WAAW,CAACI,uCAAAA,EAAAA,CAAAA,SAAgB,EAAE;YAChD,MAAM,GAAGF,KAAK,IAAI,CAAC;YACnB,QAAQ;gBACJ,QAAQC,OAAO,MAAM,CAAC,EAAE;gBACxB,KAAKC,uCAAAA,EAAAA,CAAAA,SAAAA,CAAAA,OAAwB;YACjC;YACA,MAAM;gBACF,WAAW;oBAACC,wBAAwB,MAAM;iBAAC;YAC/C;QACJ;QAGA,MAAME,0BAA0BP,IAAI,WAAW,CAACI,uCAAAA,EAAAA,CAAAA,uBAA8B,EAAE;YAC5E,MAAM,GAAGF,KAAK,KAAK,CAAC;YACpB,QAAQ;gBACJ,QAAQC,OAAO,MAAM,CAAC,EAAE;gBACxB,WAAW;oBACP;wBACI,gBAAgB;4BAAC;yBAAI;wBACrB,gBAAgB;4BAAC;4BAAQ;4BAAO;yBAAM;wBACtC,gBAAgB;4BAAC;yBAAI;wBACrB,eAAe;oBACnB;iBACH;YACL;QACJ;QAGA,MAAMK,yBAAyBR,IAAI,WAAW,CAACI,uCAAAA,EAAAA,CAAAA,uBAA8B,EAAE;YAC3E,MAAM,GAAGF,KAAK,oBAAoB,CAAC;YACnC,QAAQ;gBACJ,QAAQC,OAAO,MAAM,CAAC,EAAE;gBACxB,iBAAiB;gBACjB,mBAAmB;gBACnB,kBAAkB;gBAClB,uBAAuB;YAC3B;QACJ;QAEA,OAAO;YACHA;YACAE;YACAC;YACAE;YACAD;QACJ;IACJ;AACJ"}
1
+ {"version":3,"file":"pulumi/apps/core/CoreFileManager.js","sources":["../../../../src/pulumi/apps/core/CoreFileManager.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { createAppModule, type PulumiApp, type PulumiAppModule } from \"@webiny/pulumi\";\n\nexport type CoreFileManger = PulumiAppModule<typeof CoreFileManger>;\n\nexport const CoreFileManger = createAppModule({\n name: \"FileManagerBucket\",\n config(app: PulumiApp, params: { protect: boolean; versioning: boolean }) {\n const name = \"fm-bucket\";\n\n const bucket = app.addResource(aws.s3.Bucket, {\n name,\n config: {\n // We definitely don't want to force-destroy if \"protected\" flag is true.\n forceDestroy: !params.protect\n },\n opts: {\n protect: params.protect\n }\n });\n\n const bucketOwnershipControls = app.addResource(aws.s3.BucketOwnershipControls, {\n name: `${name}-ownership-controls`,\n config: {\n bucket: bucket.output.id,\n rule: {\n objectOwnership: \"BucketOwnerPreferred\"\n }\n }\n });\n\n const bucketAcl = app.addResource(aws.s3.BucketAcl, {\n name: `${name}-acl`,\n config: {\n bucket: bucket.output.id,\n acl: aws.s3.CannedAcl.Private\n },\n opts: {\n dependsOn: [bucketOwnershipControls.output]\n }\n });\n\n // We need these rules to be able to upload to this bucket from the browser.\n const bucketCorsConfiguration = app.addResource(aws.s3.BucketCorsConfiguration, {\n name: `${name}-cors`,\n config: {\n bucket: bucket.output.id,\n corsRules: [\n {\n allowedHeaders: [\"*\"],\n allowedMethods: [\"POST\", \"GET\", \"PUT\"],\n allowedOrigins: [\"*\"],\n maxAgeSeconds: 3000\n }\n ]\n }\n });\n\n // Block any public access\n const blockPublicAccessBlock = app.addResource(aws.s3.BucketPublicAccessBlock, {\n name: `${name}-block-public-access`,\n config: {\n bucket: bucket.output.id,\n blockPublicAcls: true,\n blockPublicPolicy: true,\n ignorePublicAcls: true,\n restrictPublicBuckets: true\n }\n });\n\n // Keeps previous versions of overwritten and deleted files, so they can be restored.\n const bucketVersioning = params.versioning\n ? app.addResource(aws.s3.BucketVersioning, {\n name: `${name}-versioning`,\n config: {\n bucket: bucket.output.id,\n versioningConfiguration: {\n status: \"Enabled\"\n }\n }\n })\n : null;\n\n return {\n bucket,\n bucketOwnershipControls,\n bucketAcl,\n blockPublicAccessBlock,\n bucketCorsConfiguration,\n bucketVersioning\n };\n }\n});\n"],"names":["CoreFileManger","createAppModule","app","params","name","bucket","aws","bucketOwnershipControls","bucketAcl","bucketCorsConfiguration","blockPublicAccessBlock","bucketVersioning"],"mappings":";;AAKO,MAAMA,iBAAiBC,gBAAgB;IAC1C,MAAM;IACN,QA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E;gBACxB,iBAAiB;gBACjB,mBAAmB;gBACnB,kBAAkB;gBAClB,uBAAuB;YAC3B;QACJ;QAGA,MAAMM,mBAAmBR,OAAO,UAAU,GACpCD,IAAI,WAAW,CAACI,uCAAAA,EAAAA,CAAAA,gBAAuB,EAAE;YACrC,MAAM,GAAGF,KAAK,WAAW,CAAC;YAC1B,QAAQ;gBACJ,QAAQC,OAAO,MAAM,CAAC,EAAE;gBACxB,yBAAyB;oBACrB,QAAQ;gBACZ;YACJ;QACJ,KACA;QAEN,OAAO;YACHA;YACAE;YACAC;YACAE;YACAD;YACAE;QACJ;IACJ;AACJ"}
@@ -4,6 +4,7 @@ export interface OpenSearchParams {
4
4
  protect: boolean;
5
5
  namePrefix: string;
6
6
  prevDomainName: string | undefined;
7
+ pointInTimeRecovery: boolean;
7
8
  }
8
9
  export declare const OpenSearch: import("@webiny/pulumi").PulumiAppModuleDefinition<{
9
10
  domain: PulumiAppRemoteResource<aws.opensearch.GetDomainResult> | PulumiAppResource<PulumiAppResourceConstructor<import("@pulumi/aws/opensearch/domain.js").Domain, any>>;
@@ -144,6 +144,9 @@ const OpenSearch = createAppModule({
144
144
  ttl: {
145
145
  attributeName: "expiresAt",
146
146
  enabled: true
147
+ },
148
+ pointInTimeRecovery: {
149
+ enabled: params.pointInTimeRecovery
147
150
  }
148
151
  },
149
152
  opts: {
@@ -1 +1 @@
1
- {"version":3,"file":"pulumi/apps/core/CoreOpenSearch.js","sources":["../../../../src/pulumi/apps/core/CoreOpenSearch.ts"],"sourcesContent":["/**\n * Important documents to read:\n *\n * https://docs.aws.amazon.com/opensearch-service/latest/developerguide/limits.html#network-limits\n */\nimport path from \"path\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\nimport {\n createAppModule,\n type PulumiApp,\n type PulumiAppRemoteResource,\n type PulumiAppResource,\n type PulumiAppResourceConstructor\n} from \"@webiny/pulumi\";\n\nimport { getAwsAccountId } from \"../awsUtils.js\";\nimport { CoreVpc } from \"./CoreVpc.js\";\nimport { LAMBDA_RUNTIME } from \"~/pulumi/constants.js\";\n\nexport interface OpenSearchParams {\n protect: boolean;\n namePrefix: string;\n prevDomainName: string | undefined;\n}\n\nfunction getDevClusterConfig(): aws.types.input.opensearch.DomainClusterConfig {\n return {\n instanceType: \"t3.small.search\"\n };\n}\n\nfunction getProdClusterConfig(): aws.types.input.opensearch.DomainClusterConfig {\n return {\n // For production deployments, we create 3 instances and configure multi-AZ across 3 zones.\n instanceType: \"t3.medium.search\",\n instanceCount: 3,\n zoneAwarenessEnabled: true,\n zoneAwarenessConfig: {\n availabilityZoneCount: 3\n }\n };\n}\n\nconst OS_ENGINE_VERSION = \"OpenSearch_3.3\";\n\nexport const OpenSearch = createAppModule({\n name: \"OpenSearch\",\n config(app, params: OpenSearchParams) {\n const isProduction = app.env.isProduction;\n\n const vpc = app.getModule(CoreVpc, { optional: true });\n\n let domain:\n | PulumiAppResource<PulumiAppResourceConstructor<aws.opensearch.Domain>>\n | PulumiAppRemoteResource<aws.opensearch.GetDomainResult>\n | null = null;\n\n let domainPolicy;\n let domainEndpoint: pulumi.Output<string> | string;\n let domainArn: pulumi.Output<string>;\n\n const providedEndpoint = process.env.OPENSEARCH_ENDPOINT;\n const providedDomainName = process.env.AWS_OS_DOMAIN_NAME;\n\n if (providedEndpoint && !providedDomainName) {\n throw new Error(\n \"OPENSEARCH_ENDPOINT was provided but AWS_OS_DOMAIN_NAME is missing. \" +\n \"A domain name is required to look up the domain ARN when using a custom endpoint.\"\n );\n }\n\n if (providedDomainName) {\n // Look up the existing domain by name to obtain its ARN and (if no explicit endpoint is\n // provided) its endpoint. This covers both the ephemeral-environment pattern and the\n // case where an external endpoint is supplied alongside a domain name.\n // https://www.webiny.com/docs/key-topics/ci-cd/testing/slow-ephemeral-environments\n domain = app.addRemoteResource(providedDomainName, () => {\n return aws.opensearch.getDomain(\n { domainName: providedDomainName },\n { async: true }\n );\n });\n domainArn = domain.output.arn;\n // Prefer an explicitly provided endpoint; fall back to the one reported by AWS.\n domainEndpoint = providedEndpoint ?? domain.output.endpoint;\n } else {\n const randomId = new random.RandomId(\"osDomainRandomId\", { byteLength: 8 });\n\n const domainLogicalName = \"webiny-js\";\n\n /**\n * The physical domain name must remain stable across re-deploys. Changing it causes\n * Pulumi to delete and recreate the cluster, which is a destructive operation.\n *\n * To avoid this, we read the domain name that was stored in the previous deploy's\n * stack output (via `sdk.getAppStackOutput`) and reuse it unchanged. Only on the\n * very first deploy, when there is no previous output, do we generate a new name\n * (with the resource name prefix applied for consistent naming going forward).\n *\n * NOTE: `params.namePrefix` may be \"\" when upgrading from old code that never stored\n * the domain name in the stack output. In that case the caller passes \"\" explicitly so\n * the fallback formula reproduces the legacy name (`webiny-js-<hex>`) rather than\n * prepending the SDK default prefix and triggering an unintended cluster replacement.\n * See `createCorePulumiApp.ts` → `isUpgradeFromOldCode` for details.\n */\n const domainPhysicalName = randomId.hex.apply(\n hex =>\n params.prevDomainName ??\n `${params.namePrefix}${domainLogicalName}-${hex.slice(-7)}`\n );\n\n domain = app.addResource(aws.opensearch.Domain, {\n name: domainLogicalName,\n config: {\n domainName: domainPhysicalName,\n engineVersion: OS_ENGINE_VERSION,\n clusterConfig: isProduction ? getProdClusterConfig() : getDevClusterConfig(),\n vpcOptions: vpc\n ? {\n subnetIds: vpc.subnets.private.map(s => s.output.id),\n securityGroupIds: [vpc.vpc.output.defaultSecurityGroupId]\n }\n : undefined,\n ebsOptions: {\n ebsEnabled: true,\n volumeSize: 10,\n volumeType: \"gp2\"\n },\n advancedOptions: {\n \"rest.action.multi.allow_explicit_index\": \"true\"\n },\n snapshotOptions: {\n automatedSnapshotStartHour: 23\n }\n },\n opts: { protect: params.protect }\n });\n\n domainEndpoint = domain.output.endpoint;\n domainArn = domain.output.arn;\n\n /**\n * Domain policy defines who can access your OpenSearch Domain.\n * For details on OpenSearch security, read the official documentation:\n * https://docs.aws.amazon.com/openSearch-service/latest/developerguide/security.html\n */\n const accountId = getAwsAccountId(app);\n\n domainPolicy = app.addResource(aws.opensearch.DomainPolicy, {\n name: `${domainLogicalName}-policy`,\n config: {\n domainName: domain.output.domainName,\n accessPolicies: pulumi\n .all([accountId, domainArn])\n .apply(([accountId, domainArn]) => {\n return JSON.stringify({\n Version: \"2012-10-17\",\n Statement: [\n /**\n * Allow requests signed with current account\n */\n {\n Effect: \"Allow\",\n Principal: {\n AWS: accountId\n },\n Action: \"es:*\",\n Resource: `${domainArn}/*`\n }\n ]\n });\n })\n },\n opts: { protect: params.protect }\n });\n }\n\n /**\n * Create a table for OpenSearch records. All ES records are stored in this table to dramatically improve\n * performance and stability on write operations (especially massive data imports). This table also serves as a backup and\n * a single source of truth for your OpenSearch domain. Streaming is enabled on this table, and it will\n * allow asynchronous synchronization of data with OpenSearch domain.\n */\n const table = app.addResource(aws.dynamodb.Table, {\n name: \"webiny-es\",\n config: {\n attributes: [\n { name: \"PK\", type: \"S\" },\n { name: \"SK\", type: \"S\" },\n { name: \"GSI_TENANT\", type: \"S\" }\n ],\n streamEnabled: true,\n streamViewType: \"NEW_AND_OLD_IMAGES\",\n billingMode: \"PAY_PER_REQUEST\",\n hashKey: \"PK\",\n rangeKey: \"SK\",\n globalSecondaryIndexes: [\n {\n name: \"GSI_TENANT\",\n keySchemas: [\n {\n attributeName: \"GSI_TENANT\",\n keyType: \"HASH\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n }\n ],\n ttl: {\n attributeName: \"expiresAt\",\n enabled: true\n }\n },\n opts: { protect: params.protect }\n });\n\n const roleName = \"dynamo-to-elastic-lambda-role\";\n\n const role = app.addResource(aws.iam.Role, {\n name: roleName,\n config: {\n assumeRolePolicy: {\n Version: \"2012-10-17\",\n Statement: [\n {\n Action: \"sts:AssumeRole\",\n Principal: {\n Service: \"lambda.amazonaws.com\"\n },\n Effect: \"Allow\"\n }\n ]\n }\n },\n meta: { isLambdaFunctionRole: true }\n });\n\n const policy = getDynamoDbToElasticLambdaPolicy(app, domainArn);\n\n app.addResource(aws.iam.RolePolicyAttachment, {\n name: `${roleName}-DynamoDbToElasticLambdaPolicy`,\n config: {\n role: role.output,\n policyArn: policy.output.arn\n }\n });\n\n // Only use `AWSLambdaVPCAccessExecutionRole` policy if VPC feature is enabled.\n if (vpc) {\n app.addResource(aws.iam.RolePolicyAttachment, {\n name: `${roleName}-AWSLambdaVPCAccessExecutionRole`,\n config: {\n role: role.output,\n policyArn: aws.iam.ManagedPolicy.AWSLambdaVPCAccessExecutionRole\n }\n });\n } else {\n app.addResource(aws.iam.RolePolicyAttachment, {\n name: `${roleName}-AWSLambdaBasicExecutionRole`,\n config: {\n role: role.output,\n policyArn: aws.iam.ManagedPolicy.AWSLambdaBasicExecutionRole\n }\n });\n }\n\n app.addResource(aws.iam.RolePolicyAttachment, {\n name: `${roleName}-AWSLambdaDynamoDBExecutionRole`,\n config: {\n role: role.output,\n policyArn: aws.iam.ManagedPolicy.AWSLambdaDynamoDBExecutionRole\n }\n });\n\n /**\n * This Lambda will process the stream events from DynamoDB table that contains OpenSearch items.\n * OpenSearch can't take large amount of individual writes in a short period of time, so this way\n * we store data for OpenSearch in a DynamoDB table, and asynchronously insert it into OpenSearch\n * using batching.\n */\n const lambda = app.addResource(aws.lambda.Function, {\n name: \"dynamo-to-elastic\",\n config: {\n role: role.output.arn,\n runtime: LAMBDA_RUNTIME,\n handler: \"handler.handler\",\n timeout: 900,\n memorySize: 1024,\n environment: {\n variables: {\n DEBUG: String(process.env.DEBUG),\n OPENSEARCH_ENDPOINT: domainEndpoint,\n OPENSEARCH_USERNAME: process.env.OPENSEARCH_USERNAME ?? \"\",\n OPENSEARCH_PASSWORD: process.env.OPENSEARCH_PASSWORD ?? \"\"\n }\n },\n description: \"Process DynamoDB Stream.\",\n code: new pulumi.asset.AssetArchive({\n \".\": new pulumi.asset.FileArchive(\n path.join(app.paths.workspace, \"dynamoToElastic/build\")\n )\n }),\n vpcConfig: vpc\n ? {\n subnetIds: vpc.subnets.private.map(s => s.output.id),\n securityGroupIds: [vpc.vpc.output.defaultSecurityGroupId]\n }\n : undefined,\n loggingConfig: {\n logFormat: \"JSON\"\n }\n }\n });\n\n const eventSourceMapping = app.addResource(aws.lambda.EventSourceMapping, {\n name: \"dynamo-to-elastic\",\n config: {\n eventSourceArn: table.output.streamArn,\n functionName: lambda.output.arn,\n startingPosition: \"LATEST\",\n maximumRetryAttempts: 3,\n batchSize: 50,\n maximumBatchingWindowInSeconds: 1\n }\n });\n\n app.addOutputs({\n opensearchDomainArn: domainArn,\n opensearchDomainEndpoint: domainEndpoint,\n opensearchDomainName: domain!.output.domainName,\n opensearchDynamodbTableArn: table.output.arn,\n opensearchDynamodbTableName: table.output.name\n });\n\n return {\n domain,\n domainPolicy,\n table,\n dynamoToElastic: {\n role,\n policy,\n lambda,\n eventSourceMapping\n }\n };\n }\n});\n\nfunction getDynamoDbToElasticLambdaPolicy(app: PulumiApp, domainArn: pulumi.Output<string>) {\n return app.addResource(aws.iam.Policy, {\n name: \"DynamoDbToElasticLambdaPolicy-updated\",\n config: {\n description: \"This policy enables access to ES and Dynamodb streams\",\n policy: {\n Version: \"2012-10-17\",\n Statement: [\n {\n Sid: \"PermissionForES\",\n Effect: \"Allow\",\n Action: [\n \"es:ESHttpGet\",\n \"es:ESHttpDelete\",\n \"es:ESHttpPatch\",\n \"es:ESHttpPost\",\n \"es:ESHttpPut\",\n \"dynamodb:BatchGetItem\",\n \"dynamodb:BatchWriteItem\",\n \"dynamodb:PutItem\",\n \"dynamodb:GetItem\",\n \"dynamodb:DeleteItem\",\n \"dynamodb:Query\",\n \"dynamodb:UpdateItem\"\n ],\n Resource: [\n pulumi.interpolate`${domainArn}`,\n pulumi.interpolate`${domainArn}/*`\n ]\n }\n ]\n }\n }\n });\n}\n"],"names":["getDevClusterConfig","getProdClusterConfig","OS_ENGINE_VERSION","OpenSearch","createAppModule","app","params","isProduction","vpc","CoreVpc","domain","domainPolicy","domainEndpoint","domainArn","providedEndpoint","process","providedDomainName","Error","aws","randomId","random","domainLogicalName","domainPhysicalName","hex","s","undefined","accountId","getAwsAccountId","pulumi","JSON","table","roleName","role","policy","getDynamoDbToElasticLambdaPolicy","lambda","LAMBDA_RUNTIME","String","path","eventSourceMapping"],"mappings":";;;;;;;;AA2BA,SAASA;IACL,OAAO;QACH,cAAc;IAClB;AACJ;AAEA,SAASC;IACL,OAAO;QAEH,cAAc;QACd,eAAe;QACf,sBAAsB;QACtB,qBAAqB;YACjB,uBAAuB;QAC3B;IACJ;AACJ;AAEA,MAAMC,oBAAoB;AAEnB,MAAMC,aAAaC,gBAAgB;IACtC,MAAM;IACN,QAAOC,GAAG,EAAEC,MAAwB;QAChC,MAAMC,eAAeF,IAAI,GAAG,CAAC,YAAY;QAEzC,MAAMG,MAAMH,IAAI,SAAS,CAACI,SAAS;YAAE,UAAU;QAAK;QAEpD,IAAIC,SAGS;QAEb,IAAIC;QACJ,IAAIC;QACJ,IAAIC;QAEJ,MAAMC,mBAAmBC,QAAQ,GAAG,CAAC,mBAAmB;QACxD,MAAMC,qBAAqBD,QAAQ,GAAG,CAAC,kBAAkB;QAEzD,IAAID,oBAAoB,CAACE,oBACrB,MAAM,IAAIC,MACN;QAKR,IAAID,oBAAoB;YAKpBN,SAASL,IAAI,iBAAiB,CAACW,oBAAoB,IACxCE,uCAAAA,UAAAA,CAAAA,SAAwB,CAC3B;oBAAE,YAAYF;gBAAmB,GACjC;oBAAE,OAAO;gBAAK;YAGtBH,YAAYH,OAAO,MAAM,CAAC,GAAG;YAE7BE,iBAAiBE,oBAAoBJ,OAAO,MAAM,CAAC,QAAQ;QAC/D,OAAO;YACH,MAAMS,WAAW,IAAIC,0CAAAA,QAAe,CAAC,oBAAoB;gBAAE,YAAY;YAAE;YAEzE,MAAMC,oBAAoB;YAiB1B,MAAMC,qBAAqBH,SAAS,GAAG,CAAC,KAAK,CACzCI,CAAAA,MACIjB,OAAO,cAAc,IACrB,GAAGA,OAAO,UAAU,GAAGe,kBAAkB,CAA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X,WAAW;gBACf;YACJ;QACJ;QAEA,MAAMc,qBAAqBlC,IAAI,WAAW,CAACa,uCAAAA,MAAAA,CAAAA,kBAA6B,EAAE;YACtE,MAAM;YACN,QAAQ;gBACJ,gBAAgBY,MAAM,MAAM,CAAC,SAAS;gBACtC,cAAcK,OAAO,MAAM,CAAC,GAAG;gBAC/B,kBAAkB;gBAClB,sBAAsB;gBACtB,WAAW;gBACX,gCAAgC;YACpC;QACJ;QAEA9B,IAAI,UAAU,CAAC;YACX,qBAAqBQ;YACrB,0BAA0BD;YAC1B,sBAAsBF,OAAQ,MAAM,CAAC,UAAU;YAC/C,4BAA4BoB,MAAM,MAAM,CAAC,GAAG;YAC5C,6BAA6BA,MAAM,MAAM,CAAC,IAAI;QAClD;QAEA,OAAO;YACHpB;YACAC;YACAmB;YACA,iBAAiB;gBACbE;gBACAC;gBACAE;gBACAI;YACJ;QACJ;IACJ;AACJ;AAEA,SAASL,iCAAiC7B,GAAc,EAAEQ,SAAgC;IACtF,OAAOR,IAAI,WAAW,CAACa,uCAAAA,GAAAA,CAAAA,MAAc,EAAE;QACnC,MAAM;QACN,QAAQ;YACJ,aAAa;YACb,QAAQ;gBACJ,SAAS;gBACT,WAAW;oBACP;wBACI,KAAK;wBACL,QAAQ;wBACR,QAAQ;4BACJ;4BACA;4BACA;4BACA;4BACA;4BACA;4BACA;4BACA;4BACA;4BACA;4BACA;4BACA;yBACH;wBACD,UAAU;4BACNU,0CAAAA,WAAkB,CAAC,EAAEf,UAAU,CAAC;4BAChCe,0CAAAA,WAAkB,CAAC,EAAEf,UAAU,EAAE,CAAC;yBACrC;oBACL;iBACH;YACL;QACJ;IACJ;AACJ"}
1
+ {"version":3,"file":"pulumi/apps/core/CoreOpenSearch.js","sources":["../../../../src/pulumi/apps/core/CoreOpenSearch.ts"],"sourcesContent":["/**\n * Important documents to read:\n *\n * https://docs.aws.amazon.com/opensearch-service/latest/developerguide/limits.html#network-limits\n */\nimport path from \"path\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport * as random from \"@pulumi/random\";\nimport {\n createAppModule,\n type PulumiApp,\n type PulumiAppRemoteResource,\n type PulumiAppResource,\n type PulumiAppResourceConstructor\n} from \"@webiny/pulumi\";\n\nimport { getAwsAccountId } from \"../awsUtils.js\";\nimport { CoreVpc } from \"./CoreVpc.js\";\nimport { LAMBDA_RUNTIME } from \"~/pulumi/constants.js\";\n\nexport interface OpenSearchParams {\n protect: boolean;\n namePrefix: string;\n prevDomainName: string | undefined;\n pointInTimeRecovery: boolean;\n}\n\nfunction getDevClusterConfig(): aws.types.input.opensearch.DomainClusterConfig {\n return {\n instanceType: \"t3.small.search\"\n };\n}\n\nfunction getProdClusterConfig(): aws.types.input.opensearch.DomainClusterConfig {\n return {\n // For production deployments, we create 3 instances and configure multi-AZ across 3 zones.\n instanceType: \"t3.medium.search\",\n instanceCount: 3,\n zoneAwarenessEnabled: true,\n zoneAwarenessConfig: {\n availabilityZoneCount: 3\n }\n };\n}\n\nconst OS_ENGINE_VERSION = \"OpenSearch_3.3\";\n\nexport const OpenSearch = createAppModule({\n name: \"OpenSearch\",\n config(app, params: OpenSearchParams) {\n const isProduction = app.env.isProduction;\n\n const vpc = app.getModule(CoreVpc, { optional: true });\n\n let domain:\n | PulumiAppResource<PulumiAppResourceConstructor<aws.opensearch.Domain>>\n | PulumiAppRemoteResource<aws.opensearch.GetDomainResult>\n | null = null;\n\n let domainPolicy;\n let domainEndpoint: pulumi.Output<string> | string;\n let domainArn: pulumi.Output<string>;\n\n const providedEndpoint = process.env.OPENSEARCH_ENDPOINT;\n const providedDomainName = process.env.AWS_OS_DOMAIN_NAME;\n\n if (providedEndpoint && !providedDomainName) {\n throw new Error(\n \"OPENSEARCH_ENDPOINT was provided but AWS_OS_DOMAIN_NAME is missing. \" +\n \"A domain name is required to look up the domain ARN when using a custom endpoint.\"\n );\n }\n\n if (providedDomainName) {\n // Look up the existing domain by name to obtain its ARN and (if no explicit endpoint is\n // provided) its endpoint. This covers both the ephemeral-environment pattern and the\n // case where an external endpoint is supplied alongside a domain name.\n // https://www.webiny.com/docs/key-topics/ci-cd/testing/slow-ephemeral-environments\n domain = app.addRemoteResource(providedDomainName, () => {\n return aws.opensearch.getDomain(\n { domainName: providedDomainName },\n { async: true }\n );\n });\n domainArn = domain.output.arn;\n // Prefer an explicitly provided endpoint; fall back to the one reported by AWS.\n domainEndpoint = providedEndpoint ?? domain.output.endpoint;\n } else {\n const randomId = new random.RandomId(\"osDomainRandomId\", { byteLength: 8 });\n\n const domainLogicalName = \"webiny-js\";\n\n /**\n * The physical domain name must remain stable across re-deploys. Changing it causes\n * Pulumi to delete and recreate the cluster, which is a destructive operation.\n *\n * To avoid this, we read the domain name that was stored in the previous deploy's\n * stack output (via `sdk.getAppStackOutput`) and reuse it unchanged. Only on the\n * very first deploy, when there is no previous output, do we generate a new name\n * (with the resource name prefix applied for consistent naming going forward).\n *\n * NOTE: `params.namePrefix` may be \"\" when upgrading from old code that never stored\n * the domain name in the stack output. In that case the caller passes \"\" explicitly so\n * the fallback formula reproduces the legacy name (`webiny-js-<hex>`) rather than\n * prepending the SDK default prefix and triggering an unintended cluster replacement.\n * See `createCorePulumiApp.ts` → `isUpgradeFromOldCode` for details.\n */\n const domainPhysicalName = randomId.hex.apply(\n hex =>\n params.prevDomainName ??\n `${params.namePrefix}${domainLogicalName}-${hex.slice(-7)}`\n );\n\n domain = app.addResource(aws.opensearch.Domain, {\n name: domainLogicalName,\n config: {\n domainName: domainPhysicalName,\n engineVersion: OS_ENGINE_VERSION,\n clusterConfig: isProduction ? getProdClusterConfig() : getDevClusterConfig(),\n vpcOptions: vpc\n ? {\n subnetIds: vpc.subnets.private.map(s => s.output.id),\n securityGroupIds: [vpc.vpc.output.defaultSecurityGroupId]\n }\n : undefined,\n ebsOptions: {\n ebsEnabled: true,\n volumeSize: 10,\n volumeType: \"gp2\"\n },\n advancedOptions: {\n \"rest.action.multi.allow_explicit_index\": \"true\"\n },\n snapshotOptions: {\n automatedSnapshotStartHour: 23\n }\n },\n opts: { protect: params.protect }\n });\n\n domainEndpoint = domain.output.endpoint;\n domainArn = domain.output.arn;\n\n /**\n * Domain policy defines who can access your OpenSearch Domain.\n * For details on OpenSearch security, read the official documentation:\n * https://docs.aws.amazon.com/openSearch-service/latest/developerguide/security.html\n */\n const accountId = getAwsAccountId(app);\n\n domainPolicy = app.addResource(aws.opensearch.DomainPolicy, {\n name: `${domainLogicalName}-policy`,\n config: {\n domainName: domain.output.domainName,\n accessPolicies: pulumi\n .all([accountId, domainArn])\n .apply(([accountId, domainArn]) => {\n return JSON.stringify({\n Version: \"2012-10-17\",\n Statement: [\n /**\n * Allow requests signed with current account\n */\n {\n Effect: \"Allow\",\n Principal: {\n AWS: accountId\n },\n Action: \"es:*\",\n Resource: `${domainArn}/*`\n }\n ]\n });\n })\n },\n opts: { protect: params.protect }\n });\n }\n\n /**\n * Create a table for OpenSearch records. All ES records are stored in this table to dramatically improve\n * performance and stability on write operations (especially massive data imports). This table also serves as a backup and\n * a single source of truth for your OpenSearch domain. Streaming is enabled on this table, and it will\n * allow asynchronous synchronization of data with OpenSearch domain.\n */\n const table = app.addResource(aws.dynamodb.Table, {\n name: \"webiny-es\",\n config: {\n attributes: [\n { name: \"PK\", type: \"S\" },\n { name: \"SK\", type: \"S\" },\n { name: \"GSI_TENANT\", type: \"S\" }\n ],\n streamEnabled: true,\n streamViewType: \"NEW_AND_OLD_IMAGES\",\n billingMode: \"PAY_PER_REQUEST\",\n hashKey: \"PK\",\n rangeKey: \"SK\",\n globalSecondaryIndexes: [\n {\n name: \"GSI_TENANT\",\n keySchemas: [\n {\n attributeName: \"GSI_TENANT\",\n keyType: \"HASH\"\n }\n ],\n projectionType: \"KEYS_ONLY\"\n }\n ],\n ttl: {\n attributeName: \"expiresAt\",\n enabled: true\n },\n pointInTimeRecovery: {\n enabled: params.pointInTimeRecovery\n }\n },\n opts: { protect: params.protect }\n });\n\n const roleName = \"dynamo-to-elastic-lambda-role\";\n\n const role = app.addResource(aws.iam.Role, {\n name: roleName,\n config: {\n assumeRolePolicy: {\n Version: \"2012-10-17\",\n Statement: [\n {\n Action: \"sts:AssumeRole\",\n Principal: {\n Service: \"lambda.amazonaws.com\"\n },\n Effect: \"Allow\"\n }\n ]\n }\n },\n meta: { isLambdaFunctionRole: true }\n });\n\n const policy = getDynamoDbToElasticLambdaPolicy(app, domainArn);\n\n app.addResource(aws.iam.RolePolicyAttachment, {\n name: `${roleName}-DynamoDbToElasticLambdaPolicy`,\n config: {\n role: role.output,\n policyArn: policy.output.arn\n }\n });\n\n // Only use `AWSLambdaVPCAccessExecutionRole` policy if VPC feature is enabled.\n if (vpc) {\n app.addResource(aws.iam.RolePolicyAttachment, {\n name: `${roleName}-AWSLambdaVPCAccessExecutionRole`,\n config: {\n role: role.output,\n policyArn: aws.iam.ManagedPolicy.AWSLambdaVPCAccessExecutionRole\n }\n });\n } else {\n app.addResource(aws.iam.RolePolicyAttachment, {\n name: `${roleName}-AWSLambdaBasicExecutionRole`,\n config: {\n role: role.output,\n policyArn: aws.iam.ManagedPolicy.AWSLambdaBasicExecutionRole\n }\n });\n }\n\n app.addResource(aws.iam.RolePolicyAttachment, {\n name: `${roleName}-AWSLambdaDynamoDBExecutionRole`,\n config: {\n role: role.output,\n policyArn: aws.iam.ManagedPolicy.AWSLambdaDynamoDBExecutionRole\n }\n });\n\n /**\n * This Lambda will process the stream events from DynamoDB table that contains OpenSearch items.\n * OpenSearch can't take large amount of individual writes in a short period of time, so this way\n * we store data for OpenSearch in a DynamoDB table, and asynchronously insert it into OpenSearch\n * using batching.\n */\n const lambda = app.addResource(aws.lambda.Function, {\n name: \"dynamo-to-elastic\",\n config: {\n role: role.output.arn,\n runtime: LAMBDA_RUNTIME,\n handler: \"handler.handler\",\n timeout: 900,\n memorySize: 1024,\n environment: {\n variables: {\n DEBUG: String(process.env.DEBUG),\n OPENSEARCH_ENDPOINT: domainEndpoint,\n OPENSEARCH_USERNAME: process.env.OPENSEARCH_USERNAME ?? \"\",\n OPENSEARCH_PASSWORD: process.env.OPENSEARCH_PASSWORD ?? \"\"\n }\n },\n description: \"Process DynamoDB Stream.\",\n code: new pulumi.asset.AssetArchive({\n \".\": new pulumi.asset.FileArchive(\n path.join(app.paths.workspace, \"dynamoToElastic/build\")\n )\n }),\n vpcConfig: vpc\n ? {\n subnetIds: vpc.subnets.private.map(s => s.output.id),\n securityGroupIds: [vpc.vpc.output.defaultSecurityGroupId]\n }\n : undefined,\n loggingConfig: {\n logFormat: \"JSON\"\n }\n }\n });\n\n const eventSourceMapping = app.addResource(aws.lambda.EventSourceMapping, {\n name: \"dynamo-to-elastic\",\n config: {\n eventSourceArn: table.output.streamArn,\n functionName: lambda.output.arn,\n startingPosition: \"LATEST\",\n maximumRetryAttempts: 3,\n batchSize: 50,\n maximumBatchingWindowInSeconds: 1\n }\n });\n\n app.addOutputs({\n opensearchDomainArn: domainArn,\n opensearchDomainEndpoint: domainEndpoint,\n opensearchDomainName: domain!.output.domainName,\n opensearchDynamodbTableArn: table.output.arn,\n opensearchDynamodbTableName: table.output.name\n });\n\n return {\n domain,\n domainPolicy,\n table,\n dynamoToElastic: {\n role,\n policy,\n lambda,\n eventSourceMapping\n }\n };\n }\n});\n\nfunction getDynamoDbToElasticLambdaPolicy(app: PulumiApp, domainArn: pulumi.Output<string>) {\n return app.addResource(aws.iam.Policy, {\n name: \"DynamoDbToElasticLambdaPolicy-updated\",\n config: {\n description: \"This policy enables access to ES and Dynamodb streams\",\n policy: {\n Version: \"2012-10-17\",\n Statement: [\n {\n Sid: \"PermissionForES\",\n Effect: \"Allow\",\n Action: [\n \"es:ESHttpGet\",\n \"es:ESHttpDelete\",\n \"es:ESHttpPatch\",\n \"es:ESHttpPost\",\n \"es:ESHttpPut\",\n \"dynamodb:BatchGetItem\",\n \"dynamodb:BatchWriteItem\",\n \"dynamodb:PutItem\",\n \"dynamodb:GetItem\",\n \"dynamodb:DeleteItem\",\n \"dynamodb:Query\",\n \"dynamodb:UpdateItem\"\n ],\n Resource: [\n pulumi.interpolate`${domainArn}`,\n pulumi.interpolate`${domainArn}/*`\n ]\n }\n ]\n }\n }\n });\n}\n"],"names":["getDevClusterConfig","getProdClusterConfig","OS_ENGINE_VERSION","OpenSearch","createAppModule","app","params","isProduction","vpc","CoreVpc","domain","domainPolicy","domainEndpoint","domainArn","providedEndpoint","process","providedDomainName","Error","aws","randomId","random","domainLogicalName","domainPhysicalName","hex","s","undefined","accountId","getAwsAccountId","pulumi","JSON","table","roleName","role","policy","getDynamoDbToElasticLambdaPolicy","lambda","LAMBDA_RUNTIME","String","path","eventSourceMapping"],"mappings":";;;;;;;;AA4BA,SAASA;IACL,OAAO;QACH,cAAc;IAClB;AACJ;AAEA,SAASC;IACL,OAAO;QAEH,cAAc;QACd,eAAe;QACf,sBAAsB;QACtB,qBAAqB;YACjB,uBAAuB;QAC3B;IACJ;AACJ;AAEA,MAAMC,oBAAoB;AAEnB,MAAMC,aAAaC,gBAAgB;IACtC,MAAM;IACN,QAAOC,GAAG,EAAEC,MAAwB;QAChC,MAAMC,eAAeF,IAAI,GAAG,CAAC,YAAY;QAEzC,MAAMG,MAAMH,IAAI,SAAS,CAACI,SAAS;YAAE,UAAU;QAAK;QAEpD,IAAIC,SAGS;QAEb,IAAIC;QACJ,IAAIC;QACJ,IAAIC;QAEJ,MAAMC,mBAAmBC,QAAQ,GAAG,CAAC,mBAAmB;QACxD,MAAMC,qBAAqBD,QAAQ,GAAG,CAAC,kBAAkB;QAEzD,IAAID,oBAAoB,CAACE,oBACrB,MAAM,IAAIC,MACN;QAKR,IAAID,oBAAoB;YAKpBN,SAASL,IAAI,iBAAiB,CAACW,oBAAoB,IACxCE,uCAAAA,UAAAA,CAAAA,SAAwB,CAC3B;oBAAE,YAAYF;gBAAmB,GACjC;oBAAE,OAAO;gBAAK;YAGtBH,YAAYH,OAAO,MAAM,CAAC,GAAG;YAE7BE,iBAAiBE,oBAAoBJ,OAAO,MAAM,CAAC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4BAChCe,0CAAAA,WAAkB,CAAC,EAAEf,UAAU,EAAE,CAAC;yBACrC;oBACL;iBACH;YACL;QACJ;IACJ;AACJ"}
@@ -8,12 +8,15 @@ import { CoreVpc } from "./CoreVpc.js";
8
8
  import { WatchCommand } from "./WatchCommand.js";
9
9
  import { withServiceManifest } from "../../utils/withServiceManifest.js";
10
10
  import { addServiceManifestTableItem } from "../../utils/addServiceManifestTableItem.js";
11
- import { getProjectSdk } from "@webiny/project";
11
+ import { getAwsProjectSdk } from "../../getAwsProjectSdk.js";
12
12
  import { CorePulumi } from "../../../abstractions/features/pulumi/index.js";
13
13
  import { corePulumi } from "../../features/CorePulumi/index.js";
14
14
  import { getOsConfigFromExtension } from "../extensions/getOsConfigFromExtension.js";
15
15
  import { getVpcConfigFromExtension } from "../extensions/getVpcConfigFromExtension.js";
16
16
  import { isVpcEnabled } from "../extensions/isVpcEnabled.js";
17
+ import { isProductionDefaultEnabled } from "../extensions/isProductionDefaultEnabled.js";
18
+ import { DynamoDbPitr } from "../../extensions/DynamoDbPitr.js";
19
+ import { S3BucketVersioning } from "../../extensions/S3BucketVersioning.js";
17
20
  import { applyAwsResourceTags, getAwsRegion } from "../awsUtils.js";
18
21
  import { configureS3BucketMalwareProtection } from "./configureS3BucketMalwareProtection.js";
19
22
  import { CoreAuditLogsDynamo } from "../../index.js";
@@ -25,7 +28,7 @@ function createCorePulumiApp() {
25
28
  name: "core",
26
29
  path: "apps/core",
27
30
  program: async (app)=>{
28
- const sdk = await getProjectSdk();
31
+ const sdk = await getAwsProjectSdk();
29
32
  const projectConfig = await sdk.getProjectConfig();
30
33
  const pulumiResourceNamePrefix = await sdk.getPulumiResourceNamePrefix();
31
34
  const coreStackOutput = await sdk.getAppStackOutput("core");
@@ -57,7 +60,7 @@ function createCorePulumiApp() {
57
60
  app.addHandler(async ()=>{
58
61
  const usingAdvancedVpcParams = vpcExtensionsConfig && "boolean" != typeof vpcExtensionsConfig;
59
62
  const featureFlags = await sdk.getFeatureFlags();
60
- if (featureFlags.isFileManagerThreatDetectionEnabled()) configureS3BucketMalwareProtection(app);
63
+ if (featureFlags.isEnabled("fileManager.threatDetection")) configureS3BucketMalwareProtection(app);
61
64
  if (!usingAdvancedVpcParams) return;
62
65
  const { resources, addResource, onResource } = app;
63
66
  const { useExistingVpc, useVpcEndpoints } = vpcExtensionsConfig;
@@ -149,11 +152,15 @@ function createCorePulumiApp() {
149
152
  app.addHandler(()=>pulumiHandlers.execute(app));
150
153
  const isProduction = app.env.isProduction;
151
154
  const protect = isProduction;
155
+ const pointInTimeRecovery = isProductionDefaultEnabled(projectConfig, DynamoDbPitr, isProduction);
156
+ const s3BucketVersioning = isProductionDefaultEnabled(projectConfig, S3BucketVersioning, isProduction);
152
157
  const dynamoDbTable = app.addModule(CoreDynamo, {
153
- protect
158
+ protect,
159
+ pointInTimeRecovery
154
160
  });
155
161
  const auditLogsDynamoDbTable = app.addModule(CoreAuditLogsDynamo, {
156
- protect
162
+ protect,
163
+ pointInTimeRecovery
157
164
  });
158
165
  const vpc = isVpcEnabled(vpcExtensionsConfig, isProduction) ? app.addModule(CoreVpc) : null;
159
166
  const cognito = app.addModule(CoreCognito, {
@@ -178,7 +185,8 @@ function createCorePulumiApp() {
178
185
  ];
179
186
  const eventBus = app.addModule(CoreEventBus);
180
187
  const { bucket: fileManagerBucket } = app.addModule(CoreFileManger, {
181
- protect
188
+ protect,
189
+ versioning: s3BucketVersioning
182
190
  });
183
191
  let opensearch;
184
192
  if ("opensearch" === searchEngineType) {
@@ -188,7 +196,8 @@ function createCorePulumiApp() {
188
196
  opensearch = app.addModule(OpenSearch, {
189
197
  protect,
190
198
  namePrefix: namePrefixForOs,
191
- prevDomainName
199
+ prevDomainName,
200
+ pointInTimeRecovery
192
201
  });
193
202
  }
194
203
  app.addModule(WatchCommand, {