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

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 (162) hide show
  1. package/_templates/appTemplates/api/graphql/package.json +3 -11
  2. package/_templates/appTemplates/api/graphql/src/index.ts +19 -78
  3. package/_templates/extensions/OpenSearch/api/graphql/src/index.ts +17 -92
  4. package/_templates/extensions/OpenSearch/coreDdbToEsHandler/dynamoToElastic/src/index.ts +19 -12
  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/admin.d.ts +6 -0
  10. package/admin.js +4 -2
  11. package/admin.js.map +1 -1
  12. package/api.d.ts +4 -4
  13. package/apps/createAdminApp.d.ts +1 -1
  14. package/apps/createApiApp.d.ts +8 -0
  15. package/apps/createCoreApp.d.ts +13 -13
  16. package/extensions/ApiRoute.d.ts +5 -5
  17. package/extensions/ApiRoute.js +14 -30
  18. package/extensions/ApiRoute.js.map +1 -1
  19. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.d.ts +1 -1
  20. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js +1 -2
  21. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js.map +1 -1
  22. package/extensions/ProjectAws/BuildAppWorkspace.d.ts +3 -2
  23. package/extensions/ProjectAws/BuildAppWorkspace.js +38 -11
  24. package/extensions/ProjectAws/BuildAppWorkspace.js.map +1 -1
  25. package/extensions/ProjectAws/BuildProjectWorkspace.d.ts +12 -0
  26. package/extensions/ProjectAws/BuildProjectWorkspace.js +30 -0
  27. package/extensions/ProjectAws/BuildProjectWorkspace.js.map +1 -0
  28. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.d.ts +11 -0
  29. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js +30 -0
  30. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js.map +1 -0
  31. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.d.ts +11 -0
  32. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js +30 -0
  33. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js.map +1 -0
  34. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.d.ts +11 -0
  35. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js +30 -0
  36. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js.map +1 -0
  37. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js +1 -1
  38. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js.map +1 -1
  39. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.d.ts +11 -0
  40. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js +31 -0
  41. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js.map +1 -0
  42. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.d.ts +13 -0
  43. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js +34 -0
  44. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js.map +1 -0
  45. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js +1 -2
  46. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js.map +1 -1
  47. package/extensions/ProjectAws/TelemetryNoLongerNewUser.d.ts +8 -0
  48. package/extensions/ProjectAws/TelemetryNoLongerNewUser.js +14 -0
  49. package/extensions/ProjectAws/TelemetryNoLongerNewUser.js.map +1 -0
  50. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.d.ts +12 -0
  51. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js +31 -0
  52. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js.map +1 -0
  53. package/extensions/ProjectAws/ValidateProductionPulumiState.d.ts +12 -0
  54. package/extensions/ProjectAws/ValidateProductionPulumiState.js +33 -0
  55. package/extensions/ProjectAws/ValidateProductionPulumiState.js.map +1 -0
  56. package/extensions/ProjectAws/definitions.js +1 -3
  57. package/extensions/ProjectAws/definitions.js.map +1 -1
  58. package/extensions/ProjectAws.js +18 -4
  59. package/extensions/ProjectAws.js.map +1 -1
  60. package/extensions/RegisterRoutesPulumi.js +2 -5
  61. package/extensions/RegisterRoutesPulumi.js.map +1 -1
  62. package/extensions/definitions.js +0 -2
  63. package/extensions/definitions.js.map +1 -1
  64. package/extensions/index.d.ts +0 -1
  65. package/extensions/index.js +0 -1
  66. package/extensions/routePath.d.ts +20 -0
  67. package/extensions/routePath.js +13 -0
  68. package/extensions/routePath.js.map +1 -0
  69. package/features/Watch/AwsWatch.d.ts +17 -0
  70. package/features/Watch/AwsWatch.js +108 -0
  71. package/features/Watch/AwsWatch.js.map +1 -0
  72. package/features/Watch/getIotEndpoint.d.ts +2 -0
  73. package/features/Watch/getIotEndpoint.js +18 -0
  74. package/features/Watch/getIotEndpoint.js.map +1 -0
  75. package/features/Watch/handler/handler.zip +0 -0
  76. package/features/Watch/replaceLambdaFunctions.d.ts +19 -0
  77. package/features/Watch/replaceLambdaFunctions.js +72 -0
  78. package/features/Watch/replaceLambdaFunctions.js.map +1 -0
  79. package/index.d.ts +1 -0
  80. package/index.js +1 -0
  81. package/infra.d.ts +15 -18
  82. package/infra.js +5 -2
  83. package/infra.js.map +1 -1
  84. package/package.json +20 -17
  85. package/project.d.ts +16 -11
  86. package/pulumi/apps/admin/createAdminPulumiApp.d.ts +1 -1
  87. package/pulumi/apps/admin/createAdminPulumiApp.js +4 -5
  88. package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
  89. package/pulumi/apps/api/ApiCloudfront.js +103 -1
  90. package/pulumi/apps/api/ApiCloudfront.js.map +1 -1
  91. package/pulumi/apps/api/ApiGraphqlStream.d.ts +29 -0
  92. package/pulumi/apps/api/ApiGraphqlStream.js +58 -0
  93. package/pulumi/apps/api/ApiGraphqlStream.js.map +1 -0
  94. package/pulumi/apps/api/ApiOutput.js +1 -1
  95. package/pulumi/apps/api/ApiOutput.js.map +1 -1
  96. package/pulumi/apps/api/createApiPulumiApp.d.ts +8 -0
  97. package/pulumi/apps/api/createApiPulumiApp.js +30 -24
  98. package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
  99. package/pulumi/apps/api/index.d.ts +1 -0
  100. package/pulumi/apps/api/index.js +1 -0
  101. package/pulumi/apps/awsUtils.d.ts +1 -1
  102. package/pulumi/apps/awsUtils.js +2 -2
  103. package/pulumi/apps/awsUtils.js.map +1 -1
  104. package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js +2 -2
  105. package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js.map +1 -1
  106. package/pulumi/apps/blueGreen/domains/getApplicationDomains.js +1 -1
  107. package/pulumi/apps/blueGreen/domains/getApplicationDomains.js.map +1 -1
  108. package/pulumi/apps/common/CoreOutput.js +2 -2
  109. package/pulumi/apps/common/CoreOutput.js.map +1 -1
  110. package/pulumi/apps/core/CoreOpenSearch.d.ts +1 -1
  111. package/pulumi/apps/core/createCorePulumiApp.d.ts +13 -13
  112. package/pulumi/apps/core/createCorePulumiApp.js +5 -5
  113. package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
  114. package/pulumi/apps/core/webinyWatchCommand/handler.d.ts +1 -1
  115. package/pulumi/apps/customDomain.d.ts +0 -15
  116. package/pulumi/apps/customDomain.js +2 -14
  117. package/pulumi/apps/customDomain.js.map +1 -1
  118. package/pulumi/apps/extensions/getVpcConfigFromExtension.d.ts +4 -4
  119. package/pulumi/apps/react/createReactPulumiApp.d.ts +1 -1
  120. package/pulumi/apps/react/createReactPulumiApp.js +2 -2
  121. package/pulumi/apps/react/createReactPulumiApp.js.map +1 -1
  122. package/pulumi/apps/syncSystem/SyncSystemLambda.d.ts +1 -1
  123. package/pulumi/apps/syncSystem/SyncSystemLambda.js +1 -1
  124. package/pulumi/apps/syncSystem/SyncSystemLambda.js.map +1 -1
  125. package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js +2 -2
  126. package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js.map +1 -1
  127. package/pulumi/apps/syncSystem/getSyncSystemOutput.d.ts +1 -1
  128. package/pulumi/apps/syncSystem/getSyncSystemOutput.js +1 -1
  129. package/pulumi/apps/syncSystem/getSyncSystemOutput.js.map +1 -1
  130. package/pulumi/extensions/AdminCustomDomains.d.ts +0 -9
  131. package/pulumi/extensions/AdminCustomDomains.js +1 -3
  132. package/pulumi/extensions/AdminCustomDomains.js.map +1 -1
  133. package/pulumi/extensions/ApiCustomDomains.d.ts +0 -9
  134. package/pulumi/extensions/ApiCustomDomains.js +1 -3
  135. package/pulumi/extensions/ApiCustomDomains.js.map +1 -1
  136. package/pulumi/extensions/index.d.ts +16 -25
  137. package/pulumi/getAwsProjectSdk.d.ts +12 -0
  138. package/pulumi/getAwsProjectSdk.js +6 -0
  139. package/pulumi/getAwsProjectSdk.js.map +1 -0
  140. package/pulumi/getStackOutput.d.ts +7 -0
  141. package/pulumi/getStackOutput.js +8 -0
  142. package/pulumi/getStackOutput.js.map +1 -0
  143. package/pulumi/utils/lambdaEnvVariables.js +4 -16
  144. package/pulumi/utils/lambdaEnvVariables.js.map +1 -1
  145. package/registerAwsProjectFeatures.d.ts +8 -0
  146. package/registerAwsProjectFeatures.js +55 -0
  147. package/registerAwsProjectFeatures.js.map +1 -0
  148. package/services/GetPulumiService/GetPulumiService.d.ts +9 -0
  149. package/services/GetPulumiService/GetPulumiService.js +44 -0
  150. package/services/GetPulumiService/GetPulumiService.js.map +1 -0
  151. package/utils/getPulumiBaseTemplatesFolderPath.d.ts +1 -0
  152. package/utils/getPulumiBaseTemplatesFolderPath.js +10 -0
  153. package/utils/getPulumiBaseTemplatesFolderPath.js.map +1 -0
  154. package/utils/index.d.ts +1 -0
  155. package/utils/index.js +1 -0
  156. package/_templates/appTemplates/api/graphql/src/security.ts +0 -43
  157. package/extensions/Encryption.d.ts +0 -10
  158. package/extensions/Encryption.js +0 -36
  159. package/extensions/Encryption.js.map +0 -1
  160. package/pulumi/apps/extensions/isVpcEnabled.d.ts +0 -14
  161. package/pulumi/apps/extensions/isVpcEnabled.js +0 -8
  162. package/pulumi/apps/extensions/isVpcEnabled.js.map +0 -1
