@webiny/project-aws 6.6.0-alpha.1 → 6.6.0-alpha.11

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 (540) hide show
  1. package/AwsProjectSdk.d.ts +38 -0
  2. package/AwsProjectSdk.js +61 -0
  3. package/AwsProjectSdk.js.map +1 -0
  4. package/abstractions/features/DestroyApp.d.ts +18 -0
  5. package/abstractions/features/DestroyApp.js +5 -0
  6. package/abstractions/features/DestroyApp.js.map +1 -0
  7. package/abstractions/features/ExportStack.d.ts +18 -0
  8. package/abstractions/features/ExportStack.js +5 -0
  9. package/abstractions/features/ExportStack.js.map +1 -0
  10. package/abstractions/features/GetAppOutput.d.ts +18 -0
  11. package/abstractions/features/GetAppOutput.js +5 -0
  12. package/abstractions/features/GetAppOutput.js.map +1 -0
  13. package/abstractions/features/GetAppStackOutput.d.ts +18 -0
  14. package/abstractions/features/GetAppStackOutput.js +5 -0
  15. package/abstractions/features/GetAppStackOutput.js.map +1 -0
  16. package/abstractions/features/GetPulumiResourceNamePrefix.d.ts +7 -0
  17. package/abstractions/features/GetPulumiResourceNamePrefix.js +5 -0
  18. package/abstractions/features/GetPulumiResourceNamePrefix.js.map +1 -0
  19. package/abstractions/features/RefreshApp.d.ts +18 -0
  20. package/abstractions/features/RefreshApp.js +5 -0
  21. package/abstractions/features/RefreshApp.js.map +1 -0
  22. package/abstractions/features/RunPulumiCommand.d.ts +19 -0
  23. package/abstractions/features/RunPulumiCommand.js +5 -0
  24. package/abstractions/features/RunPulumiCommand.js.map +1 -0
  25. package/abstractions/index.d.ts +21 -6
  26. package/abstractions/index.js +21 -6
  27. package/abstractions/pulumiTypes.d.ts +18 -0
  28. package/abstractions/pulumiTypes.js +0 -0
  29. package/abstractions/services/GetPulumiService.d.ts +20 -0
  30. package/abstractions/services/GetPulumiService.js +5 -0
  31. package/abstractions/services/GetPulumiService.js.map +1 -0
  32. package/abstractions/services/GetPulumiVersionService.d.ts +12 -0
  33. package/abstractions/services/GetPulumiVersionService.js +5 -0
  34. package/abstractions/services/GetPulumiVersionService.js.map +1 -0
  35. package/abstractions/services/IsRemotePulumiBackendService.d.ts +7 -0
  36. package/abstractions/services/IsRemotePulumiBackendService.js +5 -0
  37. package/abstractions/services/IsRemotePulumiBackendService.js.map +1 -0
  38. package/abstractions/services/ListAppLambdaFunctionsService.d.ts +23 -0
  39. package/abstractions/services/ListAppLambdaFunctionsService.js +5 -0
  40. package/abstractions/services/ListAppLambdaFunctionsService.js.map +1 -0
  41. package/abstractions/services/ListDeployedEnvironmentsService.d.ts +12 -0
  42. package/abstractions/services/ListDeployedEnvironmentsService.js +5 -0
  43. package/abstractions/services/ListDeployedEnvironmentsService.js.map +1 -0
  44. package/abstractions/services/PulumiExportService.d.ts +13 -0
  45. package/abstractions/services/PulumiExportService.js +6 -0
  46. package/abstractions/services/PulumiExportService.js.map +1 -0
  47. package/abstractions/services/PulumiGetConfigPassphraseService.d.ts +7 -0
  48. package/abstractions/services/PulumiGetConfigPassphraseService.js +5 -0
  49. package/abstractions/services/PulumiGetConfigPassphraseService.js.map +1 -0
  50. package/abstractions/services/PulumiGetSecretsProviderService.d.ts +7 -0
  51. package/abstractions/services/PulumiGetSecretsProviderService.js +5 -0
  52. package/abstractions/services/PulumiGetSecretsProviderService.js.map +1 -0
  53. package/abstractions/services/PulumiGetStackOutputService.d.ts +13 -0
  54. package/abstractions/services/PulumiGetStackOutputService.js +5 -0
  55. package/abstractions/services/PulumiGetStackOutputService.js.map +1 -0
  56. package/abstractions/services/PulumiImportService.d.ts +8 -0
  57. package/abstractions/services/PulumiImportService.js +5 -0
  58. package/abstractions/services/PulumiImportService.js.map +1 -0
  59. package/abstractions/services/PulumiLoginService.d.ts +19 -0
  60. package/abstractions/services/PulumiLoginService.js +5 -0
  61. package/abstractions/services/PulumiLoginService.js.map +1 -0
  62. package/abstractions/services/PulumiSelectStackService.d.ts +10 -0
  63. package/abstractions/services/PulumiSelectStackService.js +5 -0
  64. package/abstractions/services/PulumiSelectStackService.js.map +1 -0
  65. package/abstractions/services/StackOutputCacheService.d.ts +10 -0
  66. package/abstractions/services/StackOutputCacheService.js +5 -0
  67. package/abstractions/services/StackOutputCacheService.js.map +1 -0
  68. package/abstractions/services/WatchedLambdaFunctionsService.d.ts +28 -0
  69. package/abstractions/services/WatchedLambdaFunctionsService.js +5 -0
  70. package/abstractions/services/WatchedLambdaFunctionsService.js.map +1 -0
  71. package/api.d.ts +1 -15
  72. package/api.js +1 -3
  73. package/api.js.map +1 -1
  74. package/decorators/DeployAppClearWatchedLambdaFunctions.d.ts +20 -0
  75. package/decorators/DeployAppClearWatchedLambdaFunctions.js +35 -0
  76. package/decorators/DeployAppClearWatchedLambdaFunctions.js.map +1 -0
  77. package/decorators/DeployAppRefreshStackOutputCache.d.ts +20 -0
  78. package/decorators/DeployAppRefreshStackOutputCache.js +34 -0
  79. package/decorators/DeployAppRefreshStackOutputCache.js.map +1 -0
  80. package/decorators/DeployAppWithHooks.d.ts +25 -0
  81. package/decorators/DeployAppWithHooks.js +58 -0
  82. package/decorators/DeployAppWithHooks.js.map +1 -0
  83. package/decorators/DeployAppWithWatchedLambdaReplacement.d.ts +20 -0
  84. package/decorators/DeployAppWithWatchedLambdaReplacement.js +42 -0
  85. package/decorators/DeployAppWithWatchedLambdaReplacement.js.map +1 -0
  86. package/decorators/DestroyAppClearStackOutputCache.d.ts +28 -0
  87. package/decorators/DestroyAppClearStackOutputCache.js +31 -0
  88. package/decorators/DestroyAppClearStackOutputCache.js.map +1 -0
  89. package/decorators/GetPulumiServiceWithDownloadInfo.d.ts +13 -0
  90. package/decorators/GetPulumiServiceWithDownloadInfo.js +28 -0
  91. package/decorators/GetPulumiServiceWithDownloadInfo.js.map +1 -0
  92. package/decorators/ProjectInfoWithPulumi.d.ts +34 -0
  93. package/decorators/ProjectInfoWithPulumi.js +36 -0
  94. package/decorators/ProjectInfoWithPulumi.js.map +1 -0
  95. package/exports/infra/admin.d.ts +1 -3
  96. package/exports/infra/admin.js +0 -3
  97. package/exports/infra/api.d.ts +1 -3
  98. package/exports/infra/api.js +0 -3
  99. package/exports/infra/core.d.ts +1 -2
  100. package/exports/infra/core.js +0 -2
  101. package/extensions/ApiLambdaFunction.js +3 -2
  102. package/extensions/ApiLambdaFunction.js.map +1 -1
  103. package/extensions/ApiRoute.d.ts +7 -16
  104. package/extensions/ApiRoute.js +5 -73
  105. package/extensions/ApiRoute.js.map +1 -1
  106. package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.d.ts +3 -2
  107. package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js +2 -1
  108. package/extensions/OpenSearch/EnsureOsServiceRoleBeforeCoreDeploy.js.map +1 -1
  109. package/extensions/OpenSearch/EnsureOsWasDeployed.d.ts +3 -3
  110. package/extensions/OpenSearch/EnsureOsWasDeployed.js +1 -2
  111. package/extensions/OpenSearch/EnsureOsWasDeployed.js.map +1 -1
  112. package/extensions/OpenSearch.d.ts +9 -10
  113. package/extensions/OpenSearch.js +8 -16
  114. package/extensions/OpenSearch.js.map +1 -1
  115. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.d.ts +3 -3
  116. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js +3 -2
  117. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js.map +1 -1
  118. package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.d.ts +3 -2
  119. package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js +2 -1
  120. package/extensions/ProjectAws/BlueGreenDeployments/EnsureVariantBeforeDeploy.js.map +1 -1
  121. package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.d.ts +5 -2
  122. package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js +3 -1
  123. package/extensions/ProjectAws/BlueGreenDeployments/PrintDeploymentInfoAfterDeploy.js.map +1 -1
  124. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.d.ts +3 -1
  125. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js +2 -1
  126. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js.map +1 -1
  127. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.d.ts +3 -1
  128. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js +2 -1
  129. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js.map +1 -1
  130. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.d.ts +3 -1
  131. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js +2 -1
  132. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js.map +1 -1
  133. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.d.ts +3 -2
  134. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js +3 -2
  135. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js.map +1 -1
  136. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.d.ts +4 -2
  137. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js +3 -1
  138. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js.map +1 -1
  139. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.d.ts +6 -2
  140. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js +2 -1
  141. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js.map +1 -1
  142. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.d.ts +1 -1
  143. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js +1 -1
  144. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js.map +1 -1
  145. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.d.ts +1 -1
  146. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js +1 -1
  147. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeBuild.js.map +1 -1
  148. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.d.ts +1 -1
  149. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js +1 -1
  150. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVarsBeforeWatch.js.map +1 -1
  151. package/extensions/ProjectAws/SetDatabaseSetupOutput.d.ts +2 -2
  152. package/extensions/ProjectAws/SetDatabaseSetupOutput.js +1 -1
  153. package/extensions/ProjectAws/SetDatabaseSetupOutput.js.map +1 -1
  154. package/extensions/ProjectAws/TelemetryNoLongerNewUser.d.ts +2 -2
  155. package/extensions/ProjectAws/TelemetryNoLongerNewUser.js +1 -1
  156. package/extensions/ProjectAws/TelemetryNoLongerNewUser.js.map +1 -1
  157. package/extensions/ProjectAws/UploadAdminAppToS3.d.ts +5 -3
  158. package/extensions/ProjectAws/UploadAdminAppToS3.js +3 -3
  159. package/extensions/ProjectAws/UploadAdminAppToS3.js.map +1 -1
  160. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.d.ts +5 -2
  161. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js +2 -1
  162. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js.map +1 -1
  163. package/extensions/ProjectAws/ValidateProductionPulumiState.d.ts +5 -2
  164. package/extensions/ProjectAws/ValidateProductionPulumiState.js +3 -1
  165. package/extensions/ProjectAws/ValidateProductionPulumiState.js.map +1 -1
  166. package/extensions/ProjectAws/definitions.js +6 -2
  167. package/extensions/ProjectAws/definitions.js.map +1 -1
  168. package/extensions/ProjectAws.d.ts +1 -0
  169. package/extensions/ProjectAws.js +3 -1
  170. package/extensions/ProjectAws.js.map +1 -1
  171. package/extensions/RegisterRoutesPulumi.d.ts +2 -2
  172. package/extensions/RegisterRoutesPulumi.js +4 -4
  173. package/extensions/RegisterRoutesPulumi.js.map +1 -1
  174. package/extensions/definitions.js +1 -5
  175. package/extensions/definitions.js.map +1 -1
  176. package/extensions/index.d.ts +2 -3
  177. package/extensions/index.js +2 -3
  178. package/extensions/registerExtensionImplementations.js +11 -0
  179. package/extensions/registerExtensionImplementations.js.map +1 -0
  180. package/extensions/toApiGatewayPath.d.ts +2 -0
  181. package/extensions/toApiGatewayPath.js +6 -0
  182. package/extensions/toApiGatewayPath.js.map +1 -0
  183. package/features/ApiGqlClient.d.ts +4 -4
  184. package/features/ApiGqlClient.js +3 -3
  185. package/features/ApiGqlClient.js.map +1 -1
  186. package/features/DeployApp/DeployApp.d.ts +22 -0
  187. package/features/DeployApp/DeployApp.js +91 -0
  188. package/features/DeployApp/DeployApp.js.map +1 -0
  189. package/features/DeployApp/index.d.ts +1 -0
  190. package/features/DeployApp/index.js +1 -0
  191. package/features/DestroyApp/DestroyApp.d.ts +20 -0
  192. package/features/DestroyApp/DestroyApp.js +70 -0
  193. package/features/DestroyApp/DestroyApp.js.map +1 -0
  194. package/features/DestroyApp/index.d.ts +1 -0
  195. package/features/DestroyApp/index.js +1 -0
  196. package/features/ExportStack/ExportStack.d.ts +12 -0
  197. package/features/ExportStack/ExportStack.js +28 -0
  198. package/features/ExportStack/ExportStack.js.map +1 -0
  199. package/features/ExportStack/index.d.ts +1 -0
  200. package/features/ExportStack/index.js +1 -0
  201. package/features/GetAppOutput/GetAppOutput.d.ts +16 -0
  202. package/features/GetAppOutput/GetAppOutput.js +55 -0
  203. package/features/GetAppOutput/GetAppOutput.js.map +1 -0
  204. package/features/GetAppOutput/index.d.ts +1 -0
  205. package/features/GetAppOutput/index.js +1 -0
  206. package/features/GetAppStackOutput/GetAppStackOutput.d.ts +13 -0
  207. package/features/GetAppStackOutput/GetAppStackOutput.js +28 -0
  208. package/features/GetAppStackOutput/GetAppStackOutput.js.map +1 -0
  209. package/features/GetAppStackOutput/index.d.ts +1 -0
  210. package/features/GetAppStackOutput/index.js +1 -0
  211. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.d.ts +8 -0
  212. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js +26 -0
  213. package/features/GetPulumiResourceNamePrefix/GetPulumiResourceNamePrefix.js.map +1 -0
  214. package/features/GetPulumiResourceNamePrefix/index.d.ts +1 -0
  215. package/features/GetPulumiResourceNamePrefix/index.js +1 -0
  216. package/features/InvokeLambdaFunction.d.ts +3 -3
  217. package/features/InvokeLambdaFunction.js +3 -3
  218. package/features/InvokeLambdaFunction.js.map +1 -1
  219. package/features/RefreshApp/RefreshApp.d.ts +18 -0
  220. package/features/RefreshApp/RefreshApp.js +68 -0
  221. package/features/RefreshApp/RefreshApp.js.map +1 -0
  222. package/features/RefreshApp/index.d.ts +1 -0
  223. package/features/RefreshApp/index.js +1 -0
  224. package/features/RunPulumiCommand/RunPulumiCommand.d.ts +18 -0
  225. package/features/RunPulumiCommand/RunPulumiCommand.js +65 -0
  226. package/features/RunPulumiCommand/RunPulumiCommand.js.map +1 -0
  227. package/features/RunPulumiCommand/index.d.ts +1 -0
  228. package/features/RunPulumiCommand/index.js +1 -0
  229. package/features/Watch/AwsWatch.d.ts +9 -1
  230. package/features/Watch/AwsWatch.js +8 -4
  231. package/features/Watch/AwsWatch.js.map +1 -1
  232. package/features/Watch/getIotEndpoint.d.ts +2 -2
  233. package/features/Watch/getIotEndpoint.js.map +1 -1
  234. package/features/Watch/initInvocationForwarding.d.ts +9 -0
  235. package/features/Watch/initInvocationForwarding.js +91 -0
  236. package/features/Watch/initInvocationForwarding.js.map +1 -0
  237. package/features/Watch/localInvocationWorker.d.ts +1 -0
  238. package/features/Watch/localInvocationWorker.js +31 -0
  239. package/features/Watch/localInvocationWorker.js.map +1 -0
  240. package/features/Watch/replaceLambdaFunctions.d.ts +7 -3
  241. package/features/Watch/replaceLambdaFunctions.js.map +1 -1
  242. package/features/hooks/AdminAfterDeploy/AdminAfterDeploy.d.ts +7 -0
  243. package/features/hooks/AdminAfterDeploy/AdminAfterDeploy.js +25 -0
  244. package/features/hooks/AdminAfterDeploy/AdminAfterDeploy.js.map +1 -0
  245. package/features/hooks/AdminAfterDeploy/index.d.ts +1 -0
  246. package/features/hooks/AdminAfterDeploy/index.js +1 -0
  247. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.d.ts +7 -0
  248. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js +25 -0
  249. package/features/hooks/AdminBeforeDeploy/AdminBeforeDeploy.js.map +1 -0
  250. package/features/hooks/AdminBeforeDeploy/index.d.ts +1 -0
  251. package/features/hooks/AdminBeforeDeploy/index.js +1 -0
  252. package/features/hooks/AfterDeploy/AfterDeploy.d.ts +7 -0
  253. package/features/hooks/AfterDeploy/AfterDeploy.js +25 -0
  254. package/features/hooks/AfterDeploy/AfterDeploy.js.map +1 -0
  255. package/features/hooks/AfterDeploy/index.d.ts +1 -0
  256. package/features/hooks/AfterDeploy/index.js +1 -0
  257. package/features/hooks/ApiAfterDeploy/ApiAfterDeploy.d.ts +7 -0
  258. package/features/hooks/ApiAfterDeploy/ApiAfterDeploy.js +25 -0
  259. package/features/hooks/ApiAfterDeploy/ApiAfterDeploy.js.map +1 -0
  260. package/features/hooks/ApiAfterDeploy/index.d.ts +1 -0
  261. package/features/hooks/ApiAfterDeploy/index.js +1 -0
  262. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.d.ts +7 -0
  263. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js +25 -0
  264. package/features/hooks/ApiBeforeDeploy/ApiBeforeDeploy.js.map +1 -0
  265. package/features/hooks/ApiBeforeDeploy/index.d.ts +1 -0
  266. package/features/hooks/ApiBeforeDeploy/index.js +1 -0
  267. package/features/hooks/BeforeDeploy/BeforeDeploy.d.ts +7 -0
  268. package/features/hooks/BeforeDeploy/BeforeDeploy.js +25 -0
  269. package/features/hooks/BeforeDeploy/BeforeDeploy.js.map +1 -0
  270. package/features/hooks/BeforeDeploy/index.d.ts +1 -0
  271. package/features/hooks/BeforeDeploy/index.js +1 -0
  272. package/features/hooks/CoreAfterDeploy/CoreAfterDeploy.d.ts +7 -0
  273. package/features/hooks/CoreAfterDeploy/CoreAfterDeploy.js +25 -0
  274. package/features/hooks/CoreAfterDeploy/CoreAfterDeploy.js.map +1 -0
  275. package/features/hooks/CoreAfterDeploy/index.d.ts +1 -0
  276. package/features/hooks/CoreAfterDeploy/index.js +1 -0
  277. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.d.ts +7 -0
  278. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js +25 -0
  279. package/features/hooks/CoreBeforeDeploy/CoreBeforeDeploy.js.map +1 -0
  280. package/features/hooks/CoreBeforeDeploy/index.d.ts +1 -0
  281. package/features/hooks/CoreBeforeDeploy/index.js +1 -0
  282. package/index.d.ts +3 -0
  283. package/index.js +3 -0
  284. package/infra.d.ts +49 -2
  285. package/infra.js +16 -4
  286. package/infra.js.map +1 -1
  287. package/package.json +26 -23
  288. package/project.d.ts +12 -1
  289. package/project.js +3 -2
  290. package/project.js.map +1 -1
  291. package/pulumi/apps/admin/createAdminPulumiApp.js +7 -4
  292. package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
  293. package/pulumi/apps/api/ApiCloudfront.js +2 -1
  294. package/pulumi/apps/api/ApiCloudfront.js.map +1 -1
  295. package/pulumi/apps/api/ApiOutput.d.ts +6 -6
  296. package/pulumi/apps/api/createApiPulumiApp.js +9 -7
  297. package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
  298. package/pulumi/apps/awsUtils.js +1 -1
  299. package/pulumi/apps/awsUtils.js.map +1 -1
  300. package/pulumi/apps/blueGreen/domains/resolveDomains.js +1 -1
  301. package/pulumi/apps/blueGreen/domains/resolveDomains.js.map +1 -1
  302. package/pulumi/apps/blueGreen/types.d.ts +2 -5
  303. package/pulumi/apps/common/CoreOutput.d.ts +2 -1
  304. package/pulumi/apps/common/CoreOutput.js.map +1 -1
  305. package/pulumi/apps/core/CoreAuditLogsDynamo.d.ts +1 -0
  306. package/pulumi/apps/core/CoreAuditLogsDynamo.js +3 -0
  307. package/pulumi/apps/core/CoreAuditLogsDynamo.js.map +1 -1
  308. package/pulumi/apps/core/CoreDynamo.d.ts +1 -0
  309. package/pulumi/apps/core/CoreDynamo.js +3 -0
  310. package/pulumi/apps/core/CoreDynamo.js.map +1 -1
  311. package/pulumi/apps/core/CoreFileManager.d.ts +2 -0
  312. package/pulumi/apps/core/CoreFileManager.js +11 -1
  313. package/pulumi/apps/core/CoreFileManager.js.map +1 -1
  314. package/pulumi/apps/core/CoreOpenSearch.d.ts +1 -0
  315. package/pulumi/apps/core/CoreOpenSearch.js +3 -0
  316. package/pulumi/apps/core/CoreOpenSearch.js.map +1 -1
  317. package/pulumi/apps/core/configureS3BucketMalwareProtection.js +12 -2
  318. package/pulumi/apps/core/configureS3BucketMalwareProtection.js.map +1 -1
  319. package/pulumi/apps/core/createCorePulumiApp.js +16 -7
  320. package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
  321. package/pulumi/apps/customDomain.d.ts +10 -0
  322. package/pulumi/apps/customDomain.js +5 -1
  323. package/pulumi/apps/customDomain.js.map +1 -1
  324. package/pulumi/apps/extensions/getAwsTagsFromExtension.js +1 -1
  325. package/pulumi/apps/extensions/getAwsTagsFromExtension.js.map +1 -1
  326. package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.d.ts +2 -2
  327. package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.js +1 -1
  328. package/pulumi/apps/extensions/getBgDeploymentsConfigFromExtension.js.map +1 -1
  329. package/pulumi/apps/extensions/getOsConfigFromExtension.js +2 -2
  330. package/pulumi/apps/extensions/getOsConfigFromExtension.js.map +1 -1
  331. package/pulumi/apps/extensions/getVpcConfigFromExtension.js +1 -1
  332. package/pulumi/apps/extensions/getVpcConfigFromExtension.js.map +1 -1
  333. package/pulumi/apps/extensions/isProductionDefaultEnabled.d.ts +16 -0
  334. package/pulumi/apps/extensions/isProductionDefaultEnabled.js +9 -0
  335. package/pulumi/apps/extensions/isProductionDefaultEnabled.js.map +1 -0
  336. package/pulumi/apps/extensions/isVpcEnabled.d.ts +14 -0
  337. package/pulumi/apps/extensions/isVpcEnabled.js +8 -0
  338. package/pulumi/apps/extensions/isVpcEnabled.js.map +1 -0
  339. package/pulumi/apps/syncSystem/types.d.ts +2 -2
  340. package/pulumi/extensions/AdminPulumi.js +3 -2
  341. package/pulumi/extensions/AdminPulumi.js.map +1 -1
  342. package/pulumi/extensions/ApiPulumi.js +3 -2
  343. package/pulumi/extensions/ApiPulumi.js.map +1 -1
  344. package/pulumi/extensions/CorePulumi.js +3 -2
  345. package/pulumi/extensions/CorePulumi.js.map +1 -1
  346. package/pulumi/extensions/index.d.ts +53 -22
  347. package/pulumi/extensions/index.js +12 -9
  348. package/pulumi/extensions/index.js.map +1 -1
  349. package/pulumi/features/AdminPulumi/AdminPulumi.d.ts +1 -1
  350. package/pulumi/features/AdminPulumi/AdminPulumi.js +1 -1
  351. package/pulumi/features/AdminPulumi/AdminPulumi.js.map +1 -1
  352. package/pulumi/features/ApiPulumi/ApiPulumi.d.ts +1 -1
  353. package/pulumi/features/ApiPulumi/ApiPulumi.js +1 -1
  354. package/pulumi/features/ApiPulumi/ApiPulumi.js.map +1 -1
  355. package/pulumi/features/CorePulumi/CorePulumi.d.ts +1 -1
  356. package/pulumi/features/CorePulumi/CorePulumi.js +1 -1
  357. package/pulumi/features/CorePulumi/CorePulumi.js.map +1 -1
  358. package/pulumi/features/DefaultSetAdminCustomDomains.d.ts +1 -1
  359. package/pulumi/features/DefaultSetAdminCustomDomains.js.map +1 -1
  360. package/pulumi/features/DefaultSetApiCustomDomains.d.ts +1 -1
  361. package/pulumi/features/DefaultSetApiCustomDomains.js.map +1 -1
  362. package/pulumi/getAwsProjectSdk.d.ts +2 -12
  363. package/pulumi/getAwsProjectSdk.js +2 -3
  364. package/pulumi/getAwsProjectSdk.js.map +1 -1
  365. package/pulumi/getStackOutput.d.ts +4 -5
  366. package/pulumi/getStackOutput.js.map +1 -1
  367. package/pulumi/types.d.ts +4 -3
  368. package/pulumi/utils/getDistributionUrl.d.ts +9 -0
  369. package/pulumi/utils/getDistributionUrl.js +8 -0
  370. package/pulumi/utils/getDistributionUrl.js.map +1 -0
  371. package/pulumi/utils/index.d.ts +1 -0
  372. package/pulumi/utils/index.js +1 -0
  373. package/pulumi/utils/lambdaEnvVariables.js.map +1 -1
  374. package/registerAwsProjectFeatures.js +38 -9
  375. package/registerAwsProjectFeatures.js.map +1 -1
  376. package/services/AdminStackOutputService.d.ts +3 -3
  377. package/services/AdminStackOutputService.js +2 -2
  378. package/services/AdminStackOutputService.js.map +1 -1
  379. package/services/ApiStackOutputService.d.ts +3 -3
  380. package/services/ApiStackOutputService.js +2 -2
  381. package/services/ApiStackOutputService.js.map +1 -1
  382. package/services/AwsDeployInitHostingSdkService/AwsDeployInitHostingSdkService.d.ts +10 -0
  383. package/services/AwsDeployInitHostingSdkService/AwsDeployInitHostingSdkService.js +30 -0
  384. package/services/AwsDeployInitHostingSdkService/AwsDeployInitHostingSdkService.js.map +1 -0
  385. package/services/AwsPulumiInitHostingSdkService/AwsPulumiInitHostingSdkService.d.ts +9 -0
  386. package/services/AwsPulumiInitHostingSdkService/AwsPulumiInitHostingSdkService.js +24 -0
  387. package/services/AwsPulumiInitHostingSdkService/AwsPulumiInitHostingSdkService.js.map +1 -0
  388. package/services/CoreStackOutputService.d.ts +3 -3
  389. package/services/CoreStackOutputService.js +2 -2
  390. package/services/CoreStackOutputService.js.map +1 -1
  391. package/services/GetPulumiService/GetPulumiService.d.ts +4 -3
  392. package/services/GetPulumiService/GetPulumiService.js +3 -2
  393. package/services/GetPulumiService/GetPulumiService.js.map +1 -1
  394. package/services/GetPulumiVersionService/GetPulumiVersionService.d.ts +5 -0
  395. package/services/GetPulumiVersionService/GetPulumiVersionService.js +46 -0
  396. package/services/GetPulumiVersionService/GetPulumiVersionService.js.map +1 -0
  397. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.d.ts +14 -0
  398. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js +15 -0
  399. package/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js.map +1 -0
  400. package/services/IsRemotePulumiBackendService/index.d.ts +1 -0
  401. package/services/IsRemotePulumiBackendService/index.js +1 -0
  402. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.d.ts +20 -0
  403. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js +63 -0
  404. package/services/ListAppLambdaFunctionsService/ListAppLambdaFunctionsService.js.map +1 -0
  405. package/services/ListAppLambdaFunctionsService/index.d.ts +1 -0
  406. package/services/ListAppLambdaFunctionsService/index.js +1 -0
  407. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.d.ts +8 -0
  408. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js +31 -0
  409. package/services/ListDeployedEnvironmentsService/ListDeployedEnvironmentsService.js.map +1 -0
  410. package/services/ListDeployedEnvironmentsService/index.d.ts +1 -0
  411. package/services/ListDeployedEnvironmentsService/index.js +1 -0
  412. package/services/PulumiExportService/PulumiExportService.d.ts +16 -0
  413. package/services/PulumiExportService/PulumiExportService.js +54 -0
  414. package/services/PulumiExportService/PulumiExportService.js.map +1 -0
  415. package/services/PulumiExportService/index.d.ts +1 -0
  416. package/services/PulumiExportService/index.js +1 -0
  417. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.d.ts +5 -0
  418. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js +15 -0
  419. package/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js.map +1 -0
  420. package/services/PulumiGetConfigPassphraseService/index.d.ts +1 -0
  421. package/services/PulumiGetConfigPassphraseService/index.js +1 -0
  422. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.d.ts +5 -0
  423. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js +15 -0
  424. package/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js.map +1 -0
  425. package/services/PulumiGetSecretsProviderService/index.d.ts +1 -0
  426. package/services/PulumiGetSecretsProviderService/index.js +1 -0
  427. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.d.ts +16 -0
  428. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js +69 -0
  429. package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js.map +1 -0
  430. package/services/PulumiGetStackOutputService/index.d.ts +1 -0
  431. package/services/PulumiGetStackOutputService/index.js +1 -0
  432. package/services/PulumiGetStackOutputService/mapStackOutput.d.ts +1 -0
  433. package/services/PulumiGetStackOutputService/mapStackOutput.js +22 -0
  434. package/services/PulumiGetStackOutputService/mapStackOutput.js.map +1 -0
  435. package/services/PulumiImportService/PulumiImportService.d.ts +13 -0
  436. package/services/PulumiImportService/PulumiImportService.js +64 -0
  437. package/services/PulumiImportService/PulumiImportService.js.map +1 -0
  438. package/services/PulumiImportService/index.d.ts +1 -0
  439. package/services/PulumiImportService/index.js +1 -0
  440. package/services/PulumiLoginService/PulumiLoginService.d.ts +13 -0
  441. package/services/PulumiLoginService/PulumiLoginService.js +59 -0
  442. package/services/PulumiLoginService/PulumiLoginService.js.map +1 -0
  443. package/services/PulumiLoginService/index.d.ts +1 -0
  444. package/services/PulumiLoginService/index.js +1 -0
  445. package/services/PulumiSelectStackService/PulumiSelectStackService.d.ts +20 -0
  446. package/services/PulumiSelectStackService/PulumiSelectStackService.js +106 -0
  447. package/services/PulumiSelectStackService/PulumiSelectStackService.js.map +1 -0
  448. package/services/PulumiSelectStackService/index.d.ts +1 -0
  449. package/services/PulumiSelectStackService/index.js +1 -0
  450. package/services/StackOutputCacheService/StackOutputCacheService.d.ts +21 -0
  451. package/services/StackOutputCacheService/StackOutputCacheService.js +90 -0
  452. package/services/StackOutputCacheService/StackOutputCacheService.js.map +1 -0
  453. package/services/StackOutputCacheService/index.d.ts +1 -0
  454. package/services/StackOutputCacheService/index.js +1 -0
  455. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.d.ts +14 -0
  456. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js +55 -0
  457. package/services/WatchedLambdaFunctionsService/WatchedLambdaFunctionsService.js.map +1 -0
  458. package/services/WatchedLambdaFunctionsService/index.d.ts +1 -0
  459. package/services/WatchedLambdaFunctionsService/index.js +1 -0
  460. package/utils/withPulumiConfigPassphrase.d.ts +1 -0
  461. package/utils/withPulumiConfigPassphrase.js +7 -0
  462. package/utils/withPulumiConfigPassphrase.js.map +1 -0
  463. package/abstractions/ApiGqlClient.d.ts +0 -23
  464. package/abstractions/ApiGqlClient.js +0 -5
  465. package/abstractions/ApiGqlClient.js.map +0 -1
  466. package/abstractions/InvokeLambdaFunction.d.ts +0 -18
  467. package/abstractions/InvokeLambdaFunction.js +0 -5
  468. package/abstractions/InvokeLambdaFunction.js.map +0 -1
  469. package/abstractions/features/pulumi/AdminPulumi.d.ts +0 -9
  470. package/abstractions/features/pulumi/AdminPulumi.js +0 -5
  471. package/abstractions/features/pulumi/AdminPulumi.js.map +0 -1
  472. package/abstractions/features/pulumi/ApiPulumi.d.ts +0 -9
  473. package/abstractions/features/pulumi/ApiPulumi.js +0 -5
  474. package/abstractions/features/pulumi/ApiPulumi.js.map +0 -1
  475. package/abstractions/features/pulumi/CorePulumi.d.ts +0 -9
  476. package/abstractions/features/pulumi/CorePulumi.js +0 -5
  477. package/abstractions/features/pulumi/CorePulumi.js.map +0 -1
  478. package/abstractions/features/pulumi/SetAdminCustomDomains.d.ts +0 -9
  479. package/abstractions/features/pulumi/SetAdminCustomDomains.js +0 -5
  480. package/abstractions/features/pulumi/SetAdminCustomDomains.js.map +0 -1
  481. package/abstractions/features/pulumi/SetApiCustomDomains.d.ts +0 -9
  482. package/abstractions/features/pulumi/SetApiCustomDomains.js +0 -5
  483. package/abstractions/features/pulumi/SetApiCustomDomains.js.map +0 -1
  484. package/abstractions/features/pulumi/index.d.ts +0 -5
  485. package/abstractions/features/pulumi/index.js +0 -5
  486. package/abstractions/services/AdminStackOutputService.d.ts +0 -13
  487. package/abstractions/services/AdminStackOutputService.js +0 -5
  488. package/abstractions/services/AdminStackOutputService.js.map +0 -1
  489. package/abstractions/services/ApiStackOutputService.d.ts +0 -29
  490. package/abstractions/services/ApiStackOutputService.js +0 -5
  491. package/abstractions/services/ApiStackOutputService.js.map +0 -1
  492. package/abstractions/services/CoreStackOutputService.d.ts +0 -16
  493. package/abstractions/services/CoreStackOutputService.js +0 -5
  494. package/abstractions/services/CoreStackOutputService.js.map +0 -1
  495. package/exports/extensions.d.ts +0 -5
  496. package/exports/extensions.js +0 -5
  497. package/exports/infra.d.ts +0 -1
  498. package/exports/infra.js +0 -1
  499. package/extensions/AwsDefaultRegion.d.ts +0 -4
  500. package/extensions/AwsDefaultRegion.js +0 -23
  501. package/extensions/AwsDefaultRegion.js.map +0 -1
  502. package/extensions/BackgroundTasks.d.ts +0 -4
  503. package/extensions/BackgroundTasks.js +0 -24
  504. package/extensions/BackgroundTasks.js.map +0 -1
  505. package/extensions/Cms/ModelFieldCompression.d.ts +0 -4
  506. package/extensions/Cms/ModelFieldCompression.js +0 -24
  507. package/extensions/Cms/ModelFieldCompression.js.map +0 -1
  508. package/extensions/Mailer/Smtp.d.ts +0 -8
  509. package/extensions/Mailer/Smtp.js +0 -21
  510. package/extensions/Mailer/Smtp.js.map +0 -1
  511. package/extensions/Mailer/Smtp.test.js +0 -127
  512. package/extensions/Mailer/Smtp.test.js.map +0 -1
  513. package/extensions/Mailer/SmtpParamsSchema.d.ts +0 -9
  514. package/extensions/Mailer/SmtpParamsSchema.js +0 -17
  515. package/extensions/Mailer/SmtpParamsSchema.js.map +0 -1
  516. package/extensions/ProjectAws/AutoInstall.d.ts +0 -9
  517. package/extensions/ProjectAws/AutoInstall.js +0 -20
  518. package/extensions/ProjectAws/AutoInstall.js.map +0 -1
  519. package/extensions/routePath.d.ts +0 -20
  520. package/extensions/routePath.js +0 -13
  521. package/extensions/routePath.js.map +0 -1
  522. package/pulumi/extensions/AdminCustomDomains.d.ts +0 -9
  523. package/pulumi/extensions/AdminCustomDomains.js +0 -20
  524. package/pulumi/extensions/AdminCustomDomains.js.map +0 -1
  525. package/pulumi/extensions/ApiCustomDomains.d.ts +0 -9
  526. package/pulumi/extensions/ApiCustomDomains.js +0 -20
  527. package/pulumi/extensions/ApiCustomDomains.js.map +0 -1
  528. package/pulumi/extensions/AwsTags.d.ts +0 -4
  529. package/pulumi/extensions/AwsTags.js +0 -16
  530. package/pulumi/extensions/AwsTags.js.map +0 -1
  531. package/pulumi/extensions/BlueGreenDeployments.d.ts +0 -34
  532. package/pulumi/extensions/BlueGreenDeployments.js +0 -38
  533. package/pulumi/extensions/BlueGreenDeployments.js.map +0 -1
  534. package/pulumi/extensions/OpenSearch.d.ts +0 -10
  535. package/pulumi/extensions/OpenSearch.js +0 -21
  536. package/pulumi/extensions/OpenSearch.js.map +0 -1
  537. package/pulumi/extensions/Vpc.d.ts +0 -15
  538. package/pulumi/extensions/Vpc.js +0 -26
  539. package/pulumi/extensions/Vpc.js.map +0 -1
  540. /package/extensions/{Mailer/Smtp.test.d.ts → registerExtensionImplementations.d.ts} +0 -0