@@ -17,7 +17,20 @@ export { CorePulumi };
17
17
  export { ApiPulumi };
18
18
  export { AdminPulumi };
19
19
  export declare const definitions: (import("@webiny/project/defineExtension/index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
20
- tags: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
20
+ enabled: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>;
21
+ domainName: import("zod").ZodOptional<import("zod").ZodString>;
22
+ indexPrefix: import("zod").ZodOptional<import("zod").ZodString>;
23
+ sharedIndexes: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>;
24
+ endpoint: import("zod").ZodOptional<import("zod").ZodString>;
25
+ username: import("zod").ZodOptional<import("zod").ZodString>;
26
+ password: import("zod").ZodOptional<import("zod").ZodString>;
27
+ }, import("zod/v4/core").$strip>> | import("@webiny/project/defineExtension/index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
28
+ domains: import("zod").ZodArray<import("zod").ZodString>;
29
+ sslMethod: import("zod").ZodDefault<import("zod").ZodEnum<{
30
+ "sni-only": "sni-only";
31
+ vip: "vip";
32
+ }>>;
33
+ certificateArn: import("zod").ZodString;
21
34
  }, import("zod/v4/core").$strip>> | import("@webiny/project/defineExtension/index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
22
35
  enabled: import("zod").ZodDefault<import("zod").ZodBoolean>;
23
36
  useVpcEndpoints: import("zod").ZodOptional<import("zod").ZodBoolean>;
@@ -32,29 +45,9 @@ export declare const definitions: (import("@webiny/project/defineExtension/index
32
45
  }, import("zod/v4/core").$strip>;
33
46
  }, import("zod/v4/core").$strip>>;
34
47
  }, import("zod/v4/core").$strip>> | import("@webiny/project/defineExtension/index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
35
- enabled: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>;
36
- domainName: import("zod").ZodOptional<import("zod").ZodString>;
37
- indexPrefix: import("zod").ZodOptional<import("zod").ZodString>;
38
- sharedIndexes: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>;
39
- endpoint: import("zod").ZodOptional<import("zod").ZodString>;
40
- username: import("zod").ZodOptional<import("zod").ZodString>;
41
- password: import("zod").ZodOptional<import("zod").ZodString>;
48
+ src: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
42
49
  }, import("zod/v4/core").$strip>> | import("@webiny/project/defineExtension/index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
43
- domains: import("zod").ZodArray<import("zod").ZodString>;
44
- sslMethod: import("zod").ZodDefault<import("zod").ZodEnum<{
45
- "sni-only": "sni-only";
46
- vip: "vip";
47
- }>>;
48
- certificateArn: import("zod").ZodString;
49
- minimumProtocolVersion: import("zod").ZodOptional<import("zod").ZodEnum<{
50
- SSLv3: "SSLv3";
51
- TLSv1: "TLSv1";
52
- TLSv1_2016: "TLSv1_2016";
53
- "TLSv1.1_2016": "TLSv1.1_2016";
54
- "TLSv1.2_2018": "TLSv1.2_2018";
55
- "TLSv1.2_2019": "TLSv1.2_2019";
56
- "TLSv1.2_2021": "TLSv1.2_2021";
57
- }>>;
50
+ tags: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
58
51
  }, import("zod/v4/core").$strip>> | import("@webiny/project/defineExtension/index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
59
52
  enabled: import("zod").ZodDefault<import("zod").ZodBoolean>;
60
53
  domains: import("zod").ZodObject<{
@@ -77,6 +70,4 @@ export declare const definitions: (import("@webiny/project/defineExtension/index
77
70
  env: import("zod").ZodString;
78
71
  variant: import("zod").ZodString;
79
72
  }, import("zod/v4/core").$strip>], null>;
80
- }, import("zod/v4/core").$strip>> | import("@webiny/project/defineExtension/index.js").ExtensionDefinitionModel<import("zod").ZodObject<{
81
- src: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string, string>>;
82
73
  }, import("zod/v4/core").$strip>>)[];
@@ -0,0 +1,12 @@
1
+ import { ProjectSdk } from "@webiny/project";
2
+ /**
3
+ * ProjectSdk for the Pulumi program. The Pulumi program runs in its own process and does NOT go
4
+ * through the CLI's GetProjectSdkService, so it must register the AWS pulumi services itself
5
+ * (name prefix, stack output, …). We register only `registerAwsPulumiServices` — not the full
6
+ * `registerAwsProjectFeatures` — to avoid pulling in the CLI-only deploy/workspace decorators and
7
+ * hooks (which would, e.g., re-run workspace builders mid-deploy).
8
+ *
9
+ * Empty params → env/variant/region are picked up from the parent process via env
10
+ * (getProjectSdkContextFromEnv).
11
+ */
12
+ export declare const getAwsProjectSdk: () => Promise<ProjectSdk>;
@@ -0,0 +1,6 @@
1
+ import { ProjectSdk } from "@webiny/project";
2
+ import { registerAwsPulumiServices } from "../registerAwsProjectFeatures.js";
3
+ const getAwsProjectSdk = ()=>ProjectSdk.init({}, registerAwsPulumiServices);
4
+ export { getAwsProjectSdk };
5
+
6
+ //# sourceMappingURL=getAwsProjectSdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pulumi/getAwsProjectSdk.js","sources":["../../src/pulumi/getAwsProjectSdk.ts"],"sourcesContent":["import { ProjectSdk } from \"@webiny/project\";\nimport { registerAwsPulumiServices } from \"~/registerAwsProjectFeatures.js\";\n\n/**\n * ProjectSdk for the Pulumi program. The Pulumi program runs in its own process and does NOT go\n * through the CLI's GetProjectSdkService, so it must register the AWS pulumi services itself\n * (name prefix, stack output, …). We register only `registerAwsPulumiServices` — not the full\n * `registerAwsProjectFeatures` — to avoid pulling in the CLI-only deploy/workspace decorators and\n * hooks (which would, e.g., re-run workspace builders mid-deploy).\n *\n * Empty params → env/variant/region are picked up from the parent process via env\n * (getProjectSdkContextFromEnv).\n */\nexport const getAwsProjectSdk = () => ProjectSdk.init({}, registerAwsPulumiServices);\n"],"names":["getAwsProjectSdk","ProjectSdk","registerAwsPulumiServices"],"mappings":";;AAaO,MAAMA,mBAAmB,IAAMC,WAAW,IAAI,CAAC,CAAC,GAAGC"}
@@ -0,0 +1,7 @@
1
+ import { type AppName, type IStackOutput } from "@webiny/project";
2
+ /**
3
+ * AWS-aware equivalent of `@webiny/project`'s `getStackOutput` helper: reads an app's stack output
4
+ * via the aws-aware SDK. The base `getStackOutput` uses `getProjectSdk()`, which lacks the pulumi
5
+ * services now that they live in project-aws → "No registration found for GetAppStackOutput".
6
+ */
7
+ export declare const getStackOutput: <TOutput extends IStackOutput = IStackOutput>(appName: AppName) => Promise<TOutput | null>;
@@ -0,0 +1,8 @@
1
+ import { getAwsProjectSdk } from "./getAwsProjectSdk.js";
2
+ const getStackOutput = async (appName)=>{
3
+ const sdk = await getAwsProjectSdk();
4
+ return sdk.getAppStackOutput(appName);
5
+ };
6
+ export { getStackOutput };
7
+
8
+ //# sourceMappingURL=getStackOutput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pulumi/getStackOutput.js","sources":["../../src/pulumi/getStackOutput.ts"],"sourcesContent":["import { type AppName, type IStackOutput } from \"@webiny/project\";\nimport { getAwsProjectSdk } from \"./getAwsProjectSdk.js\";\n\n/**\n * AWS-aware equivalent of `@webiny/project`'s `getStackOutput` helper: reads an app's stack output\n * via the aws-aware SDK. The base `getStackOutput` uses `getProjectSdk()`, which lacks the pulumi\n * services now that they live in project-aws → \"No registration found for GetAppStackOutput\".\n */\nexport const getStackOutput = async <TOutput extends IStackOutput = IStackOutput>(\n appName: AppName\n): Promise<TOutput | null> => {\n const sdk = await getAwsProjectSdk();\n return sdk.getAppStackOutput<TOutput>(appName);\n};\n"],"names":["getStackOutput","appName","sdk","getAwsProjectSdk"],"mappings":";AAQO,MAAMA,iBAAiB,OAC1BC;IAEA,MAAMC,MAAM,MAAMC;IAClB,OAAOD,IAAI,iBAAiB,CAAUD;AAC1C"}
@@ -1,26 +1,14 @@
1
+ import { pickApiRuntimeEnvVariables } from "@webiny/project";
1
2
  import * as __rspack_external__pulumi_pulumi_f3e773ed from "@pulumi/pulumi";
2
3
  const variablesRegistry = {};
3
4
  if ("true" === process.env.DEBUG) variablesRegistry.NODE_OPTIONS = "--enable-source-maps";
4
5
  let sealEnvVariables;
5
- const magicPrefixes = [
6
- "WEBINY_",
7
- "WEBINY_API_",
8
- "WEBINY_PROJECT_API_KEY",
9
- "WCP_PROJECT_ENVIRONMENT",
10
- "WCP_PROJECT_ENVIRONMENT_API_KEY",
11
- "OKTA_",
12
- "AUTH0_"
13
- ];
14
6
  const variablesPromise = new Promise((resolve)=>{
15
7
  sealEnvVariables = ()=>{
16
- const baseVariables = Object.keys(process.env).reduce((current, environmentVariableName)=>{
17
- const hasMagicPrefix = magicPrefixes.some((prefix)=>environmentVariableName.startsWith(prefix));
18
- if (hasMagicPrefix && void 0 !== process.env[environmentVariableName]) current[environmentVariableName] = String(process.env[environmentVariableName]);
19
- return current;
20
- }, {
21
- DEBUG: String(process.env.DEBUG),
8
+ const baseVariables = {
9
+ ...pickApiRuntimeEnvVariables(),
22
10
  PULUMI_APPS: "true"
23
- });
11
+ };
24
12
  resolve(Object.assign({}, baseVariables, variablesRegistry));
25
13
  };
26
14
  });
@@ -1 +1 @@
1
- {"version":3,"file":"pulumi/utils/lambdaEnvVariables.js","sources":["../../../src/pulumi/utils/lambdaEnvVariables.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\nimport type { PulumiApp } from \"@webiny/pulumi\";\n\ntype EnvVariables = Record<string, string | pulumi.Output<string>>;\n\nconst variablesRegistry: EnvVariables = {};\n\nif (process.env.DEBUG === \"true\") {\n variablesRegistry.NODE_OPTIONS = \"--enable-source-maps\";\n}\n\nexport let sealEnvVariables: () => void;\n\nconst magicPrefixes = [\n \"WEBINY_\",\n \"WEBINY_API_\",\n // Added WCP vars separately. We don't need any other `WCP_PROJECT_` variables, apart from these.\n // WEBINY_PROJECT_API_KEY is the new naming (preferred), WCP_PROJECT_ENVIRONMENT_API_KEY is for backward compatibility.\n // This will be later removed because we'll be using `Api.BuildParam` extension.\n \"WEBINY_PROJECT_API_KEY\",\n \"WCP_PROJECT_ENVIRONMENT\",\n \"WCP_PROJECT_ENVIRONMENT_API_KEY\",\n \"OKTA_\",\n \"AUTH0_\"\n];\n\nconst variablesPromise = new Promise<EnvVariables>(resolve => {\n sealEnvVariables = () => {\n // Apart from a couple of basic environment variables like DEBUG,\n // we also take into consideration variables that have `WEBINY_` and `WCP_` prefix in their names.\n const baseVariables = Object.keys(process.env).reduce<EnvVariables>(\n (current, environmentVariableName) => {\n const hasMagicPrefix = magicPrefixes.some(prefix =>\n environmentVariableName.startsWith(prefix)\n );\n\n if (hasMagicPrefix && process.env[environmentVariableName] !== undefined) {\n current[environmentVariableName] = String(process.env[environmentVariableName]);\n }\n return current;\n },\n {\n // Among other things, this determines the amount of information we reveal on runtime errors.\n // https://www.webiny.com/docs/how-to-guides/environment-variables/#debug-environment-variable\n DEBUG: String(process.env.DEBUG),\n // This flag means that Lambda was deployed using the new Pulumi Apps architecture.\n PULUMI_APPS: \"true\"\n }\n );\n\n resolve(Object.assign({}, baseVariables, variablesRegistry));\n };\n});\n\nexport function getCommonLambdaEnvVariables(): pulumi.Output<EnvVariables> {\n return pulumi.output(variablesPromise);\n}\n\nfunction setCommonLambdaEnvVariables(variables: EnvVariables) {\n Object.assign(variablesRegistry, variables);\n}\n\nexport interface SetCommonLambdaEnvVariables {\n (variables: EnvVariables): void;\n}\n\nexport interface WithCommonLambdaEnvVariables {\n /**\n * Set ENV variables that wil be assigned to all Lambda functions in the current Pulumi app.\n */\n setCommonLambdaEnvVariables: SetCommonLambdaEnvVariables;\n}\n\n/**\n * Augment the given app with `setCommonLambdaEnvVariables` functionality.\n * @param {PulumiApp} app\n */\nexport function withCommonLambdaEnvVariables<T extends PulumiApp>(\n app: T\n): T & WithCommonLambdaEnvVariables {\n app.decorateProgram<{ setCommonLambdaEnvVariables: typeof setCommonLambdaEnvVariables }>(\n async (program, app) => {\n const output = await program({\n ...app,\n setCommonLambdaEnvVariables\n });\n\n // Once the program is executed, we need to seal the variables (this will resolve the pulumi.output promise).\n app.addHandler(() => {\n sealEnvVariables();\n });\n\n return output;\n }\n );\n\n // Augment the original PulumiApp.\n return {\n ...app,\n setCommonLambdaEnvVariables\n };\n}\n"],"names":["variablesRegistry","process","sealEnvVariables","magicPrefixes","variablesPromise","Promise","resolve","baseVariables","Object","current","environmentVariableName","hasMagicPrefix","prefix","undefined","String","getCommonLambdaEnvVariables","pulumi","setCommonLambdaEnvVariables","variables","withCommonLambdaEnvVariables","app","program","output"],"mappings":";AAKA,MAAMA,oBAAkC,CAAC;AAEzC,IAAIC,AAAsB,WAAtBA,QAAQ,GAAG,CAAC,KAAK,EACjBD,kBAAkB,YAAY,GAAG;AAG9B,IAAIE;AAEX,MAAMC,gBAAgB;IAClB;IACA;IAIA;IACA;IACA;IACA;IACA;CACH;AAED,MAAMC,mBAAmB,IAAIC,QAAsBC,CAAAA;IAC/CJ,mBAAmB;QAGf,MAAMK,gBAAgBC,OAAO,IAAI,CAACP,QAAQ,GAAG,EAAE,MAAM,CACjD,CAACQ,SAASC;YACN,MAAMC,iBAAiBR,cAAc,IAAI,CAACS,CAAAA,SACtCF,wBAAwB,UAAU,CAACE;YAGvC,IAAID,kBAAkBV,AAAyCY,WAAzCZ,QAAQ,GAAG,CAACS,wBAAwB,EACtDD,OAAO,CAACC,wBAAwB,GAAGI,OAAOb,QAAQ,GAAG,CAACS,wBAAwB;YAElF,OAAOD;QACX,GACA;YAGI,OAAOK,OAAOb,QAAQ,GAAG,CAAC,KAAK;YAE/B,aAAa;QACjB;QAGJK,QAAQE,OAAO,MAAM,CAAC,CAAC,GAAGD,eAAeP;IAC7C;AACJ;AAEO,SAASe;IACZ,OAAOC,0CAAAA,MAAa,CAACZ;AACzB;AAEA,SAASa,4BAA4BC,SAAuB;IACxDV,OAAO,MAAM,CAACR,mBAAmBkB;AACrC;AAiBO,SAASC,6BACZC,GAAM;IAENA,IAAI,eAAe,CACf,OAAOC,SAASD;QACZ,MAAME,SAAS,MAAMD,QAAQ;YACzB,GAAGD,GAAG;YACNH,6BAAAA;QACJ;QAGAG,IAAI,UAAU,CAAC;YACXlB;QACJ;QAEA,OAAOoB;IACX;IAIJ,OAAO;QACH,GAAGF,GAAG;QACNH,6BAAAA;IACJ;AACJ"}
1
+ {"version":3,"file":"pulumi/utils/lambdaEnvVariables.js","sources":["../../../src/pulumi/utils/lambdaEnvVariables.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\nimport type { PulumiApp } from \"@webiny/pulumi\";\nimport { pickApiRuntimeEnvVariables } from \"@webiny/project\";\n\ntype EnvVariables = Record<string, string | pulumi.Output<string>>;\n\nconst variablesRegistry: EnvVariables = {};\n\nif (process.env.DEBUG === \"true\") {\n variablesRegistry.NODE_OPTIONS = \"--enable-source-maps\";\n}\n\nexport let sealEnvVariables: () => void;\n\nconst variablesPromise = new Promise<EnvVariables>(resolve => {\n sealEnvVariables = () => {\n // The api runtime allowlist (WEBINY_/WCP_PROJECT_ENVIRONMENT/OKTA_/AUTH0_ + DEBUG) is shared\n // with the self-hosted server hosting type — see @webiny/project's pickApiRuntimeEnvVariables.\n const baseVariables: EnvVariables = {\n ...pickApiRuntimeEnvVariables(),\n // This flag means that Lambda was deployed using the new Pulumi Apps architecture.\n PULUMI_APPS: \"true\"\n };\n\n resolve(Object.assign({}, baseVariables, variablesRegistry));\n };\n});\n\nexport function getCommonLambdaEnvVariables(): pulumi.Output<EnvVariables> {\n return pulumi.output(variablesPromise);\n}\n\nfunction setCommonLambdaEnvVariables(variables: EnvVariables) {\n Object.assign(variablesRegistry, variables);\n}\n\nexport interface SetCommonLambdaEnvVariables {\n (variables: EnvVariables): void;\n}\n\nexport interface WithCommonLambdaEnvVariables {\n /**\n * Set ENV variables that wil be assigned to all Lambda functions in the current Pulumi app.\n */\n setCommonLambdaEnvVariables: SetCommonLambdaEnvVariables;\n}\n\n/**\n * Augment the given app with `setCommonLambdaEnvVariables` functionality.\n * @param {PulumiApp} app\n */\nexport function withCommonLambdaEnvVariables<T extends PulumiApp>(\n app: T\n): T & WithCommonLambdaEnvVariables {\n app.decorateProgram<{ setCommonLambdaEnvVariables: typeof setCommonLambdaEnvVariables }>(\n async (program, app) => {\n const output = await program({\n ...app,\n setCommonLambdaEnvVariables\n });\n\n // Once the program is executed, we need to seal the variables (this will resolve the pulumi.output promise).\n app.addHandler(() => {\n sealEnvVariables();\n });\n\n return output;\n }\n );\n\n // Augment the original PulumiApp.\n return {\n ...app,\n setCommonLambdaEnvVariables\n };\n}\n"],"names":["variablesRegistry","process","sealEnvVariables","variablesPromise","Promise","resolve","baseVariables","pickApiRuntimeEnvVariables","Object","getCommonLambdaEnvVariables","pulumi","setCommonLambdaEnvVariables","variables","withCommonLambdaEnvVariables","app","program","output"],"mappings":";;AAMA,MAAMA,oBAAkC,CAAC;AAEzC,IAAIC,AAAsB,WAAtBA,QAAQ,GAAG,CAAC,KAAK,EACjBD,kBAAkB,YAAY,GAAG;AAG9B,IAAIE;AAEX,MAAMC,mBAAmB,IAAIC,QAAsBC,CAAAA;IAC/CH,mBAAmB;QAGf,MAAMI,gBAA8B;YAChC,GAAGC,4BAA4B;YAE/B,aAAa;QACjB;QAEAF,QAAQG,OAAO,MAAM,CAAC,CAAC,GAAGF,eAAeN;IAC7C;AACJ;AAEO,SAASS;IACZ,OAAOC,0CAAAA,MAAa,CAACP;AACzB;AAEA,SAASQ,4BAA4BC,SAAuB;IACxDJ,OAAO,MAAM,CAACR,mBAAmBY;AACrC;AAiBO,SAASC,6BACZC,GAAM;IAENA,IAAI,eAAe,CACf,OAAOC,SAASD;QACZ,MAAME,SAAS,MAAMD,QAAQ;YACzB,GAAGD,GAAG;YACNH,6BAAAA;QACJ;QAGAG,IAAI,UAAU,CAAC;YACXZ;QACJ;QAEA,OAAOc;IACX;IAIJ,OAAO;QACH,GAAGF,GAAG;QACNH,6BAAAA;IACJ;AACJ"}
@@ -0,0 +1,8 @@
1
+ import { Container } from "@webiny/di";
2
+ /**
3
+ * Pulumi services + features only — no deploy/workspace decorators or hooks. Safe to register in the
4
+ * Pulumi program's own ProjectSdk container (a separate process that must resolve the name prefix,
5
+ * stack output, etc. without re-running the CLI's workspace builders or deploy decorators).
6
+ */
7
+ export declare const registerAwsPulumiServices: (container: Container) => void;
8
+ export declare const registerAwsProjectFeatures: (container: Container) => void;
@@ -0,0 +1,55 @@
1
+ import { deployApp, destroyApp, exportStack, getAppOutput, getAppStackOutput, getPulumiResourceNamePrefix, refreshApp, runPulumiCommand } from "@webiny/project/features/index.js";
2
+ import { isRemotePulumiBackendService, listAppLambdaFunctionsService, listDeployedEnvironmentsService, pulumiExportService, pulumiGetConfigPassphraseService, pulumiGetSecretsProviderService, pulumiGetStackOutputService, pulumiImportService, pulumiLoginService, pulumiSelectStackService, watchedLambdaFunctionsService } from "@webiny/project/services/index.js";
3
+ import { getPulumiService } from "./services/GetPulumiService/GetPulumiService.js";
4
+ import { adminAfterDeploy, adminBeforeDeploy, afterDeploy, apiAfterDeploy, apiBeforeDeploy, beforeDeploy, coreAfterBuild, coreAfterDeploy, coreBeforeBuild, coreBeforeDeploy, coreBeforeWatch } from "@webiny/project/features/hooks/index.js";
5
+ import { deployAppClearWatchedLambdaFunctions, deployAppRefreshStackOutputCache, deployAppWithHooks, deployAppWithWatchedLambdaReplacement, getPulumiServiceWithDownloadInfo } from "@webiny/project/decorators/index.js";
6
+ import { awsWatch } from "./features/Watch/AwsWatch.js";
7
+ import { BuildProjectWorkspace } from "./extensions/ProjectAws/BuildProjectWorkspace.js";
8
+ import { BuildAppWorkspace } from "./extensions/ProjectAws/BuildAppWorkspace.js";
9
+ const registerAwsPulumiServices = (container)=>{
10
+ container.register(getPulumiService).inSingletonScope();
11
+ container.register(isRemotePulumiBackendService).inSingletonScope();
12
+ container.register(listAppLambdaFunctionsService).inSingletonScope();
13
+ container.register(listDeployedEnvironmentsService).inSingletonScope();
14
+ container.register(watchedLambdaFunctionsService).inSingletonScope();
15
+ container.register(pulumiGetConfigPassphraseService).inSingletonScope();
16
+ container.register(pulumiGetSecretsProviderService).inSingletonScope();
17
+ container.register(pulumiExportService).inSingletonScope();
18
+ container.register(pulumiImportService).inSingletonScope();
19
+ container.register(pulumiGetStackOutputService).inSingletonScope();
20
+ container.register(pulumiLoginService).inSingletonScope();
21
+ container.register(pulumiSelectStackService).inSingletonScope();
22
+ container.register(deployApp).inSingletonScope();
23
+ container.register(destroyApp).inSingletonScope();
24
+ container.register(exportStack).inSingletonScope();
25
+ container.register(getAppOutput).inSingletonScope();
26
+ container.register(getAppStackOutput).inSingletonScope();
27
+ container.register(getPulumiResourceNamePrefix).inSingletonScope();
28
+ container.register(refreshApp).inSingletonScope();
29
+ container.register(runPulumiCommand).inSingletonScope();
30
+ };
31
+ const registerAwsProjectFeatures = (container)=>{
32
+ container.registerDecorator(BuildProjectWorkspace);
33
+ container.registerDecorator(BuildAppWorkspace);
34
+ registerAwsPulumiServices(container);
35
+ container.registerComposite(beforeDeploy);
36
+ container.registerComposite(afterDeploy);
37
+ container.registerComposite(coreBeforeBuild);
38
+ container.registerComposite(coreAfterBuild);
39
+ container.registerComposite(coreBeforeWatch);
40
+ container.registerComposite(coreBeforeDeploy);
41
+ container.registerComposite(coreAfterDeploy);
42
+ container.registerComposite(apiBeforeDeploy);
43
+ container.registerComposite(apiAfterDeploy);
44
+ container.registerComposite(adminBeforeDeploy);
45
+ container.registerComposite(adminAfterDeploy);
46
+ container.registerDecorator(deployAppWithWatchedLambdaReplacement);
47
+ container.registerDecorator(deployAppClearWatchedLambdaFunctions);
48
+ container.registerDecorator(deployAppRefreshStackOutputCache);
49
+ container.registerDecorator(deployAppWithHooks);
50
+ container.registerDecorator(getPulumiServiceWithDownloadInfo);
51
+ container.registerDecorator(awsWatch);
52
+ };
53
+ export { registerAwsProjectFeatures, registerAwsPulumiServices };
54
+
55
+ //# sourceMappingURL=registerAwsProjectFeatures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerAwsProjectFeatures.js","sources":["../src/registerAwsProjectFeatures.ts"],"sourcesContent":["import { Container } from \"@webiny/di\";\n\n// Features\nimport {\n deployApp,\n destroyApp,\n exportStack,\n getAppOutput,\n getAppStackOutput,\n getPulumiResourceNamePrefix,\n refreshApp,\n runPulumiCommand\n} from \"@webiny/project/features/index.js\";\n\n// Services\nimport {\n watchedLambdaFunctionsService,\n isRemotePulumiBackendService,\n listAppLambdaFunctionsService,\n listDeployedEnvironmentsService,\n pulumiGetConfigPassphraseService,\n pulumiGetSecretsProviderService,\n pulumiExportService,\n pulumiImportService,\n pulumiGetStackOutputService,\n pulumiLoginService,\n pulumiSelectStackService\n} from \"@webiny/project/services/index.js\";\n\n// GetPulumiService implementation lives here since it directly imports @webiny/pulumi-sdk\nimport { getPulumiService } from \"./services/GetPulumiService/GetPulumiService.js\";\n\n// Hooks\nimport {\n beforeDeploy,\n afterDeploy,\n coreBeforeBuild,\n coreAfterBuild,\n coreBeforeWatch,\n coreBeforeDeploy,\n coreAfterDeploy,\n apiBeforeDeploy,\n apiAfterDeploy,\n adminBeforeDeploy,\n adminAfterDeploy\n} from \"@webiny/project/features/hooks/index.js\";\n\n// Decorators\nimport {\n deployAppWithWatchedLambdaReplacement,\n deployAppClearWatchedLambdaFunctions,\n deployAppRefreshStackOutputCache,\n deployAppWithHooks,\n getPulumiServiceWithDownloadInfo\n} from \"@webiny/project/decorators/index.js\";\n\nimport { awsWatch } from \"./features/Watch/AwsWatch.js\";\nimport { BuildProjectWorkspace } from \"./extensions/ProjectAws/BuildProjectWorkspace.js\";\nimport { BuildAppWorkspace } from \"./extensions/ProjectAws/BuildAppWorkspace.js\";\n\n/**\n * Pulumi services + features only — no deploy/workspace decorators or hooks. Safe to register in the\n * Pulumi program's own ProjectSdk container (a separate process that must resolve the name prefix,\n * stack output, etc. without re-running the CLI's workspace builders or deploy decorators).\n */\nexport const registerAwsPulumiServices = (container: Container): void => {\n // Pulumi/Lambda services.\n container.register(getPulumiService).inSingletonScope();\n container.register(isRemotePulumiBackendService).inSingletonScope();\n container.register(listAppLambdaFunctionsService).inSingletonScope();\n container.register(listDeployedEnvironmentsService).inSingletonScope();\n container.register(watchedLambdaFunctionsService).inSingletonScope();\n container.register(pulumiGetConfigPassphraseService).inSingletonScope();\n container.register(pulumiGetSecretsProviderService).inSingletonScope();\n container.register(pulumiExportService).inSingletonScope();\n container.register(pulumiImportService).inSingletonScope();\n container.register(pulumiGetStackOutputService).inSingletonScope();\n container.register(pulumiLoginService).inSingletonScope();\n container.register(pulumiSelectStackService).inSingletonScope();\n\n // Deploy/Pulumi features.\n container.register(deployApp).inSingletonScope();\n container.register(destroyApp).inSingletonScope();\n container.register(exportStack).inSingletonScope();\n container.register(getAppOutput).inSingletonScope();\n container.register(getAppStackOutput).inSingletonScope();\n container.register(getPulumiResourceNamePrefix).inSingletonScope();\n container.register(refreshApp).inSingletonScope();\n container.register(runPulumiCommand).inSingletonScope();\n};\n\nexport const registerAwsProjectFeatures = (container: Container): void => {\n // Workspace decorators — must be registered before workspace services execute.\n container.registerDecorator(BuildProjectWorkspace);\n container.registerDecorator(BuildAppWorkspace);\n\n // Pulumi services + features (shared with the Pulumi program).\n registerAwsPulumiServices(container);\n\n // Deploy + core hooks.\n container.registerComposite(beforeDeploy);\n container.registerComposite(afterDeploy);\n container.registerComposite(coreBeforeBuild);\n container.registerComposite(coreAfterBuild);\n container.registerComposite(coreBeforeWatch);\n container.registerComposite(coreBeforeDeploy);\n container.registerComposite(coreAfterDeploy);\n container.registerComposite(apiBeforeDeploy);\n container.registerComposite(apiAfterDeploy);\n container.registerComposite(adminBeforeDeploy);\n container.registerComposite(adminAfterDeploy);\n\n // Deploy decorators (registered before InitProjectSdkService adds watchWithHooks etc.).\n container.registerDecorator(deployAppWithWatchedLambdaReplacement);\n container.registerDecorator(deployAppClearWatchedLambdaFunctions);\n container.registerDecorator(deployAppRefreshStackOutputCache);\n container.registerDecorator(deployAppWithHooks);\n container.registerDecorator(getPulumiServiceWithDownloadInfo);\n\n // Watch decorator that adds Lambda hot-reload.\n container.registerDecorator(awsWatch);\n};\n"],"names":["registerAwsPulumiServices","container","getPulumiService","isRemotePulumiBackendService","listAppLambdaFunctionsService","listDeployedEnvironmentsService","watchedLambdaFunctionsService","pulumiGetConfigPassphraseService","pulumiGetSecretsProviderService","pulumiExportService","pulumiImportService","pulumiGetStackOutputService","pulumiLoginService","pulumiSelectStackService","deployApp","destroyApp","exportStack","getAppOutput","getAppStackOutput","getPulumiResourceNamePrefix","refreshApp","runPulumiCommand","registerAwsProjectFeatures","BuildProjectWorkspace","BuildAppWorkspace","beforeDeploy","afterDeploy","coreBeforeBuild","coreAfterBuild","coreBeforeWatch","coreBeforeDeploy","coreAfterDeploy","apiBeforeDeploy","apiAfterDeploy","adminBeforeDeploy","adminAfterDeploy","deployAppWithWatchedLambdaReplacement","deployAppClearWatchedLambdaFunctions","deployAppRefreshStackOutputCache","deployAppWithHooks","getPulumiServiceWithDownloadInfo","awsWatch"],"mappings":";;;;;;;;AAiEO,MAAMA,4BAA4B,CAACC;IAEtCA,UAAU,QAAQ,CAACC,kBAAkB,gBAAgB;IACrDD,UAAU,QAAQ,CAACE,8BAA8B,gBAAgB;IACjEF,UAAU,QAAQ,CAACG,+BAA+B,gBAAgB;IAClEH,UAAU,QAAQ,CAACI,iCAAiC,gBAAgB;IACpEJ,UAAU,QAAQ,CAACK,+BAA+B,gBAAgB;IAClEL,UAAU,QAAQ,CAACM,kCAAkC,gBAAgB;IACrEN,UAAU,QAAQ,CAACO,iCAAiC,gBAAgB;IACpEP,UAAU,QAAQ,CAACQ,qBAAqB,gBAAgB;IACxDR,UAAU,QAAQ,CAACS,qBAAqB,gBAAgB;IACxDT,UAAU,QAAQ,CAACU,6BAA6B,gBAAgB;IAChEV,UAAU,QAAQ,CAACW,oBAAoB,gBAAgB;IACvDX,UAAU,QAAQ,CAACY,0BAA0B,gBAAgB;IAG7DZ,UAAU,QAAQ,CAACa,WAAW,gBAAgB;IAC9Cb,UAAU,QAAQ,CAACc,YAAY,gBAAgB;IAC/Cd,UAAU,QAAQ,CAACe,aAAa,gBAAgB;IAChDf,UAAU,QAAQ,CAACgB,cAAc,gBAAgB;IACjDhB,UAAU,QAAQ,CAACiB,mBAAmB,gBAAgB;IACtDjB,UAAU,QAAQ,CAACkB,6BAA6B,gBAAgB;IAChElB,UAAU,QAAQ,CAACmB,YAAY,gBAAgB;IAC/CnB,UAAU,QAAQ,CAACoB,kBAAkB,gBAAgB;AACzD;AAEO,MAAMC,6BAA6B,CAACrB;IAEvCA,UAAU,iBAAiB,CAACsB;IAC5BtB,UAAU,iBAAiB,CAACuB;IAG5BxB,0BAA0BC;IAG1BA,UAAU,iBAAiB,CAACwB;IAC5BxB,UAAU,iBAAiB,CAACyB;IAC5BzB,UAAU,iBAAiB,CAAC0B;IAC5B1B,UAAU,iBAAiB,CAAC2B;IAC5B3B,UAAU,iBAAiB,CAAC4B;IAC5B5B,UAAU,iBAAiB,CAAC6B;IAC5B7B,UAAU,iBAAiB,CAAC8B;IAC5B9B,UAAU,iBAAiB,CAAC+B;IAC5B/B,UAAU,iBAAiB,CAACgC;IAC5BhC,UAAU,iBAAiB,CAACiC;IAC5BjC,UAAU,iBAAiB,CAACkC;IAG5BlC,UAAU,iBAAiB,CAACmC;IAC5BnC,UAAU,iBAAiB,CAACoC;IAC5BpC,UAAU,iBAAiB,CAACqC;IAC5BrC,UAAU,iBAAiB,CAACsC;IAC5BtC,UAAU,iBAAiB,CAACuC;IAG5BvC,UAAU,iBAAiB,CAACwC;AAChC"}
@@ -0,0 +1,9 @@
1
+ import { Pulumi } from "@webiny/pulumi-sdk";
2
+ import { GetProjectService, GetPulumiService, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
3
+ export declare class DefaultGetPulumiService implements GetPulumiService.Interface {
4
+ private readonly getProjectService;
5
+ private readonly projectSdkParamsService;
6
+ constructor(getProjectService: GetProjectService.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
7
+ execute(params?: GetPulumiService.Params): Promise<Pulumi>;
8
+ }
9
+ export declare const getPulumiService: import("@webiny/di").Implementation<typeof DefaultGetPulumiService>;
@@ -0,0 +1,44 @@
1
+ import { Pulumi } from "@webiny/pulumi-sdk";
2
+ import { createImplementation } from "@webiny/di";
3
+ import { GetProjectService, GetPulumiService, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
4
+ import { WBY_PROJECT_SDK_CONTEXT, serializeProjectSdkContext } from "@webiny/project/utils/index.js";
5
+ class DefaultGetPulumiService {
6
+ constructor(getProjectService, projectSdkParamsService){
7
+ this.getProjectService = getProjectService;
8
+ this.projectSdkParamsService = projectSdkParamsService;
9
+ }
10
+ async execute(params = {}) {
11
+ const project = this.getProjectService.execute();
12
+ const { app, pulumiOptions = {} } = params;
13
+ let cwd;
14
+ if (app) cwd = app.paths.workspaceFolder.toString();
15
+ const sdkParams = this.projectSdkParamsService.get();
16
+ const contextEnv = {
17
+ [WBY_PROJECT_SDK_CONTEXT]: serializeProjectSdkContext(sdkParams)
18
+ };
19
+ const mergedExeca = {
20
+ ...pulumiOptions.execa,
21
+ cwd,
22
+ env: {
23
+ ...pulumiOptions.execa?.env,
24
+ ...contextEnv
25
+ }
26
+ };
27
+ return Pulumi.create({
28
+ ...pulumiOptions,
29
+ execa: mergedExeca,
30
+ pulumiFolder: project.paths.dotWebinyFolder.toString()
31
+ });
32
+ }
33
+ }
34
+ const getPulumiService = createImplementation({
35
+ abstraction: GetPulumiService,
36
+ implementation: DefaultGetPulumiService,
37
+ dependencies: [
38
+ GetProjectService,
39
+ ProjectSdkParamsService
40
+ ]
41
+ });
42
+ export { DefaultGetPulumiService, getPulumiService };
43
+
44
+ //# sourceMappingURL=GetPulumiService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services/GetPulumiService/GetPulumiService.js","sources":["../../../src/services/GetPulumiService/GetPulumiService.ts"],"sourcesContent":["import { Pulumi } from \"@webiny/pulumi-sdk\";\nimport { createImplementation } from \"@webiny/di\";\nimport {\n GetProjectService,\n GetPulumiService,\n ProjectSdkParamsService\n} from \"@webiny/project/abstractions/index.js\";\nimport {\n serializeProjectSdkContext,\n WBY_PROJECT_SDK_CONTEXT\n} from \"@webiny/project/utils/index.js\";\n\nexport class DefaultGetPulumiService implements GetPulumiService.Interface {\n constructor(\n private readonly getProjectService: GetProjectService.Interface,\n private readonly projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute(params: GetPulumiService.Params = {}) {\n const project = this.getProjectService.execute();\n const { app, pulumiOptions = {} } = params;\n\n let cwd;\n if (app) {\n cwd = app.paths.workspaceFolder.toString();\n }\n\n const sdkParams = this.projectSdkParamsService.get();\n const contextEnv = {\n [WBY_PROJECT_SDK_CONTEXT]: serializeProjectSdkContext(sdkParams)\n };\n\n const mergedExeca = {\n ...pulumiOptions.execa,\n cwd,\n env: {\n ...pulumiOptions.execa?.env,\n ...contextEnv\n }\n };\n\n return Pulumi.create({\n ...pulumiOptions,\n execa: mergedExeca,\n pulumiFolder: project.paths.dotWebinyFolder.toString()\n });\n }\n}\n\nexport const getPulumiService = createImplementation({\n abstraction: GetPulumiService,\n implementation: DefaultGetPulumiService,\n dependencies: [GetProjectService, ProjectSdkParamsService]\n});\n"],"names":["DefaultGetPulumiService","getProjectService","projectSdkParamsService","params","project","app","pulumiOptions","cwd","sdkParams","contextEnv","WBY_PROJECT_SDK_CONTEXT","serializeProjectSdkContext","mergedExeca","Pulumi","getPulumiService","createImplementation","GetPulumiService","GetProjectService","ProjectSdkParamsService"],"mappings":";;;;AAYO,MAAMA;IACT,YACqBC,iBAA8C,EAC9CC,uBAA0D,CAC7E;aAFmBD,iBAAiB,GAAjBA;aACAC,uBAAuB,GAAvBA;IAClB;IAEH,MAAM,QAAQC,SAAkC,CAAC,CAAC,EAAE;QAChD,MAAMC,UAAU,IAAI,CAAC,iBAAiB,CAAC,OAAO;QAC9C,MAAM,EAAEC,GAAG,EAAEC,gBAAgB,CAAC,CAAC,EAAE,GAAGH;QAEpC,IAAII;QACJ,IAAIF,KACAE,MAAMF,IAAI,KAAK,CAAC,eAAe,CAAC,QAAQ;QAG5C,MAAMG,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAMC,aAAa;YACf,CAACC,wBAAwB,EAAEC,2BAA2BH;QAC1D;QAEA,MAAMI,cAAc;YAChB,GAAGN,cAAc,KAAK;YACtBC;YACA,KAAK;gBACD,GAAGD,cAAc,KAAK,EAAE,GAAG;gBAC3B,GAAGG,UAAU;YACjB;QACJ;QAEA,OAAOI,OAAO,MAAM,CAAC;YACjB,GAAGP,aAAa;YAChB,OAAOM;YACP,cAAcR,QAAQ,KAAK,CAAC,eAAe,CAAC,QAAQ;QACxD;IACJ;AACJ;AAEO,MAAMU,mBAAmBC,qBAAqB;IACjD,aAAaC;IACb,gBAAgBhB;IAChB,cAAc;QAACiB;QAAmBC;KAAwB;AAC9D"}
@@ -0,0 +1 @@
1
+ export declare const getPulumiBaseTemplatesFolderPath: () => string;
@@ -0,0 +1,10 @@
1
+ import { dirname, join } from "path";
2
+ import { fileURLToPath } from "url";
3
+ const getPulumiBaseTemplatesFolderPath = ()=>{
4
+ const templatePackage = import.meta.resolve("@webiny/project-aws-template/package.json");
5
+ if (!templatePackage) throw new Error("Could not find the `@webiny/project-aws-template` package. Something went terribly wrong.");
6
+ return join(dirname(fileURLToPath(templatePackage)), "template");
7
+ };
8
+ export { getPulumiBaseTemplatesFolderPath };
9
+
10
+ //# sourceMappingURL=getPulumiBaseTemplatesFolderPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils/getPulumiBaseTemplatesFolderPath.js","sources":["../../src/utils/getPulumiBaseTemplatesFolderPath.ts"],"sourcesContent":["import { dirname, join } from \"path\";\nimport { fileURLToPath } from \"url\";\n\nexport const getPulumiBaseTemplatesFolderPath = () => {\n const templatePackage = import.meta.resolve(\"@webiny/project-aws-template/package.json\");\n\n if (!templatePackage) {\n throw new Error(\n \"Could not find the `@webiny/project-aws-template` package. Something went terribly wrong.\"\n );\n }\n\n return join(dirname(fileURLToPath(templatePackage)), \"template\");\n};\n"],"names":["getPulumiBaseTemplatesFolderPath","templatePackage","Error","join","dirname","fileURLToPath"],"mappings":";;AAGO,MAAMA,mCAAmC;IAC5C,MAAMC,kBAAkB,YAAY,OAAO,CAAC;IAE5C,IAAI,CAACA,iBACD,MAAM,IAAIC,MACN;IAIR,OAAOC,KAAKC,QAAQC,cAAcJ,mBAAmB;AACzD"}
package/utils/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { getTemplatesFolderPath } from "./getTemplatesFolderPath.js";
2
+ export { getPulumiBaseTemplatesFolderPath } from "./getPulumiBaseTemplatesFolderPath.js";
package/utils/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export { getTemplatesFolderPath } from "./getTemplatesFolderPath.js";
2
+ export { getPulumiBaseTemplatesFolderPath } from "./getPulumiBaseTemplatesFolderPath.js";
@@ -1,43 +0,0 @@
1
- import { authenticateUsingHttpHeader } from "@webiny/api-core/legacy/security/plugins/authenticateUsingHttpHeader.js";
2
- import apiKeyAuthentication from "@webiny/api-core/legacy/security/plugins/apiKeyAuthentication.js";
3
- import apiKeyAuthorization from "@webiny/api-core/legacy/security/plugins/apiKeyAuthorization.js";
4
-
5
- export default () => [
6
- // /**
7
- // * Sync Admin Users with Cognito User Pool.
8
- // */
9
- // syncWithCognito({
10
- // region: String(process.env.COGNITO_REGION),
11
- // userPoolId: String(process.env.COGNITO_USER_POOL_ID)
12
- // }),
13
-
14
- /**
15
- * Perform authentication using the common "Authorization" HTTP header.
16
- * This will fetch the value of the header, and execute the authentication process.
17
- */
18
- authenticateUsingHttpHeader(),
19
-
20
- /**
21
- * API Key authenticator.
22
- * API Keys are a standalone entity, and are not connected to users in any way.
23
- * They identify a project, a 3rd party client, not a particular user.
24
- * They are used for programmatic API access, CMS data import/export, etc.
25
- */
26
- apiKeyAuthentication({ identityType: "api-key" }),
27
-
28
- // /**
29
- // * Cognito authentication plugin.
30
- // * This plugin will verify the JWT token against the provided User Pool.
31
- // */
32
- // cognitoAuthentication({
33
- // region: String(process.env.COGNITO_REGION),
34
- // userPoolId: String(process.env.COGNITO_USER_POOL_ID),
35
- // identityType: "admin"
36
- // }),
37
-
38
- /**
39
- * Authorization plugin to fetch permissions for a verified API key.
40
- * The "identityType" must match the authentication plugin used to load the identity.
41
- */
42
- apiKeyAuthorization({ identityType: "api-key" })
43
- ];
@@ -1,10 +0,0 @@
1
- import { z } from "zod";
2
- export declare const Encryption: import("@webiny/project/defineExtension/defineExtension").ExtensionComponent<z.ZodObject<{
3
- passphrase: z.ZodString;
4
- salt: z.ZodOptional<z.ZodString>;
5
- algorithm: z.ZodOptional<z.ZodEnum<{
6
- "aes-128-gcm": "aes-128-gcm";
7
- "aes-192-gcm": "aes-192-gcm";
8
- "aes-256-gcm": "aes-256-gcm";
9
- }>>;
10
- }, z.core.$strip>>;
@@ -1,36 +0,0 @@
1
- import react from "react";
2
- import { z } from "zod";
3
- import { defineExtension } from "@webiny/project/defineExtension/index.js";
4
- import { BuildParam } from "@webiny/project/extensions/index.js";
5
- const SUPPORTED_ALGORITHMS = [
6
- "aes-128-gcm",
7
- "aes-192-gcm",
8
- "aes-256-gcm"
9
- ];
10
- const Encryption = defineExtension({
11
- type: "Infra/Encryption",
12
- tags: {
13
- runtimeContext: "project"
14
- },
15
- description: "Configure the API's EncryptionService.",
16
- paramsSchema: z.object({
17
- passphrase: z.string().min(1).describe("The passphrase used to derive the AES encryption key via scrypt."),
18
- salt: z.string().min(1).optional().describe("Optional scrypt salt. Ensures two projects using the same passphrase derive different encryption keys."),
19
- algorithm: z["enum"](SUPPORTED_ALGORITHMS).optional().describe("AES-GCM algorithm. Defaults to aes-256-gcm.")
20
- }),
21
- render ({ passphrase, salt, algorithm }) {
22
- return /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(BuildParam, {
23
- paramName: "EncryptionPassphrase",
24
- value: passphrase
25
- }), salt && /*#__PURE__*/ react.createElement(BuildParam, {
26
- paramName: "EncryptionSalt",
27
- value: salt
28
- }), algorithm && /*#__PURE__*/ react.createElement(BuildParam, {
29
- paramName: "EncryptionAlgorithm",
30
- value: algorithm
31
- }));
32
- }
33
- });
34
- export { Encryption };
35
-
36
- //# sourceMappingURL=Encryption.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extensions/Encryption.js","sources":["../../src/extensions/Encryption.tsx"],"sourcesContent":["import React from \"react\";\nimport { z } from \"zod\";\nimport { defineExtension } from \"@webiny/project/defineExtension/index.js\";\nimport { BuildParam } from \"@webiny/project/extensions/index.js\";\n\nconst SUPPORTED_ALGORITHMS = [\"aes-128-gcm\", \"aes-192-gcm\", \"aes-256-gcm\"] as const;\n\nexport const Encryption = defineExtension({\n type: \"Infra/Encryption\",\n tags: { runtimeContext: \"project\" },\n description: \"Configure the API's EncryptionService.\",\n paramsSchema: z.object({\n passphrase: z\n .string()\n .min(1)\n .describe(\"The passphrase used to derive the AES encryption key via scrypt.\"),\n salt: z\n .string()\n .min(1)\n .optional()\n .describe(\n \"Optional scrypt salt. Ensures two projects using the same passphrase derive different encryption keys.\"\n ),\n algorithm: z\n .enum(SUPPORTED_ALGORITHMS)\n .optional()\n .describe(\"AES-GCM algorithm. Defaults to aes-256-gcm.\")\n }),\n render({ passphrase, salt, algorithm }) {\n return (\n <>\n <BuildParam paramName=\"EncryptionPassphrase\" value={passphrase} />\n {salt && <BuildParam paramName=\"EncryptionSalt\" value={salt} />}\n {algorithm && <BuildParam paramName=\"EncryptionAlgorithm\" value={algorithm} />}\n </>\n );\n }\n});\n"],"names":["SUPPORTED_ALGORITHMS","Encryption","defineExtension","z","passphrase","salt","algorithm","BuildParam"],"mappings":";;;;AAKA,MAAMA,uBAAuB;IAAC;IAAe;IAAe;CAAc;AAEnE,MAAMC,aAAaC,gBAAgB;IACtC,MAAM;IACN,MAAM;QAAE,gBAAgB;IAAU;IAClC,aAAa;IACb,cAAcC,EAAE,MAAM,CAAC;QACnB,YAAYA,EAAAA,MACD,GACN,GAAG,CAAC,GACJ,QAAQ,CAAC;QACd,MAAMA,EAAAA,MACK,GACN,GAAG,CAAC,GACJ,QAAQ,GACR,QAAQ,CACL;QAER,WAAWA,CAAC,CAADA,OACF,CAACH,sBACL,QAAQ,GACR,QAAQ,CAAC;IAClB;IACA,QAAO,EAAEI,UAAU,EAAEC,IAAI,EAAEC,SAAS,EAAE;QAClC,OAAO,WAAP,GACI,wDACI,oBAACC,YAAUA;YAAC,WAAU;YAAuB,OAAOH;YACnDC,QAAQ,WAARA,GAAQ,oBAACE,YAAUA;YAAC,WAAU;YAAiB,OAAOF;YACtDC,aAAa,WAAbA,GAAa,oBAACC,YAAUA;YAAC,WAAU;YAAsB,OAAOD;;IAG7E;AACJ"}
@@ -1,14 +0,0 @@
1
- import type { getVpcConfigFromExtension } from "./getVpcConfigFromExtension.js";
2
- export type VpcExtensionConfig = ReturnType<typeof getVpcConfigFromExtension>;
3
- /**
4
- * Decides whether an app should use a VPC, from the `Infra.Vpc` extension config plus whether the
5
- * target environment is a production one.
6
- *
7
- * Production environments get a VPC by default. An explicit `<Infra.Vpc enabled={false} />` beats
8
- * that default: `enabled` is documented as a plain toggle, so ignoring it on production would
9
- * silently do the opposite of what the project config asks for.
10
- *
11
- * Shared by the core and api apps so the two cannot disagree — a mismatch would leave the api app's
12
- * Lambdas configured for subnets the core app never created.
13
- */
14
- export declare function isVpcEnabled(config: VpcExtensionConfig, isProduction: boolean): boolean;
@@ -1,8 +0,0 @@
1
- function isVpcEnabled(config, isProduction) {
2
- if (false === config) return false;
3
- if (true === config || "object" == typeof config) return true;
4
- return isProduction;
5
- }
6
- export { isVpcEnabled };
7
-
8
- //# sourceMappingURL=isVpcEnabled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pulumi/apps/extensions/isVpcEnabled.js","sources":["../../../../src/pulumi/apps/extensions/isVpcEnabled.ts"],"sourcesContent":["import type { getVpcConfigFromExtension } from \"./getVpcConfigFromExtension.js\";\n\nexport type VpcExtensionConfig = ReturnType<typeof getVpcConfigFromExtension>;\n\n/**\n * Decides whether an app should use a VPC, from the `Infra.Vpc` extension config plus whether the\n * target environment is a production one.\n *\n * Production environments get a VPC by default. An explicit `<Infra.Vpc enabled={false} />` beats\n * that default: `enabled` is documented as a plain toggle, so ignoring it on production would\n * silently do the opposite of what the project config asks for.\n *\n * Shared by the core and api apps so the two cannot disagree — a mismatch would leave the api app's\n * Lambdas configured for subnets the core app never created.\n */\nexport function isVpcEnabled(config: VpcExtensionConfig, isProduction: boolean): boolean {\n // Explicitly turned off via `<Infra.Vpc enabled={false} />`.\n if (config === false) {\n return false;\n }\n\n // Explicitly turned on, or given advanced params (useVpcEndpoints / useExistingVpc).\n if (config === true || typeof config === \"object\") {\n return true;\n }\n\n // No `Infra.Vpc` extension registered: a VPC is used for production environments only.\n return isProduction;\n}\n"],"names":["isVpcEnabled","config","isProduction"],"mappings":"AAeO,SAASA,aAAaC,MAA0B,EAAEC,YAAqB;IAE1E,IAAID,AAAW,UAAXA,QACA,OAAO;IAIX,IAAIA,AAAW,SAAXA,UAAmB,AAAkB,YAAlB,OAAOA,QAC1B,OAAO;IAIX,OAAOC;AACX"}