@@ -0,0 +1,16 @@
1
+ import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
2
+ import { LoggerService } from "@webiny/project/abstractions/index.js";
3
+ import { PulumiExportService } from "../../abstractions/services/PulumiExportService.js";
4
+ import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
5
+ import { type IAppModel } from "@webiny/project/abstractions/models/index.js";
6
+ export declare class DefaultPulumiExportService implements PulumiExportService.Interface {
7
+ private getPulumiService;
8
+ private pulumiSelectStackService;
9
+ private loggerService;
10
+ constructor(getPulumiService: GetPulumiService.Interface, pulumiSelectStackService: PulumiSelectStackService.Interface, loggerService: LoggerService.Interface);
11
+ execute(app: IAppModel): Promise<any>;
12
+ }
13
+ export declare const pulumiExportService: import("@webiny/di").Implementation<typeof DefaultPulumiExportService>;
14
+ /** @deprecated Use pulumiExportService instead */
15
+ export declare const pulumiGetStackExportService: import("@webiny/di").Implementation<typeof DefaultPulumiExportService>;
16
+ export declare const DefaultPulumiGetStackExportService: typeof DefaultPulumiExportService;
@@ -0,0 +1,54 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
3
+ import { LoggerService } from "@webiny/project/abstractions/index.js";
4
+ import { PulumiExportService } from "../../abstractions/services/PulumiExportService.js";
5
+ import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
6
+ import { createEnvConfiguration } from "@webiny/project/utils/env/index.js";
7
+ import { withPulumiConfigPassphrase } from "../../utils/withPulumiConfigPassphrase.js";
8
+ class DefaultPulumiExportService {
9
+ constructor(getPulumiService, pulumiSelectStackService, loggerService){
10
+ this.getPulumiService = getPulumiService;
11
+ this.pulumiSelectStackService = pulumiSelectStackService;
12
+ this.loggerService = loggerService;
13
+ }
14
+ async execute(app) {
15
+ const pulumi = await this.getPulumiService.execute({
16
+ app
17
+ });
18
+ await this.pulumiSelectStackService.execute(app);
19
+ const stackOutputString = await pulumi.run({
20
+ command: [
21
+ "stack",
22
+ "export"
23
+ ],
24
+ args: {},
25
+ execa: {
26
+ env: createEnvConfiguration({
27
+ configurations: [
28
+ withPulumiConfigPassphrase()
29
+ ]
30
+ })
31
+ }
32
+ });
33
+ try {
34
+ return JSON.parse(stackOutputString.stdout);
35
+ } catch {
36
+ this.loggerService.error("Could not parse stack export as JSON.", stackOutputString.stdout, app);
37
+ return null;
38
+ }
39
+ }
40
+ }
41
+ const pulumiExportService = createImplementation({
42
+ abstraction: PulumiExportService,
43
+ implementation: DefaultPulumiExportService,
44
+ dependencies: [
45
+ GetPulumiService,
46
+ PulumiSelectStackService,
47
+ LoggerService
48
+ ]
49
+ });
50
+ const pulumiGetStackExportService = pulumiExportService;
51
+ const DefaultPulumiGetStackExportService = DefaultPulumiExportService;
52
+ export { DefaultPulumiExportService, DefaultPulumiGetStackExportService, pulumiExportService, pulumiGetStackExportService };
53
+
54
+ //# sourceMappingURL=PulumiExportService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services/PulumiExportService/PulumiExportService.js","sources":["../../../src/services/PulumiExportService/PulumiExportService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetPulumiService } from \"~/abstractions/services/GetPulumiService.js\";\nimport { LoggerService } from \"@webiny/project/abstractions/index.js\";\nimport { PulumiExportService } from \"~/abstractions/services/PulumiExportService.js\";\nimport { PulumiSelectStackService } from \"~/abstractions/services/PulumiSelectStackService.js\";\nimport { type IAppModel } from \"@webiny/project/abstractions/models/index.js\";\nimport { createEnvConfiguration } from \"@webiny/project/utils/env/index.js\";\nimport { withPulumiConfigPassphrase } from \"~/utils/withPulumiConfigPassphrase.js\";\n\nexport class DefaultPulumiExportService implements PulumiExportService.Interface {\n constructor(\n private getPulumiService: GetPulumiService.Interface,\n private pulumiSelectStackService: PulumiSelectStackService.Interface,\n private loggerService: LoggerService.Interface\n ) {}\n\n async execute(app: IAppModel) {\n const pulumi = await this.getPulumiService.execute({ app });\n\n await this.pulumiSelectStackService.execute(app);\n\n const stackOutputString = await pulumi.run({\n command: [\"stack\", \"export\"],\n args: {},\n execa: {\n env: createEnvConfiguration({\n configurations: [withPulumiConfigPassphrase()]\n })\n }\n });\n\n try {\n return JSON.parse(stackOutputString.stdout as string);\n } catch {\n this.loggerService.error(\n \"Could not parse stack export as JSON.\",\n stackOutputString.stdout,\n app\n );\n return null;\n }\n }\n}\n\nexport const pulumiExportService = createImplementation({\n abstraction: PulumiExportService,\n implementation: DefaultPulumiExportService,\n dependencies: [GetPulumiService, PulumiSelectStackService, LoggerService]\n});\n\n// Backwards compatibility\n/** @deprecated Use pulumiExportService instead */\nexport const pulumiGetStackExportService = pulumiExportService;\nexport const DefaultPulumiGetStackExportService = DefaultPulumiExportService;\n"],"names":["DefaultPulumiExportService","getPulumiService","pulumiSelectStackService","loggerService","app","pulumi","stackOutputString","createEnvConfiguration","withPulumiConfigPassphrase","JSON","pulumiExportService","createImplementation","PulumiExportService","GetPulumiService","PulumiSelectStackService","LoggerService","pulumiGetStackExportService","DefaultPulumiGetStackExportService"],"mappings":";;;;;;;AASO,MAAMA;IACT,YACYC,gBAA4C,EAC5CC,wBAA4D,EAC5DC,aAAsC,CAChD;aAHUF,gBAAgB,GAAhBA;aACAC,wBAAwB,GAAxBA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,QAAQC,GAAc,EAAE;QAC1B,MAAMC,SAAS,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAED;QAAI;QAEzD,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAACA;QAE5C,MAAME,oBAAoB,MAAMD,OAAO,GAAG,CAAC;YACvC,SAAS;gBAAC;gBAAS;aAAS;YAC5B,MAAM,CAAC;YACP,OAAO;gBACH,KAAKE,uBAAuB;oBACxB,gBAAgB;wBAACC;qBAA6B;gBAClD;YACJ;QACJ;QAEA,IAAI;YACA,OAAOC,KAAK,KAAK,CAACH,kBAAkB,MAAM;QAC9C,EAAE,OAAM;YACJ,IAAI,CAAC,aAAa,CAAC,KAAK,CACpB,yCACAA,kBAAkB,MAAM,EACxBF;YAEJ,OAAO;QACX;IACJ;AACJ;AAEO,MAAMM,sBAAsBC,qBAAqB;IACpD,aAAaC;IACb,gBAAgBZ;IAChB,cAAc;QAACa;QAAkBC;QAA0BC;KAAc;AAC7E;AAIO,MAAMC,8BAA8BN;AACpC,MAAMO,qCAAqCjB"}
@@ -0,0 +1 @@
1
+ export * from "./PulumiExportService.js";
@@ -0,0 +1 @@
1
+ export * from "./PulumiExportService.js";
@@ -0,0 +1,5 @@
1
+ import { PulumiGetConfigPassphraseService } from "../../abstractions/services/PulumiGetConfigPassphraseService.js";
2
+ export declare class DefaultPulumiGetConfigPassphraseService implements PulumiGetConfigPassphraseService.Interface {
3
+ execute(): string;
4
+ }
5
+ export declare const pulumiGetConfigPassphraseService: import("@webiny/di").Implementation<typeof DefaultPulumiGetConfigPassphraseService>;
@@ -0,0 +1,15 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { PulumiGetConfigPassphraseService } from "../../abstractions/services/PulumiGetConfigPassphraseService.js";
3
+ class DefaultPulumiGetConfigPassphraseService {
4
+ execute() {
5
+ return process.env.PULUMI_CONFIG_PASSPHRASE || "webiny";
6
+ }
7
+ }
8
+ const pulumiGetConfigPassphraseService = createImplementation({
9
+ abstraction: PulumiGetConfigPassphraseService,
10
+ implementation: DefaultPulumiGetConfigPassphraseService,
11
+ dependencies: []
12
+ });
13
+ export { DefaultPulumiGetConfigPassphraseService, pulumiGetConfigPassphraseService };
14
+
15
+ //# sourceMappingURL=PulumiGetConfigPassphraseService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.js","sources":["../../../src/services/PulumiGetConfigPassphraseService/PulumiGetConfigPassphraseService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { PulumiGetConfigPassphraseService } from \"~/abstractions/services/PulumiGetConfigPassphraseService.js\";\n\nexport class DefaultPulumiGetConfigPassphraseService\n implements PulumiGetConfigPassphraseService.Interface\n{\n execute() {\n return process.env.PULUMI_CONFIG_PASSPHRASE || \"webiny\";\n }\n}\n\nexport const pulumiGetConfigPassphraseService = createImplementation({\n abstraction: PulumiGetConfigPassphraseService,\n implementation: DefaultPulumiGetConfigPassphraseService,\n dependencies: []\n});\n"],"names":["DefaultPulumiGetConfigPassphraseService","process","pulumiGetConfigPassphraseService","createImplementation","PulumiGetConfigPassphraseService"],"mappings":";;AAGO,MAAMA;IAGT,UAAU;QACN,OAAOC,QAAQ,GAAG,CAAC,wBAAwB,IAAI;IACnD;AACJ;AAEO,MAAMC,mCAAmCC,qBAAqB;IACjE,aAAaC;IACb,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1 @@
1
+ export * from "./PulumiGetConfigPassphraseService.js";
@@ -0,0 +1 @@
1
+ export * from "./PulumiGetConfigPassphraseService.js";
@@ -0,0 +1,5 @@
1
+ import { PulumiGetSecretsProviderService } from "../../abstractions/services/PulumiGetSecretsProviderService.js";
2
+ export declare class DefaultPulumiGetSecretsProviderService implements PulumiGetSecretsProviderService.Interface {
3
+ execute(): string;
4
+ }
5
+ export declare const pulumiGetSecretsProviderService: import("@webiny/di").Implementation<typeof DefaultPulumiGetSecretsProviderService>;
@@ -0,0 +1,15 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { PulumiGetSecretsProviderService } from "../../abstractions/services/PulumiGetSecretsProviderService.js";
3
+ class DefaultPulumiGetSecretsProviderService {
4
+ execute() {
5
+ return process.env.PULUMI_SECRETS_PROVIDER || "passphrase";
6
+ }
7
+ }
8
+ const pulumiGetSecretsProviderService = createImplementation({
9
+ abstraction: PulumiGetSecretsProviderService,
10
+ implementation: DefaultPulumiGetSecretsProviderService,
11
+ dependencies: []
12
+ });
13
+ export { DefaultPulumiGetSecretsProviderService, pulumiGetSecretsProviderService };
14
+
15
+ //# sourceMappingURL=PulumiGetSecretsProviderService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.js","sources":["../../../src/services/PulumiGetSecretsProviderService/PulumiGetSecretsProviderService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { PulumiGetSecretsProviderService } from \"~/abstractions/services/PulumiGetSecretsProviderService.js\";\n\nexport class DefaultPulumiGetSecretsProviderService\n implements PulumiGetSecretsProviderService.Interface\n{\n execute() {\n return process.env.PULUMI_SECRETS_PROVIDER || \"passphrase\";\n }\n}\n\nexport const pulumiGetSecretsProviderService = createImplementation({\n abstraction: PulumiGetSecretsProviderService,\n implementation: DefaultPulumiGetSecretsProviderService,\n dependencies: []\n});\n"],"names":["DefaultPulumiGetSecretsProviderService","process","pulumiGetSecretsProviderService","createImplementation","PulumiGetSecretsProviderService"],"mappings":";;AAGO,MAAMA;IAGT,UAAU;QACN,OAAOC,QAAQ,GAAG,CAAC,uBAAuB,IAAI;IAClD;AACJ;AAEO,MAAMC,kCAAkCC,qBAAqB;IAChE,aAAaC;IACb,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1 @@
1
+ export * from "./PulumiGetSecretsProviderService.js";
@@ -0,0 +1 @@
1
+ export * from "./PulumiGetSecretsProviderService.js";
@@ -0,0 +1,16 @@
1
+ import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
2
+ import { LoggerService } from "@webiny/project/abstractions/index.js";
3
+ import { PulumiGetStackOutputService } from "../../abstractions/services/PulumiGetStackOutputService.js";
4
+ import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
5
+ import { StackOutputCacheService } from "../../abstractions/services/StackOutputCacheService.js";
6
+ import { type IAppModel } from "@webiny/project/abstractions/models/index.js";
7
+ export declare class DefaultPulumiGetStackOutputService implements PulumiGetStackOutputService.Interface {
8
+ private getPulumiService;
9
+ private pulumiSelectStackService;
10
+ private loggerService;
11
+ private stackOutputCacheService;
12
+ constructor(getPulumiService: GetPulumiService.Interface, pulumiSelectStackService: PulumiSelectStackService.Interface, loggerService: LoggerService.Interface, stackOutputCacheService: StackOutputCacheService.Interface);
13
+ execute<TOutput extends Record<string, any> = Record<string, any>>(app: IAppModel, params?: PulumiGetStackOutputService.Params): Promise<TOutput | null>;
14
+ private applyMapping;
15
+ }
16
+ export declare const pulumiGetStackOutputService: import("@webiny/di").Implementation<typeof DefaultPulumiGetStackOutputService>;
@@ -0,0 +1,69 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
3
+ import { LoggerService } from "@webiny/project/abstractions/index.js";
4
+ import { PulumiGetStackOutputService } from "../../abstractions/services/PulumiGetStackOutputService.js";
5
+ import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
6
+ import { StackOutputCacheService } from "../../abstractions/services/StackOutputCacheService.js";
7
+ import { createEnvConfiguration } from "@webiny/project/utils/env/index.js";
8
+ import { withPulumiConfigPassphrase } from "../../utils/withPulumiConfigPassphrase.js";
9
+ import { mapStackOutput } from "./mapStackOutput.js";
10
+ class DefaultPulumiGetStackOutputService {
11
+ constructor(getPulumiService, pulumiSelectStackService, loggerService, stackOutputCacheService){
12
+ this.getPulumiService = getPulumiService;
13
+ this.pulumiSelectStackService = pulumiSelectStackService;
14
+ this.loggerService = loggerService;
15
+ this.stackOutputCacheService = stackOutputCacheService;
16
+ }
17
+ async execute(app, params) {
18
+ if (!params?.skipCache) {
19
+ const cachedOutput = await this.stackOutputCacheService.read(app);
20
+ if (null !== cachedOutput) return this.applyMapping(cachedOutput, params?.map);
21
+ }
22
+ const pulumi = await this.getPulumiService.execute({
23
+ app
24
+ });
25
+ await this.pulumiSelectStackService.execute(app);
26
+ const stackOutputString = await pulumi.run({
27
+ command: [
28
+ "stack",
29
+ "output"
30
+ ],
31
+ args: {
32
+ json: true
33
+ },
34
+ execa: {
35
+ env: createEnvConfiguration({
36
+ configurations: [
37
+ withPulumiConfigPassphrase()
38
+ ]
39
+ })
40
+ }
41
+ });
42
+ try {
43
+ const stackOutputJson = JSON.parse(stackOutputString.stdout);
44
+ if (!stackOutputJson) return null;
45
+ await this.stackOutputCacheService.write(app, stackOutputJson);
46
+ return this.applyMapping(stackOutputJson, params?.map);
47
+ } catch {
48
+ this.loggerService.error("Could not parse stack output as JSON.", stackOutputString.stdout, app, params);
49
+ return null;
50
+ }
51
+ }
52
+ applyMapping(data, map) {
53
+ if (!map) return data;
54
+ return mapStackOutput(data, map);
55
+ }
56
+ }
57
+ const pulumiGetStackOutputService = createImplementation({
58
+ abstraction: PulumiGetStackOutputService,
59
+ implementation: DefaultPulumiGetStackOutputService,
60
+ dependencies: [
61
+ GetPulumiService,
62
+ PulumiSelectStackService,
63
+ LoggerService,
64
+ StackOutputCacheService
65
+ ]
66
+ });
67
+ export { DefaultPulumiGetStackOutputService, pulumiGetStackOutputService };
68
+
69
+ //# sourceMappingURL=PulumiGetStackOutputService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services/PulumiGetStackOutputService/PulumiGetStackOutputService.js","sources":["../../../src/services/PulumiGetStackOutputService/PulumiGetStackOutputService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetPulumiService } from \"~/abstractions/services/GetPulumiService.js\";\nimport { LoggerService } from \"@webiny/project/abstractions/index.js\";\nimport { PulumiGetStackOutputService } from \"~/abstractions/services/PulumiGetStackOutputService.js\";\nimport { PulumiSelectStackService } from \"~/abstractions/services/PulumiSelectStackService.js\";\nimport { StackOutputCacheService } from \"~/abstractions/services/StackOutputCacheService.js\";\nimport { type IAppModel } from \"@webiny/project/abstractions/models/index.js\";\nimport { createEnvConfiguration } from \"@webiny/project/utils/env/index.js\";\nimport { withPulumiConfigPassphrase } from \"~/utils/withPulumiConfigPassphrase.js\";\nimport { mapStackOutput } from \"./mapStackOutput.js\";\n\nexport class DefaultPulumiGetStackOutputService implements PulumiGetStackOutputService.Interface {\n constructor(\n private getPulumiService: GetPulumiService.Interface,\n private pulumiSelectStackService: PulumiSelectStackService.Interface,\n private loggerService: LoggerService.Interface,\n private stackOutputCacheService: StackOutputCacheService.Interface\n ) {}\n\n async execute<TOutput extends Record<string, any> = Record<string, any>>(\n app: IAppModel,\n params?: PulumiGetStackOutputService.Params\n ): Promise<TOutput | null> {\n // Try to read from cache if skipCache is not true\n if (!params?.skipCache) {\n const cachedOutput = await this.stackOutputCacheService.read(app);\n if (cachedOutput !== null) {\n return this.applyMapping(cachedOutput, params?.map) as TOutput;\n }\n }\n\n const pulumi = await this.getPulumiService.execute({ app });\n\n await this.pulumiSelectStackService.execute(app);\n\n const stackOutputString = await pulumi.run({\n command: [\"stack\", \"output\"],\n args: {\n json: true\n },\n execa: {\n env: createEnvConfiguration({\n configurations: [withPulumiConfigPassphrase()]\n })\n }\n });\n\n try {\n const stackOutputJson = JSON.parse(stackOutputString.stdout as string);\n if (!stackOutputJson) {\n return null;\n }\n\n await this.stackOutputCacheService.write(app, stackOutputJson);\n\n return this.applyMapping(stackOutputJson, params?.map) as TOutput;\n } catch {\n this.loggerService.error(\n \"Could not parse stack output as JSON.\",\n stackOutputString.stdout,\n app,\n params\n );\n return null;\n }\n }\n\n private applyMapping(\n data: Record<string, any>,\n map?: Record<string, any>\n ): Record<string, any> {\n if (!map) {\n return data;\n }\n // If a mapping is provided, we map the output to the specified structure.\n return mapStackOutput(data, map);\n }\n}\n\nexport const pulumiGetStackOutputService = createImplementation({\n abstraction: PulumiGetStackOutputService,\n implementation: DefaultPulumiGetStackOutputService,\n dependencies: [\n GetPulumiService,\n PulumiSelectStackService,\n LoggerService,\n StackOutputCacheService\n ]\n});\n"],"names":["DefaultPulumiGetStackOutputService","getPulumiService","pulumiSelectStackService","loggerService","stackOutputCacheService","app","params","cachedOutput","pulumi","stackOutputString","createEnvConfiguration","withPulumiConfigPassphrase","stackOutputJson","JSON","data","map","mapStackOutput","pulumiGetStackOutputService","createImplementation","PulumiGetStackOutputService","GetPulumiService","PulumiSelectStackService","LoggerService","StackOutputCacheService"],"mappings":";;;;;;;;;AAWO,MAAMA;IACT,YACYC,gBAA4C,EAC5CC,wBAA4D,EAC5DC,aAAsC,EACtCC,uBAA0D,CACpE;aAJUH,gBAAgB,GAAhBA;aACAC,wBAAwB,GAAxBA;aACAC,aAAa,GAAbA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,QACFC,GAAc,EACdC,MAA2C,EACpB;QAEvB,IAAI,CAACA,QAAQ,WAAW;YACpB,MAAMC,eAAe,MAAM,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAACF;YAC7D,IAAIE,AAAiB,SAAjBA,cACA,OAAO,IAAI,CAAC,YAAY,CAACA,cAAcD,QAAQ;QAEvD;QAEA,MAAME,SAAS,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAEH;QAAI;QAEzD,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAACA;QAE5C,MAAMI,oBAAoB,MAAMD,OAAO,GAAG,CAAC;YACvC,SAAS;gBAAC;gBAAS;aAAS;YAC5B,MAAM;gBACF,MAAM;YACV;YACA,OAAO;gBACH,KAAKE,uBAAuB;oBACxB,gBAAgB;wBAACC;qBAA6B;gBAClD;YACJ;QACJ;QAEA,IAAI;YACA,MAAMC,kBAAkBC,KAAK,KAAK,CAACJ,kBAAkB,MAAM;YAC3D,IAAI,CAACG,iBACD,OAAO;YAGX,MAAM,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAACP,KAAKO;YAE9C,OAAO,IAAI,CAAC,YAAY,CAACA,iBAAiBN,QAAQ;QACtD,EAAE,OAAM;YACJ,IAAI,CAAC,aAAa,CAAC,KAAK,CACpB,yCACAG,kBAAkB,MAAM,EACxBJ,KACAC;YAEJ,OAAO;QACX;IACJ;IAEQ,aACJQ,IAAyB,EACzBC,GAAyB,EACN;QACnB,IAAI,CAACA,KACD,OAAOD;QAGX,OAAOE,eAAeF,MAAMC;IAChC;AACJ;AAEO,MAAME,8BAA8BC,qBAAqB;IAC5D,aAAaC;IACb,gBAAgBnB;IAChB,cAAc;QACVoB;QACAC;QACAC;QACAC;KACH;AACL"}
@@ -0,0 +1 @@
1
+ export * from "./PulumiGetStackOutputService.js";
@@ -0,0 +1 @@
1
+ export * from "./PulumiGetStackOutputService.js";
@@ -0,0 +1 @@
1
+ export declare const mapStackOutput: <T extends Record<string, any> = Record<string, any>>(output: Record<string, any>, map: Record<string, any>) => T;
@@ -0,0 +1,22 @@
1
+ import get from "lodash/get.js";
2
+ import chalk from "chalk";
3
+ const { yellow: yellow } = chalk;
4
+ const mapStackOutput = (output, map)=>{
5
+ const values = {};
6
+ const regex = /\${(.*)}/;
7
+ Object.keys(map).forEach((key)=>{
8
+ const valuePattern = map[key];
9
+ const match = regex.exec(valuePattern);
10
+ if (match) {
11
+ const [replace, valuePath] = match;
12
+ const value = get(output, valuePath);
13
+ if (!value) return void console.log(yellow(`Could not map "${valuePath}" to "${key}" - value missing.`));
14
+ if ("object" == typeof value && null !== value) values[key] = valuePattern.replace(replace, JSON.stringify(value));
15
+ else values[key] = valuePattern.replace(replace, value);
16
+ }
17
+ });
18
+ return values;
19
+ };
20
+ export { mapStackOutput };
21
+
22
+ //# sourceMappingURL=mapStackOutput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services/PulumiGetStackOutputService/mapStackOutput.js","sources":["../../../src/services/PulumiGetStackOutputService/mapStackOutput.ts"],"sourcesContent":["import get from \"lodash/get.js\";\nimport chalk from \"chalk\";\n\nconst { yellow } = chalk;\n\nexport const mapStackOutput = <T extends Record<string, any> = Record<string, any>>(\n output: Record<string, any>,\n map: Record<string, any>\n): T => {\n const values: T = {} as T;\n const regex = /\\${(.*)}/;\n\n Object.keys(map).forEach(key => {\n const valuePattern = map[key];\n const match = regex.exec(valuePattern);\n if (match) {\n const [replace, valuePath] = match;\n const value = get(output, valuePath);\n if (!value) {\n console.log(yellow(`Could not map \"${valuePath}\" to \"${key}\" - value missing.`));\n return;\n }\n /**\n * It is ok to expect error here.\n */\n if (typeof value === \"object\" && value !== null) {\n // @ts-expect-error\n values[key] = valuePattern.replace(replace, JSON.stringify(value));\n } else {\n // @ts-expect-error\n values[key] = valuePattern.replace(replace, value);\n }\n }\n });\n\n return values;\n};\n"],"names":["yellow","chalk","mapStackOutput","output","map","values","regex","Object","key","valuePattern","match","replace","valuePath","value","get","console","JSON"],"mappings":";;AAGA,MAAM,EAAEA,QAAAA,MAAM,EAAE,GAAGC;AAEZ,MAAMC,iBAAiB,CAC1BC,QACAC;IAEA,MAAMC,SAAY,CAAC;IACnB,MAAMC,QAAQ;IAEdC,OAAO,IAAI,CAACH,KAAK,OAAO,CAACI,CAAAA;QACrB,MAAMC,eAAeL,GAAG,CAACI,IAAI;QAC7B,MAAME,QAAQJ,MAAM,IAAI,CAACG;QACzB,IAAIC,OAAO;YACP,MAAM,CAACC,SAASC,UAAU,GAAGF;YAC7B,MAAMG,QAAQC,IAAIX,QAAQS;YAC1B,IAAI,CAACC,OAAO,YACRE,QAAQ,GAAG,CAACf,OAAO,CAAC,eAAe,EAAEY,UAAU,MAAM,EAAEJ,IAAI,kBAAkB,CAAC;YAMlF,IAAI,AAAiB,YAAjB,OAAOK,SAAsBA,AAAU,SAAVA,OAE7BR,MAAM,CAACG,IAAI,GAAGC,aAAa,OAAO,CAACE,SAASK,KAAK,SAAS,CAACH;iBAG3DR,MAAM,CAACG,IAAI,GAAGC,aAAa,OAAO,CAACE,SAASE;QAEpD;IACJ;IAEA,OAAOR;AACX"}
@@ -0,0 +1,13 @@
1
+ import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
2
+ import { LoggerService } from "@webiny/project/abstractions/index.js";
3
+ import { PulumiImportService } from "../../abstractions/services/PulumiImportService.js";
4
+ import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
5
+ import { type IAppModel } from "@webiny/project/abstractions/models/index.js";
6
+ export declare class DefaultPulumiImportService implements PulumiImportService.Interface {
7
+ private getPulumiService;
8
+ private pulumiSelectStackService;
9
+ private loggerService;
10
+ constructor(getPulumiService: GetPulumiService.Interface, pulumiSelectStackService: PulumiSelectStackService.Interface, loggerService: LoggerService.Interface);
11
+ execute(app: IAppModel, state: Record<string, any>): Promise<void>;
12
+ }
13
+ export declare const pulumiImportService: import("@webiny/di").Implementation<typeof DefaultPulumiImportService>;
@@ -0,0 +1,64 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import fs from "fs";
3
+ import path from "path";
4
+ import os from "os";
5
+ import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
6
+ import { LoggerService } from "@webiny/project/abstractions/index.js";
7
+ import { PulumiImportService } from "../../abstractions/services/PulumiImportService.js";
8
+ import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
9
+ import { createEnvConfiguration } from "@webiny/project/utils/env/index.js";
10
+ import { withPulumiConfigPassphrase } from "../../utils/withPulumiConfigPassphrase.js";
11
+ class DefaultPulumiImportService {
12
+ constructor(getPulumiService, pulumiSelectStackService, loggerService){
13
+ this.getPulumiService = getPulumiService;
14
+ this.pulumiSelectStackService = pulumiSelectStackService;
15
+ this.loggerService = loggerService;
16
+ }
17
+ async execute(app, state) {
18
+ const pulumi = await this.getPulumiService.execute({
19
+ app
20
+ });
21
+ await this.pulumiSelectStackService.execute(app);
22
+ const tempDir = os.tmpdir();
23
+ const tempFilePath = path.join(tempDir, `pulumi-state-${Date.now()}.json`);
24
+ try {
25
+ const stateJson = JSON.stringify(state, null, 2);
26
+ fs.writeFileSync(tempFilePath, stateJson, "utf-8");
27
+ this.loggerService.debug(`Importing Pulumi state from: ${tempFilePath}`);
28
+ const result = await pulumi.run({
29
+ command: [
30
+ "stack",
31
+ "import"
32
+ ],
33
+ args: {
34
+ file: tempFilePath
35
+ },
36
+ execa: {
37
+ env: createEnvConfiguration({
38
+ configurations: [
39
+ withPulumiConfigPassphrase()
40
+ ]
41
+ })
42
+ }
43
+ });
44
+ this.loggerService.debug("Pulumi import output:", result.stdout);
45
+ fs.unlinkSync(tempFilePath);
46
+ } catch (error) {
47
+ if (fs.existsSync(tempFilePath)) fs.unlinkSync(tempFilePath);
48
+ this.loggerService.error("Failed to import Pulumi stack state.", error, app);
49
+ throw error;
50
+ }
51
+ }
52
+ }
53
+ const pulumiImportService = createImplementation({
54
+ abstraction: PulumiImportService,
55
+ implementation: DefaultPulumiImportService,
56
+ dependencies: [
57
+ GetPulumiService,
58
+ PulumiSelectStackService,
59
+ LoggerService
60
+ ]
61
+ });
62
+ export { DefaultPulumiImportService, pulumiImportService };
63
+
64
+ //# sourceMappingURL=PulumiImportService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services/PulumiImportService/PulumiImportService.js","sources":["../../../src/services/PulumiImportService/PulumiImportService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport fs from \"fs\";\nimport path from \"path\";\nimport os from \"os\";\nimport { GetPulumiService } from \"~/abstractions/services/GetPulumiService.js\";\nimport { LoggerService } from \"@webiny/project/abstractions/index.js\";\nimport { PulumiImportService } from \"~/abstractions/services/PulumiImportService.js\";\nimport { PulumiSelectStackService } from \"~/abstractions/services/PulumiSelectStackService.js\";\nimport { type IAppModel } from \"@webiny/project/abstractions/models/index.js\";\nimport { createEnvConfiguration } from \"@webiny/project/utils/env/index.js\";\nimport { withPulumiConfigPassphrase } from \"~/utils/withPulumiConfigPassphrase.js\";\n\nexport class DefaultPulumiImportService implements PulumiImportService.Interface {\n constructor(\n private getPulumiService: GetPulumiService.Interface,\n private pulumiSelectStackService: PulumiSelectStackService.Interface,\n private loggerService: LoggerService.Interface\n ) {}\n\n async execute(app: IAppModel, state: Record<string, any>) {\n const pulumi = await this.getPulumiService.execute({ app });\n\n await this.pulumiSelectStackService.execute(app);\n\n // Write state to temporary file (pulumi stack import requires --file flag)\n const tempDir = os.tmpdir();\n const tempFilePath = path.join(tempDir, `pulumi-state-${Date.now()}.json`);\n\n try {\n const stateJson = JSON.stringify(state, null, 2);\n fs.writeFileSync(tempFilePath, stateJson, \"utf-8\");\n\n this.loggerService.debug(`Importing Pulumi state from: ${tempFilePath}`);\n\n const result = await pulumi.run({\n command: [\"stack\", \"import\"],\n args: {\n file: tempFilePath\n },\n execa: {\n env: createEnvConfiguration({\n configurations: [withPulumiConfigPassphrase()]\n })\n }\n });\n\n this.loggerService.debug(\"Pulumi import output:\", result.stdout);\n\n // Clean up temp file\n fs.unlinkSync(tempFilePath);\n } catch (error) {\n // Clean up temp file even on error\n if (fs.existsSync(tempFilePath)) {\n fs.unlinkSync(tempFilePath);\n }\n this.loggerService.error(\"Failed to import Pulumi stack state.\", error, app);\n throw error;\n }\n }\n}\n\nexport const pulumiImportService = createImplementation({\n abstraction: PulumiImportService,\n implementation: DefaultPulumiImportService,\n dependencies: [GetPulumiService, PulumiSelectStackService, LoggerService]\n});\n"],"names":["DefaultPulumiImportService","getPulumiService","pulumiSelectStackService","loggerService","app","state","pulumi","tempDir","os","tempFilePath","path","Date","stateJson","JSON","fs","result","createEnvConfiguration","withPulumiConfigPassphrase","error","pulumiImportService","createImplementation","PulumiImportService","GetPulumiService","PulumiSelectStackService","LoggerService"],"mappings":";;;;;;;;;;AAYO,MAAMA;IACT,YACYC,gBAA4C,EAC5CC,wBAA4D,EAC5DC,aAAsC,CAChD;aAHUF,gBAAgB,GAAhBA;aACAC,wBAAwB,GAAxBA;aACAC,aAAa,GAAbA;IACT;IAEH,MAAM,QAAQC,GAAc,EAAEC,KAA0B,EAAE;QACtD,MAAMC,SAAS,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAEF;QAAI;QAEzD,MAAM,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAACA;QAG5C,MAAMG,UAAUC,GAAG,MAAM;QACzB,MAAMC,eAAeC,KAAK,IAAI,CAACH,SAAS,CAAC,aAAa,EAAEI,KAAK,GAAG,GAAG,KAAK,CAAC;QAEzE,IAAI;YACA,MAAMC,YAAYC,KAAK,SAAS,CAACR,OAAO,MAAM;YAC9CS,GAAG,aAAa,CAACL,cAAcG,WAAW;YAE1C,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,6BAA6B,EAAEH,cAAc;YAEvE,MAAMM,SAAS,MAAMT,OAAO,GAAG,CAAC;gBAC5B,SAAS;oBAAC;oBAAS;iBAAS;gBAC5B,MAAM;oBACF,MAAMG;gBACV;gBACA,OAAO;oBACH,KAAKO,uBAAuB;wBACxB,gBAAgB;4BAACC;yBAA6B;oBAClD;gBACJ;YACJ;YAEA,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,yBAAyBF,OAAO,MAAM;YAG/DD,GAAG,UAAU,CAACL;QAClB,EAAE,OAAOS,OAAO;YAEZ,IAAIJ,GAAG,UAAU,CAACL,eACdK,GAAG,UAAU,CAACL;YAElB,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,wCAAwCS,OAAOd;YACxE,MAAMc;QACV;IACJ;AACJ;AAEO,MAAMC,sBAAsBC,qBAAqB;IACpD,aAAaC;IACb,gBAAgBrB;IAChB,cAAc;QAACsB;QAAkBC;QAA0BC;KAAc;AAC7E"}
@@ -0,0 +1 @@
1
+ export * from "./PulumiImportService.js";
@@ -0,0 +1 @@
1
+ export * from "./PulumiImportService.js";
@@ -0,0 +1,13 @@
1
+ import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
2
+ import { PulumiLoginService } from "../../abstractions/services/PulumiLoginService.js";
3
+ import { GetProjectService } from "@webiny/project/abstractions/index.js";
4
+ import { type IAppModel } from "@webiny/project/abstractions/models/index.js";
5
+ export declare class DefaultPulumiLoginService implements PulumiLoginService.Interface {
6
+ private getPulumiService;
7
+ private getProjectService;
8
+ constructor(getPulumiService: GetPulumiService.Interface, getProjectService: GetProjectService.Interface);
9
+ execute(app: IAppModel): Promise<{
10
+ login: string;
11
+ }>;
12
+ }
13
+ export declare const pulumiLoginService: import("@webiny/di").Implementation<typeof DefaultPulumiLoginService>;
@@ -0,0 +1,59 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
3
+ import { PulumiLoginService } from "../../abstractions/services/PulumiLoginService.js";
4
+ import { GetProjectService } from "@webiny/project/abstractions/index.js";
5
+ import trimEnd from "lodash/trimEnd.js";
6
+ import fs from "fs";
7
+ import path from "path";
8
+ const SELF_MANAGED_BACKEND = [
9
+ "s3://",
10
+ "azblob://",
11
+ "gs://"
12
+ ];
13
+ class DefaultPulumiLoginService {
14
+ constructor(getPulumiService, getProjectService){
15
+ this.getPulumiService = getPulumiService;
16
+ this.getProjectService = getProjectService;
17
+ }
18
+ async execute(app) {
19
+ const pulumi = await this.getPulumiService.execute({
20
+ app
21
+ });
22
+ const projectAppRelativePath = path.join("apps", app.name);
23
+ let loginUrl = process.env.WEBINY_CLI_PULUMI_BACKEND || process.env.WEBINY_PULUMI_BACKEND;
24
+ if (loginUrl) {
25
+ const selfManagedBackend = SELF_MANAGED_BACKEND.find((item)=>loginUrl.startsWith(item));
26
+ if (selfManagedBackend) {
27
+ loginUrl = trimEnd(loginUrl, "/") + "/" + projectAppRelativePath;
28
+ loginUrl = loginUrl.replace(/\\/g, "/");
29
+ }
30
+ } else {
31
+ const project = this.getProjectService.execute();
32
+ const stateFilesFolder = project.paths.rootFolder.join(".pulumi", projectAppRelativePath).toString();
33
+ if (!fs.existsSync(stateFilesFolder)) fs.mkdirSync(stateFilesFolder, {
34
+ recursive: true
35
+ });
36
+ loginUrl = `file://${stateFilesFolder}`;
37
+ }
38
+ await pulumi.run({
39
+ command: [
40
+ "login",
41
+ loginUrl
42
+ ]
43
+ });
44
+ return {
45
+ login: loginUrl
46
+ };
47
+ }
48
+ }
49
+ const pulumiLoginService = createImplementation({
50
+ abstraction: PulumiLoginService,
51
+ implementation: DefaultPulumiLoginService,
52
+ dependencies: [
53
+ GetPulumiService,
54
+ GetProjectService
55
+ ]
56
+ });
57
+ export { DefaultPulumiLoginService, pulumiLoginService };
58
+
59
+ //# sourceMappingURL=PulumiLoginService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services/PulumiLoginService/PulumiLoginService.js","sources":["../../../src/services/PulumiLoginService/PulumiLoginService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetPulumiService } from \"~/abstractions/services/GetPulumiService.js\";\nimport { PulumiLoginService } from \"~/abstractions/services/PulumiLoginService.js\";\nimport { GetProjectService } from \"@webiny/project/abstractions/index.js\";\nimport { type IAppModel } from \"@webiny/project/abstractions/models/index.js\";\nimport trimEnd from \"lodash/trimEnd.js\";\nimport fs from \"fs\";\nimport path from \"path\";\n\nconst SELF_MANAGED_BACKEND = [\"s3://\", \"azblob://\", \"gs://\"];\n\nexport class DefaultPulumiLoginService implements PulumiLoginService.Interface {\n constructor(\n private getPulumiService: GetPulumiService.Interface,\n private getProjectService: GetProjectService.Interface\n ) {}\n\n async execute(app: IAppModel) {\n const pulumi = await this.getPulumiService.execute({ app });\n\n const projectAppRelativePath = path.join(\"apps\", app.name);\n\n // `WEBINY_CLI_PULUMI_BACKEND` is the canonical variable. We still read the legacy\n // `WEBINY_PULUMI_BACKEND` as a fallback, to preserve backwards compatibility.\n let loginUrl = process.env.WEBINY_CLI_PULUMI_BACKEND || process.env.WEBINY_PULUMI_BACKEND;\n\n if (loginUrl) {\n // If the user passed `s3://my-bucket`, we want to store files in `s3://my-bucket/{project-application-path}`\n const selfManagedBackend = SELF_MANAGED_BACKEND.find(item =>\n loginUrl!.startsWith(item)\n );\n if (selfManagedBackend) {\n loginUrl = trimEnd(loginUrl, \"/\") + \"/\" + projectAppRelativePath;\n loginUrl = loginUrl.replace(/\\\\/g, \"/\");\n }\n } else {\n // By default, we use local file system as backend. All files are stored in project root's\n // `.pulumi` folder, e.g. `.pulumi/apps/admin`.\n const project = this.getProjectService.execute();\n const stateFilesFolder = project.paths.rootFolder\n .join(\".pulumi\", projectAppRelativePath)\n .toString();\n\n if (!fs.existsSync(stateFilesFolder)) {\n fs.mkdirSync(stateFilesFolder, { recursive: true });\n }\n\n loginUrl = `file://${stateFilesFolder}`;\n }\n\n await pulumi.run({ command: [\"login\", loginUrl] });\n\n return { login: loginUrl };\n }\n}\n\nexport const pulumiLoginService = createImplementation({\n abstraction: PulumiLoginService,\n implementation: DefaultPulumiLoginService,\n dependencies: [GetPulumiService, GetProjectService]\n});\n"],"names":["SELF_MANAGED_BACKEND","DefaultPulumiLoginService","getPulumiService","getProjectService","app","pulumi","projectAppRelativePath","path","loginUrl","process","selfManagedBackend","item","trimEnd","project","stateFilesFolder","fs","pulumiLoginService","createImplementation","PulumiLoginService","GetPulumiService","GetProjectService"],"mappings":";;;;;;;AASA,MAAMA,uBAAuB;IAAC;IAAS;IAAa;CAAQ;AAErD,MAAMC;IACT,YACYC,gBAA4C,EAC5CC,iBAA8C,CACxD;aAFUD,gBAAgB,GAAhBA;aACAC,iBAAiB,GAAjBA;IACT;IAEH,MAAM,QAAQC,GAAc,EAAE;QAC1B,MAAMC,SAAS,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAED;QAAI;QAEzD,MAAME,yBAAyBC,KAAK,IAAI,CAAC,QAAQH,IAAI,IAAI;QAIzD,IAAII,WAAWC,QAAQ,GAAG,CAAC,yBAAyB,IAAIA,QAAQ,GAAG,CAAC,qBAAqB;QAEzF,IAAID,UAAU;YAEV,MAAME,qBAAqBV,qBAAqB,IAAI,CAACW,CAAAA,OACjDH,SAAU,UAAU,CAACG;YAEzB,IAAID,oBAAoB;gBACpBF,WAAWI,QAAQJ,UAAU,OAAO,MAAMF;gBAC1CE,WAAWA,SAAS,OAAO,CAAC,OAAO;YACvC;QACJ,OAAO;YAGH,MAAMK,UAAU,IAAI,CAAC,iBAAiB,CAAC,OAAO;YAC9C,MAAMC,mBAAmBD,QAAQ,KAAK,CAAC,UAAU,CAC5C,IAAI,CAAC,WAAWP,wBAChB,QAAQ;YAEb,IAAI,CAACS,GAAG,UAAU,CAACD,mBACfC,GAAG,SAAS,CAACD,kBAAkB;gBAAE,WAAW;YAAK;YAGrDN,WAAW,CAAC,OAAO,EAAEM,kBAAkB;QAC3C;QAEA,MAAMT,OAAO,GAAG,CAAC;YAAE,SAAS;gBAAC;gBAASG;aAAS;QAAC;QAEhD,OAAO;YAAE,OAAOA;QAAS;IAC7B;AACJ;AAEO,MAAMQ,qBAAqBC,qBAAqB;IACnD,aAAaC;IACb,gBAAgBjB;IAChB,cAAc;QAACkB;QAAkBC;KAAkB;AACvD"}
@@ -0,0 +1 @@
1
+ export * from "./PulumiLoginService.js";
@@ -0,0 +1 @@
1
+ export * from "./PulumiLoginService.js";
@@ -0,0 +1,20 @@
1
+ import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
2
+ import { LoggerService } from "@webiny/project/abstractions/index.js";
3
+ import { ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
4
+ import { PulumiGetConfigPassphraseService } from "../../abstractions/services/PulumiGetConfigPassphraseService.js";
5
+ import { PulumiGetSecretsProviderService } from "../../abstractions/services/PulumiGetSecretsProviderService.js";
6
+ import { PulumiLoginService } from "../../abstractions/services/PulumiLoginService.js";
7
+ import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
8
+ import { type IAppModel } from "@webiny/project/abstractions/models/index.js";
9
+ export declare class DefaultPulumiSelectStackService implements PulumiSelectStackService.Interface {
10
+ private getPulumiService;
11
+ private pulumiLoginService;
12
+ private pulumiGetSecretsProviderService;
13
+ private pulumiGetConfigPassphraseService;
14
+ private loggerService;
15
+ private projectSdkParamsService;
16
+ constructor(getPulumiService: GetPulumiService.Interface, pulumiLoginService: PulumiLoginService.Interface, pulumiGetSecretsProviderService: PulumiGetSecretsProviderService.Interface, pulumiGetConfigPassphraseService: PulumiGetConfigPassphraseService.Interface, loggerService: LoggerService.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
17
+ execute(app: IAppModel): Promise<void>;
18
+ private getAppStackOutput;
19
+ }
20
+ export declare const pulumiSelectStackService: import("@webiny/di").Implementation<typeof DefaultPulumiSelectStackService>;
@@ -0,0 +1,106 @@
1
+ import { createImplementation } from "@webiny/di";
2
+ import { GetPulumiService } from "../../abstractions/services/GetPulumiService.js";
3
+ import { LoggerService, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
4
+ import { PulumiGetConfigPassphraseService } from "../../abstractions/services/PulumiGetConfigPassphraseService.js";
5
+ import { PulumiGetSecretsProviderService } from "../../abstractions/services/PulumiGetSecretsProviderService.js";
6
+ import { PulumiLoginService } from "../../abstractions/services/PulumiLoginService.js";
7
+ import { PulumiSelectStackService } from "../../abstractions/services/PulumiSelectStackService.js";
8
+ import { createEnvConfiguration } from "@webiny/project/utils/env/index.js";
9
+ import { withPulumiConfigPassphrase } from "../../utils/withPulumiConfigPassphrase.js";
10
+ import { getStackName } from "@webiny/project/utils/index.js";
11
+ const isCoreAppRegionMismatchCheckNeeded = (app)=>"core" !== app.name && "blueGreen" !== app.name;
12
+ class DefaultPulumiSelectStackService {
13
+ constructor(getPulumiService, pulumiLoginService, pulumiGetSecretsProviderService, pulumiGetConfigPassphraseService, loggerService, projectSdkParamsService){
14
+ this.getPulumiService = getPulumiService;
15
+ this.pulumiLoginService = pulumiLoginService;
16
+ this.pulumiGetSecretsProviderService = pulumiGetSecretsProviderService;
17
+ this.pulumiGetConfigPassphraseService = pulumiGetConfigPassphraseService;
18
+ this.loggerService = loggerService;
19
+ this.projectSdkParamsService = projectSdkParamsService;
20
+ }
21
+ async execute(app) {
22
+ const pulumi = await this.getPulumiService.execute({
23
+ app
24
+ });
25
+ await this.pulumiLoginService.execute(app);
26
+ const secretsProvider = this.pulumiGetSecretsProviderService.execute();
27
+ const configPassphrase = this.pulumiGetConfigPassphraseService.execute();
28
+ const sdkParams = this.projectSdkParamsService.get();
29
+ const stackName = getStackName({
30
+ env: sdkParams.env,
31
+ variant: sdkParams.variant
32
+ });
33
+ await pulumi.run({
34
+ command: [
35
+ "stack",
36
+ "select",
37
+ stackName
38
+ ],
39
+ args: {
40
+ create: true,
41
+ secretsProvider
42
+ },
43
+ execa: {
44
+ env: createEnvConfiguration({
45
+ configurations: [
46
+ withPulumiConfigPassphrase(configPassphrase)
47
+ ]
48
+ })
49
+ }
50
+ });
51
+ const region = sdkParams.region || process.env.AWS_REGION;
52
+ const mustPerformCoreAppRegionMismatchCheck = isCoreAppRegionMismatchCheckNeeded(app);
53
+ if (mustPerformCoreAppRegionMismatchCheck) {
54
+ const coreStack = await this.getAppStackOutput(app);
55
+ if (coreStack && coreStack.region && coreStack.region !== region) throw new Error(`Core App Region mismatch. Input: "${sdkParams.region || "none"}", process: "${process.env.AWS_REGION || "none"}". In Core stack: "${coreStack.region}". This can happen if you try to deploy a stack to a region different to the Core application region.`);
56
+ }
57
+ const targetStack = await this.getAppStackOutput(app);
58
+ if (!targetStack?.region || targetStack.region === region) return;
59
+ throw new Error(`Region mismatch. Input: "${sdkParams.region || "none"}", process: "${process.env.AWS_REGION || "none"}". In stack: "${targetStack.region}". This can happen if you try to deploy a stack to a region other than it was initially deployed.`);
60
+ }
61
+ async getAppStackOutput(app) {
62
+ const pulumi = await this.getPulumiService.execute({
63
+ app
64
+ });
65
+ const logger = this.loggerService;
66
+ const stackOutputString = await pulumi.run({
67
+ command: [
68
+ "stack",
69
+ "output"
70
+ ],
71
+ args: {
72
+ json: true
73
+ },
74
+ execa: {
75
+ env: createEnvConfiguration({
76
+ configurations: [
77
+ withPulumiConfigPassphrase()
78
+ ]
79
+ })
80
+ }
81
+ });
82
+ try {
83
+ const stackOutputJson = JSON.parse(stackOutputString.stdout);
84
+ if (!stackOutputJson) return null;
85
+ return stackOutputJson;
86
+ } catch {
87
+ logger.error("Could not parse stack output as JSON.", stackOutputString.stdout, app);
88
+ return null;
89
+ }
90
+ }
91
+ }
92
+ const pulumiSelectStackService = createImplementation({
93
+ abstraction: PulumiSelectStackService,
94
+ implementation: DefaultPulumiSelectStackService,
95
+ dependencies: [
96
+ GetPulumiService,
97
+ PulumiLoginService,
98
+ PulumiGetSecretsProviderService,
99
+ PulumiGetConfigPassphraseService,
100
+ LoggerService,
101
+ ProjectSdkParamsService
102
+ ]
103
+ });
104
+ export { DefaultPulumiSelectStackService, pulumiSelectStackService };
105
+
106
+ //# sourceMappingURL=PulumiSelectStackService.js.map