@webiny/pulumi-aws 5.43.3 → 6.0.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.
- package/apps/admin/createAdminPulumiApp.d.ts +3 -2
- package/apps/admin/createAdminPulumiApp.js +15 -1
- package/apps/admin/createAdminPulumiApp.js.map +1 -1
- package/apps/api/ApiApwScheduler.d.ts +1 -1
- package/apps/api/ApiApwScheduler.js.map +1 -1
- package/apps/api/ApiBackgroundTask.d.ts +1 -1
- package/apps/api/ApiBackgroundTask.js.map +1 -1
- package/apps/api/ApiCloudfront.d.ts +1 -1
- package/apps/api/ApiCloudfront.js.map +1 -1
- package/apps/api/ApiFileManager.d.ts +7 -1
- package/apps/api/ApiFileManager.js +6 -0
- package/apps/api/ApiFileManager.js.map +1 -1
- package/apps/api/ApiGateway.d.ts +2 -2
- package/apps/api/ApiGateway.js.map +1 -1
- package/apps/api/ApiGraphql.d.ts +1 -1
- package/apps/api/ApiGraphql.js.map +1 -1
- package/apps/api/ApiMigration.d.ts +1 -1
- package/apps/api/ApiMigration.js.map +1 -1
- package/apps/api/ApiOutput.d.ts +11 -1
- package/apps/api/ApiOutput.js +11 -1
- package/apps/api/ApiOutput.js.map +1 -1
- package/apps/api/ApiPageBuilder.d.ts +1 -1
- package/apps/api/ApiPageBuilder.js.map +1 -1
- package/apps/api/ApiScheduler.d.ts +8 -0
- package/apps/api/ApiScheduler.js +105 -0
- package/apps/api/ApiScheduler.js.map +1 -0
- package/apps/api/ApiWebsocket.d.ts +1 -1
- package/apps/api/ApiWebsocket.js.map +1 -1
- package/apps/api/backgroundTask/definition.d.ts +2 -2
- package/apps/api/backgroundTask/definition.js.map +1 -1
- package/apps/api/backgroundTask/policy.d.ts +2 -2
- package/apps/api/backgroundTask/policy.js.map +1 -1
- package/apps/api/backgroundTask/role.d.ts +2 -2
- package/apps/api/backgroundTask/role.js.map +1 -1
- package/apps/api/backgroundTask/types.d.ts +1 -1
- package/apps/api/backgroundTask/types.js.map +1 -1
- package/apps/api/createApiPulumiApp.d.ts +18 -9
- package/apps/api/createApiPulumiApp.js +48 -19
- package/apps/api/createApiPulumiApp.js.map +1 -1
- package/apps/awsUtils.d.ts +2 -2
- package/apps/awsUtils.js.map +1 -1
- package/apps/blueGreen/createBlueGreenPulumiApp.d.ts +7 -1
- package/apps/blueGreen/createBlueGreenPulumiApp.js +2 -2
- package/apps/blueGreen/createBlueGreenPulumiApp.js.map +1 -1
- package/apps/blueGreen/domains/attachDomainsToOutput.d.ts +1 -1
- package/apps/blueGreen/domains/attachDomainsToOutput.js.map +1 -1
- package/apps/blueGreen/types.d.ts +4 -1
- package/apps/blueGreen/types.js.map +1 -1
- package/apps/common/CoreOutput.d.ts +2 -1
- package/apps/common/CoreOutput.js +1 -0
- package/apps/common/CoreOutput.js.map +1 -1
- package/apps/common/VpcConfig.d.ts +1 -1
- package/apps/common/VpcConfig.js.map +1 -1
- package/apps/core/CoreCognito.d.ts +1 -1
- package/apps/core/CoreCognito.js.map +1 -1
- package/apps/core/CoreDynamo.d.ts +1 -1
- package/apps/core/CoreDynamo.js.map +1 -1
- package/apps/core/CoreElasticSearch.d.ts +1 -1
- package/apps/core/CoreElasticSearch.js.map +1 -1
- package/apps/core/CoreEventBus.js.map +1 -1
- package/apps/core/CoreFileManager.d.ts +1 -1
- package/apps/core/CoreFileManager.js.map +1 -1
- package/apps/core/CoreOpenSearch.d.ts +1 -1
- package/apps/core/CoreOpenSearch.js.map +1 -1
- package/apps/core/CoreVpc.d.ts +1 -1
- package/apps/core/CoreVpc.js.map +1 -1
- package/apps/core/LogDynamo.d.ts +1 -1
- package/apps/core/LogDynamo.js.map +1 -1
- package/apps/core/WatchCommand.js.map +1 -1
- package/apps/core/cognitoIdentityProviders/amazon.d.ts +3 -3
- package/apps/core/cognitoIdentityProviders/amazon.js.map +1 -1
- package/apps/core/cognitoIdentityProviders/apple.d.ts +3 -3
- package/apps/core/cognitoIdentityProviders/apple.js.map +1 -1
- package/apps/core/cognitoIdentityProviders/configure.d.ts +3 -3
- package/apps/core/cognitoIdentityProviders/configure.js.map +1 -1
- package/apps/core/cognitoIdentityProviders/facebook.d.ts +3 -3
- package/apps/core/cognitoIdentityProviders/facebook.js.map +1 -1
- package/apps/core/cognitoIdentityProviders/getIdpConfig.d.ts +2 -2
- package/apps/core/cognitoIdentityProviders/getIdpConfig.js.map +1 -1
- package/apps/core/cognitoIdentityProviders/google.d.ts +3 -3
- package/apps/core/cognitoIdentityProviders/google.js.map +1 -1
- package/apps/core/cognitoIdentityProviders/oidc.d.ts +3 -3
- package/apps/core/cognitoIdentityProviders/oidc.js.map +1 -1
- package/apps/core/createCorePulumiApp.d.ts +1 -1
- package/apps/core/createCorePulumiApp.js +2 -1
- package/apps/core/createCorePulumiApp.js.map +1 -1
- package/apps/createAppBucket.d.ts +1 -1
- package/apps/createAppBucket.js.map +1 -1
- package/apps/customDomain.d.ts +3 -3
- package/apps/customDomain.js.map +1 -1
- package/apps/lambdaUtils.d.ts +3 -2
- package/apps/lambdaUtils.js +21 -3
- package/apps/lambdaUtils.js.map +1 -1
- package/apps/react/createReactPulumiApp.d.ts +2 -2
- package/apps/react/createReactPulumiApp.js.map +1 -1
- package/apps/syncSystem/SyncSystemDynamo.d.ts +1 -1
- package/apps/syncSystem/SyncSystemDynamo.js.map +1 -1
- package/apps/syncSystem/SyncSystemDynamoDb.d.ts +3 -0
- package/apps/syncSystem/SyncSystemDynamoDb.js +55 -0
- package/apps/syncSystem/SyncSystemDynamoDb.js.map +1 -0
- package/apps/syncSystem/SyncSystemEventBus.d.ts +6 -0
- package/apps/syncSystem/SyncSystemEventBus.js +84 -0
- package/apps/syncSystem/SyncSystemEventBus.js.map +1 -0
- package/apps/syncSystem/SyncSystemLambda.d.ts +1 -1
- package/apps/syncSystem/SyncSystemLambda.js.map +1 -1
- package/apps/syncSystem/SyncSystemOutput.d.ts +3 -0
- package/apps/syncSystem/SyncSystemOutput.js +26 -0
- package/apps/syncSystem/SyncSystemOutput.js.map +1 -0
- package/apps/syncSystem/SyncSystemResolverLambda.d.ts +8 -0
- package/apps/syncSystem/SyncSystemResolverLambda.js +78 -0
- package/apps/syncSystem/SyncSystemResolverLambda.js.map +1 -0
- package/apps/syncSystem/SyncSystemSQS.d.ts +3 -4
- package/apps/syncSystem/SyncSystemSQS.js +33 -12
- package/apps/syncSystem/SyncSystemSQS.js.map +1 -1
- package/apps/syncSystem/SyncSystemWorkerLambda.d.ts +7 -0
- package/apps/syncSystem/SyncSystemWorkerLambda.js +57 -0
- package/apps/syncSystem/SyncSystemWorkerLambda.js.map +1 -0
- package/apps/syncSystem/api/addServiceManifest.d.ts +8 -0
- package/apps/syncSystem/api/addServiceManifest.js +25 -0
- package/apps/syncSystem/api/addServiceManifest.js.map +1 -0
- package/apps/syncSystem/api/attachCognitoPermissions.d.ts +14 -0
- package/apps/syncSystem/api/attachCognitoPermissions.js +67 -0
- package/apps/syncSystem/api/attachCognitoPermissions.js.map +1 -0
- package/apps/syncSystem/api/attachDynamoDbPermissions.d.ts +13 -0
- package/apps/syncSystem/api/attachDynamoDbPermissions.js +53 -0
- package/apps/syncSystem/api/attachDynamoDbPermissions.js.map +1 -0
- package/apps/syncSystem/api/attachEventBusPermissions.d.ts +18 -0
- package/apps/syncSystem/api/attachEventBusPermissions.js +66 -0
- package/apps/syncSystem/api/attachEventBusPermissions.js.map +1 -0
- package/apps/syncSystem/api/attachS3Permissions.d.ts +14 -0
- package/apps/syncSystem/api/attachS3Permissions.js +59 -0
- package/apps/syncSystem/api/attachS3Permissions.js.map +1 -0
- package/apps/syncSystem/api/index.d.ts +9 -0
- package/apps/syncSystem/api/index.js +65 -0
- package/apps/syncSystem/api/index.js.map +1 -0
- package/apps/syncSystem/constants.d.ts +1 -0
- package/apps/syncSystem/constants.js +9 -0
- package/apps/syncSystem/constants.js.map +1 -0
- package/apps/syncSystem/createSyncResourceName.d.ts +4 -0
- package/apps/syncSystem/createSyncResourceName.js +17 -0
- package/apps/syncSystem/createSyncResourceName.js.map +1 -0
- package/apps/syncSystem/createSyncSystemPulumiApp.d.ts +19 -10
- package/apps/syncSystem/createSyncSystemPulumiApp.js +107 -34
- package/apps/syncSystem/createSyncSystemPulumiApp.js.map +1 -1
- package/apps/syncSystem/customApp.d.ts +6 -0
- package/apps/syncSystem/customApp.js +26 -0
- package/apps/syncSystem/customApp.js.map +1 -0
- package/apps/syncSystem/getSyncSystemOutput.d.ts +6 -0
- package/apps/syncSystem/getSyncSystemOutput.js +28 -0
- package/apps/syncSystem/getSyncSystemOutput.js.map +1 -0
- package/apps/syncSystem/lambda/createSyncSystemResolverLambdaPolicy.d.ts +7 -0
- package/apps/syncSystem/lambda/createSyncSystemResolverLambdaPolicy.js +55 -0
- package/apps/syncSystem/lambda/createSyncSystemResolverLambdaPolicy.js.map +1 -0
- package/apps/syncSystem/types.d.ts +55 -0
- package/apps/syncSystem/types.js +7 -0
- package/apps/syncSystem/types.js.map +1 -0
- package/apps/tenantRouter.d.ts +1 -1
- package/apps/tenantRouter.js.map +1 -1
- package/apps/website/WebsitePrerendering.d.ts +1 -1
- package/apps/website/WebsitePrerendering.js.map +1 -1
- package/apps/website/createWebsitePulumiApp.d.ts +2 -2
- package/apps/website/createWebsitePulumiApp.js.map +1 -1
- package/enterprise/api/handleGuardDutyEvents.d.ts +1 -1
- package/enterprise/api/handleGuardDutyEvents.js.map +1 -1
- package/enterprise/createApiPulumiApp.d.ts +13 -2
- package/enterprise/createApiPulumiApp.js.map +1 -1
- package/enterprise/createCorePulumiApp.d.ts +2 -2
- package/enterprise/createCorePulumiApp.js.map +1 -1
- package/enterprise/createSyncSystemPulumiApp.d.ts +13 -8
- package/enterprise/createSyncSystemPulumiApp.js +1 -1
- package/enterprise/createSyncSystemPulumiApp.js.map +1 -1
- package/enterprise/createWebsitePulumiApp.d.ts +2 -2
- package/enterprise/createWebsitePulumiApp.js.map +1 -1
- package/package.json +12 -12
- package/utils/addDomainsUrlsOutputs.d.ts +2 -2
- package/utils/addDomainsUrlsOutputs.js.map +1 -1
- package/utils/addServiceManifestTableItem.d.ts +1 -1
- package/utils/addServiceManifestTableItem.js.map +1 -1
- package/utils/createAssetArchive.d.ts +2 -0
- package/utils/createAssetArchive.js +16 -0
- package/utils/createAssetArchive.js.map +1 -0
- package/utils/getPresignedPost.d.ts +1 -1
- package/utils/getPresignedPost.js.map +1 -1
- package/utils/lambdaEnvVariables.d.ts +1 -1
- package/utils/lambdaEnvVariables.js.map +1 -1
- package/utils/uploadFolderToS3.d.ts +1 -1
- package/utils/uploadFolderToS3.js.map +1 -1
- package/utils/withServiceManifest.d.ts +2 -2
- package/utils/withServiceManifest.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StepFunctionDefinitionStatesType","exports"],"sources":["types.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\n\n/**\n * Update types if required. Try to avoid generic objects\n */\nexport enum StepFunctionDefinitionStatesType {\n Task = \"Task\",\n Pass = \"Pass\",\n Choice = \"Choice\",\n Wait = \"Wait\",\n Fail = \"Fail\",\n Succeed = \"Succeed\"\n}\n\nexport interface StepFunctionDefinitionStatesCatch {\n ErrorEquals: string[];\n Next: string;\n ResultPath?: string;\n}\n\nexport interface StepFunctionDefinitionStatesChoiceBase {\n Variable: string;\n Next: string;\n StringEquals?: string;\n StringMatches?: string;\n IsPresent?: boolean;\n IsNull?: boolean;\n}\n\nexport interface StepFunctionDefinitionStatesChoiceAndItem {\n Variable: string;\n StringEquals?: string;\n StringMatches?: string;\n IsPresent?: boolean;\n IsTimestamp?: boolean;\n IsNumeric?: boolean;\n NumericGreaterThan?: number;\n}\nexport interface StepFunctionDefinitionStatesChoiceAnd {\n And: StepFunctionDefinitionStatesChoiceAndItem[];\n Next: string;\n}\n\nexport type StepFunctionDefinitionStatesChoice =\n | StepFunctionDefinitionStatesChoiceBase\n | StepFunctionDefinitionStatesChoiceAnd;\n\nexport interface StepFunctionDefinitionStatesTypeBase {\n Type: StepFunctionDefinitionStatesType;\n Comment?: string;\n InputPath?: string;\n OutputPath?: string;\n}\n\nexport interface StepFunctionDefinitionStatesTypeTask extends StepFunctionDefinitionStatesTypeBase {\n Type: StepFunctionDefinitionStatesType.Task;\n Resource: pulumi.Input<string>;\n Next: string;\n ResultPath?: string;\n Parameters: Record<string, any>;\n Catch: StepFunctionDefinitionStatesCatch[];\n End?: boolean;\n}\n\nexport interface StepFunctionDefinitionStatesTypePass extends StepFunctionDefinitionStatesTypeBase {\n Type: StepFunctionDefinitionStatesType.Pass;\n Next: string;\n ResultPath?: string;\n Parameters: Record<string, any>;\n End?: boolean;\n}\n\nexport interface StepFunctionDefinitionStatesTypeChoice\n extends StepFunctionDefinitionStatesTypeBase {\n Type: StepFunctionDefinitionStatesType.Choice;\n Choices: StepFunctionDefinitionStatesChoice[];\n Default?: string;\n}\n\nexport interface StepFunctionDefinitionStatesTypeFail extends StepFunctionDefinitionStatesTypeBase {\n Type: StepFunctionDefinitionStatesType.Fail;\n Error?: string;\n Cause?: string;\n CausePath?: string;\n ErrorPath?: string;\n}\n\nexport interface StepFunctionDefinitionStatesTypeSucceed\n extends StepFunctionDefinitionStatesTypeBase {\n Type: StepFunctionDefinitionStatesType.Succeed;\n}\n\nexport interface StepFunctionDefinitionStatesTypeWait extends StepFunctionDefinitionStatesTypeBase {\n Next: string;\n Seconds?: number;\n Timestamp?: string;\n SecondsPath?: string;\n TimestampPath?: string;\n}\n\nexport type StepFunctionDefinitionStatesTypes =\n | StepFunctionDefinitionStatesTypeTask\n | StepFunctionDefinitionStatesTypePass\n | StepFunctionDefinitionStatesTypeChoice\n | StepFunctionDefinitionStatesTypeFail\n | StepFunctionDefinitionStatesTypeSucceed\n | StepFunctionDefinitionStatesTypeWait;\n\nexport interface StepFunctionDefinition {\n Comment: string;\n StartAt: string;\n States: {\n [key: string]: StepFunctionDefinitionStatesTypes;\n };\n}\n"],"mappings":";;;;;;AAEA;AACA;AACA;AAFA,IAGYA,gCAAgC,GAAAC,OAAA,CAAAD,gCAAA,0BAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAA,OAAhCA,gCAAgC;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["StepFunctionDefinitionStatesType","exports"],"sources":["types.ts"],"sourcesContent":["import type * as pulumi from \"@pulumi/pulumi\";\n\n/**\n * Update types if required. Try to avoid generic objects\n */\nexport enum StepFunctionDefinitionStatesType {\n Task = \"Task\",\n Pass = \"Pass\",\n Choice = \"Choice\",\n Wait = \"Wait\",\n Fail = \"Fail\",\n Succeed = \"Succeed\"\n}\n\nexport interface StepFunctionDefinitionStatesCatch {\n ErrorEquals: string[];\n Next: string;\n ResultPath?: string;\n}\n\nexport interface StepFunctionDefinitionStatesChoiceBase {\n Variable: string;\n Next: string;\n StringEquals?: string;\n StringMatches?: string;\n IsPresent?: boolean;\n IsNull?: boolean;\n}\n\nexport interface StepFunctionDefinitionStatesChoiceAndItem {\n Variable: string;\n StringEquals?: string;\n StringMatches?: string;\n IsPresent?: boolean;\n IsTimestamp?: boolean;\n IsNumeric?: boolean;\n NumericGreaterThan?: number;\n}\nexport interface StepFunctionDefinitionStatesChoiceAnd {\n And: StepFunctionDefinitionStatesChoiceAndItem[];\n Next: string;\n}\n\nexport type StepFunctionDefinitionStatesChoice =\n | StepFunctionDefinitionStatesChoiceBase\n | StepFunctionDefinitionStatesChoiceAnd;\n\nexport interface StepFunctionDefinitionStatesTypeBase {\n Type: StepFunctionDefinitionStatesType;\n Comment?: string;\n InputPath?: string;\n OutputPath?: string;\n}\n\nexport interface StepFunctionDefinitionStatesTypeTask extends StepFunctionDefinitionStatesTypeBase {\n Type: StepFunctionDefinitionStatesType.Task;\n Resource: pulumi.Input<string>;\n Next: string;\n ResultPath?: string;\n Parameters: Record<string, any>;\n Catch: StepFunctionDefinitionStatesCatch[];\n End?: boolean;\n}\n\nexport interface StepFunctionDefinitionStatesTypePass extends StepFunctionDefinitionStatesTypeBase {\n Type: StepFunctionDefinitionStatesType.Pass;\n Next: string;\n ResultPath?: string;\n Parameters: Record<string, any>;\n End?: boolean;\n}\n\nexport interface StepFunctionDefinitionStatesTypeChoice\n extends StepFunctionDefinitionStatesTypeBase {\n Type: StepFunctionDefinitionStatesType.Choice;\n Choices: StepFunctionDefinitionStatesChoice[];\n Default?: string;\n}\n\nexport interface StepFunctionDefinitionStatesTypeFail extends StepFunctionDefinitionStatesTypeBase {\n Type: StepFunctionDefinitionStatesType.Fail;\n Error?: string;\n Cause?: string;\n CausePath?: string;\n ErrorPath?: string;\n}\n\nexport interface StepFunctionDefinitionStatesTypeSucceed\n extends StepFunctionDefinitionStatesTypeBase {\n Type: StepFunctionDefinitionStatesType.Succeed;\n}\n\nexport interface StepFunctionDefinitionStatesTypeWait extends StepFunctionDefinitionStatesTypeBase {\n Next: string;\n Seconds?: number;\n Timestamp?: string;\n SecondsPath?: string;\n TimestampPath?: string;\n}\n\nexport type StepFunctionDefinitionStatesTypes =\n | StepFunctionDefinitionStatesTypeTask\n | StepFunctionDefinitionStatesTypePass\n | StepFunctionDefinitionStatesTypeChoice\n | StepFunctionDefinitionStatesTypeFail\n | StepFunctionDefinitionStatesTypeSucceed\n | StepFunctionDefinitionStatesTypeWait;\n\nexport interface StepFunctionDefinition {\n Comment: string;\n StartAt: string;\n States: {\n [key: string]: StepFunctionDefinitionStatesTypes;\n };\n}\n"],"mappings":";;;;;;AAEA;AACA;AACA;AAFA,IAGYA,gCAAgC,GAAAC,OAAA,CAAAD,gCAAA,0BAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;EAAA,OAAhCA,gCAAgC;AAAA","ignoreList":[]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { PulumiAppParam, PulumiAppParamCallback } from "@webiny/pulumi";
|
|
2
|
-
import {
|
|
1
|
+
import type { PulumiAppParam, PulumiAppParamCallback } from "@webiny/pulumi";
|
|
2
|
+
import { type PulumiApp } from "@webiny/pulumi";
|
|
3
|
+
import type { CustomDomainParams } from "../customDomain";
|
|
4
|
+
import type { WithServiceManifest } from "../../utils/withServiceManifest.js";
|
|
3
5
|
export type ApiPulumiApp = ReturnType<typeof createApiPulumiApp>;
|
|
4
6
|
export interface ApiElasticsearchConfig {
|
|
5
7
|
domainName: string;
|
|
@@ -45,8 +47,14 @@ export interface CreateApiPulumiAppParams {
|
|
|
45
47
|
*/
|
|
46
48
|
productionEnvironments?: PulumiAppParam<string[]>;
|
|
47
49
|
}
|
|
48
|
-
export declare const createApiPulumiApp: (projectAppParams?: CreateApiPulumiAppParams) =>
|
|
50
|
+
export declare const createApiPulumiApp: (projectAppParams?: CreateApiPulumiAppParams) => PulumiApp<{
|
|
49
51
|
fileManager: {
|
|
52
|
+
roles: {
|
|
53
|
+
manage: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/iam/role").Role>;
|
|
54
|
+
};
|
|
55
|
+
policies: {
|
|
56
|
+
manage: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/iam/policy").Policy>;
|
|
57
|
+
};
|
|
50
58
|
functions: {
|
|
51
59
|
manage: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/lambda/function").Function>;
|
|
52
60
|
download: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/lambda/function").Function>;
|
|
@@ -94,11 +102,7 @@ export declare const createApiPulumiApp: (projectAppParams?: CreateApiPulumiAppP
|
|
|
94
102
|
policy: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/iam/policy").Policy>;
|
|
95
103
|
lambda: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/lambda/function").Function>;
|
|
96
104
|
};
|
|
97
|
-
eventRule: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/cloudwatch/eventRule").EventRule>;
|
|
98
|
-
* Treats provided environments as production environments, which
|
|
99
|
-
* are deployed in production deployment mode.
|
|
100
|
-
* https://www.webiny.com/docs/architecture/deployment-modes/production
|
|
101
|
-
*/
|
|
105
|
+
eventRule: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/cloudwatch/eventRule").EventRule>;
|
|
102
106
|
eventTarget: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/cloudwatch/eventTarget").EventTarget>;
|
|
103
107
|
};
|
|
104
108
|
migration: {
|
|
@@ -113,4 +117,9 @@ export declare const createApiPulumiApp: (projectAppParams?: CreateApiPulumiAppP
|
|
|
113
117
|
eventRolePolicyAttachment: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/iam/rolePolicyAttachment").RolePolicyAttachment>;
|
|
114
118
|
eventTarget: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/cloudwatch/eventTarget").EventTarget>;
|
|
115
119
|
};
|
|
116
|
-
|
|
120
|
+
scheduler: {
|
|
121
|
+
invokeRole: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/iam/role").Role>;
|
|
122
|
+
invokePolicy: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/iam/rolePolicy").RolePolicy>;
|
|
123
|
+
policyAttachment: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/iam/rolePolicyAttachment").RolePolicyAttachment>;
|
|
124
|
+
};
|
|
125
|
+
}> & import("../lambdaUtils").WithCommonLambdaEnvVariables & WithServiceManifest;
|
|
@@ -15,7 +15,9 @@ var _variant = require("../../env/variant");
|
|
|
15
15
|
var _env = require("../../env/env");
|
|
16
16
|
var _projectName = require("../../env/projectName");
|
|
17
17
|
var _awsRegion = require("../../env/awsRegion");
|
|
18
|
+
var _index = require("../syncSystem/api/index.js");
|
|
18
19
|
var _awsUtils = require("../awsUtils");
|
|
20
|
+
var _ApiScheduler = require("./ApiScheduler.js");
|
|
19
21
|
const createApiPulumiApp = (projectAppParams = {}) => {
|
|
20
22
|
const baseApp = (0, _pulumi.createPulumiApp)({
|
|
21
23
|
name: "api",
|
|
@@ -69,21 +71,25 @@ const createApiPulumiApp = (projectAppParams = {}) => {
|
|
|
69
71
|
app.addModule(_.VpcConfig, {
|
|
70
72
|
enabled: vpcEnabled
|
|
71
73
|
});
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
74
|
+
|
|
75
|
+
// const pageBuilder = app.addModule(ApiPageBuilder, {
|
|
76
|
+
// env: {
|
|
77
|
+
// COGNITO_REGION: getEnvVariableAwsRegion(),
|
|
78
|
+
// COGNITO_USER_POOL_ID: core.cognitoUserPoolId,
|
|
79
|
+
// DB_TABLE: core.primaryDynamodbTableName,
|
|
80
|
+
// DB_TABLE_LOG: core.logDynamodbTableName,
|
|
81
|
+
// DB_TABLE_ELASTICSEARCH: core.elasticsearchDynamodbTableName,
|
|
82
|
+
// ELASTIC_SEARCH_ENDPOINT: core.elasticsearchDomainEndpoint,
|
|
83
|
+
//
|
|
84
|
+
// // Not required. Useful for testing purposes / ephemeral environments.
|
|
85
|
+
// // https://www.webiny.com/docs/key-topics/ci-cd/testing/slow-ephemeral-environments
|
|
86
|
+
// ELASTIC_SEARCH_INDEX_PREFIX: process.env.ELASTIC_SEARCH_INDEX_PREFIX,
|
|
87
|
+
// ELASTICSEARCH_SHARED_INDEXES: process.env.ELASTICSEARCH_SHARED_INDEXES,
|
|
88
|
+
//
|
|
89
|
+
// S3_BUCKET: core.fileManagerBucketId
|
|
90
|
+
// }
|
|
91
|
+
// });
|
|
92
|
+
|
|
87
93
|
const apwScheduler = app.addModule(_.ApiApwScheduler, {
|
|
88
94
|
primaryDynamodbTableArn: core.primaryDynamodbTableArn,
|
|
89
95
|
env: {
|
|
@@ -108,8 +114,8 @@ const createApiPulumiApp = (projectAppParams = {}) => {
|
|
|
108
114
|
ELASTICSEARCH_SHARED_INDEXES: process.env.ELASTICSEARCH_SHARED_INDEXES,
|
|
109
115
|
S3_BUCKET: core.fileManagerBucketId,
|
|
110
116
|
EVENT_BUS: core.eventBusArn,
|
|
111
|
-
IMPORT_CREATE_HANDLER: pageBuilder.import.functions.create.output.arn,
|
|
112
|
-
EXPORT_PROCESS_HANDLER: pageBuilder.export.functions.process.output.arn,
|
|
117
|
+
// IMPORT_CREATE_HANDLER: pageBuilder.import.functions.create.output.arn,
|
|
118
|
+
// EXPORT_PROCESS_HANDLER: pageBuilder.export.functions.process.output.arn,
|
|
113
119
|
// TODO: move to okta plugin
|
|
114
120
|
OKTA_ISSUER: process.env["OKTA_ISSUER"],
|
|
115
121
|
APW_SCHEDULER_SCHEDULE_ACTION_HANDLER: apwScheduler.scheduleAction.lambda.output.arn
|
|
@@ -164,6 +170,7 @@ const createApiPulumiApp = (projectAppParams = {}) => {
|
|
|
164
170
|
const cloudfront = app.addModule(_.ApiCloudfront);
|
|
165
171
|
const backgroundTask = app.addModule(_.ApiBackgroundTask);
|
|
166
172
|
const migration = app.addModule(_.ApiMigration);
|
|
173
|
+
const scheduler = app.addModule(_ApiScheduler.ApiScheduler);
|
|
167
174
|
const domains = app.getParam(projectAppParams.domains);
|
|
168
175
|
if (domains) {
|
|
169
176
|
(0, _customDomain.applyCustomDomain)(cloudfront, domains);
|
|
@@ -182,10 +189,16 @@ const createApiPulumiApp = (projectAppParams = {}) => {
|
|
|
182
189
|
migrationLambdaArn: migration.function.output.arn,
|
|
183
190
|
graphqlLambdaName: graphql.functions.graphql.output.name,
|
|
184
191
|
graphqlLambdaRole: graphql.role.output.arn,
|
|
192
|
+
graphqlLambdaRoleName: graphql.role.output.name,
|
|
185
193
|
backgroundTaskLambdaArn: backgroundTask.backgroundTask.output.arn,
|
|
186
194
|
backgroundTaskStepFunctionArn: backgroundTask.stepFunction.output.arn,
|
|
195
|
+
fileManagerManageLambdaArn: fileManager.functions.manage.output.arn,
|
|
196
|
+
fileManagerManageLambdaRole: fileManager.roles.manage.output.arn,
|
|
197
|
+
fileManagerManageLambdaRoleName: fileManager.roles.manage.output.name,
|
|
198
|
+
fileManagerDownloadLambdaArn: fileManager.functions.download.output.arn,
|
|
187
199
|
websocketApiId: websocket.websocketApi.output.id,
|
|
188
|
-
websocketApiUrl: websocket.websocketApiUrl
|
|
200
|
+
websocketApiUrl: websocket.websocketApiUrl,
|
|
201
|
+
schedulerLambdaInvokeRole: scheduler.invokeRole.output.arn
|
|
189
202
|
});
|
|
190
203
|
|
|
191
204
|
// Only add `dynamoDbElasticsearchTable` output if using search engine (ES/OS).
|
|
@@ -206,6 +219,14 @@ const createApiPulumiApp = (projectAppParams = {}) => {
|
|
|
206
219
|
}
|
|
207
220
|
});
|
|
208
221
|
});
|
|
222
|
+
/**
|
|
223
|
+
* We need to attach the Sync System if it exists.
|
|
224
|
+
*/
|
|
225
|
+
(0, _index.attachSyncSystem)({
|
|
226
|
+
app,
|
|
227
|
+
core,
|
|
228
|
+
env: app.params.run.env
|
|
229
|
+
});
|
|
209
230
|
(0, _utils.tagResources)({
|
|
210
231
|
WbyProjectName: (0, _projectName.getEnvVariableWebinyProjectName)(),
|
|
211
232
|
WbyEnvironment: (0, _env.getEnvVariableWebinyEnv)(),
|
|
@@ -219,7 +240,8 @@ const createApiPulumiApp = (projectAppParams = {}) => {
|
|
|
219
240
|
cloudfront,
|
|
220
241
|
apwScheduler,
|
|
221
242
|
migration,
|
|
222
|
-
backgroundTask
|
|
243
|
+
backgroundTask,
|
|
244
|
+
scheduler
|
|
223
245
|
};
|
|
224
246
|
}
|
|
225
247
|
});
|
|
@@ -234,6 +256,13 @@ const createApiPulumiApp = (projectAppParams = {}) => {
|
|
|
234
256
|
}
|
|
235
257
|
}
|
|
236
258
|
});
|
|
259
|
+
app.addServiceManifest({
|
|
260
|
+
name: "scheduler",
|
|
261
|
+
manifest: {
|
|
262
|
+
lambdaArn: baseApp.resources.graphql.functions.graphql.output.arn,
|
|
263
|
+
roleArn: baseApp.resources.scheduler.invokeRole.output.arn
|
|
264
|
+
}
|
|
265
|
+
});
|
|
237
266
|
});
|
|
238
267
|
return app;
|
|
239
268
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["aws","_interopRequireWildcard","require","_pulumi","_","_customDomain","_utils","_constants","_variant","_env","_projectName","_awsRegion","_awsUtils","createApiPulumiApp","projectAppParams","baseApp","createPulumiApp","name","path","config","program","app","searchEngineParams","openSearch","getParam","elasticSearch","params","domainName","process","env","AWS_ELASTIC_SEARCH_DOMAIN_NAME","indexPrefix","ELASTIC_SEARCH_INDEX_PREFIX","sharedIndexes","ELASTICSEARCH_SHARED_INDEXES","pulumiResourceNamePrefix","onResource","resource","startsWith","pulumi","addHandler","productionEnvironments","create","DEFAULT_PROD_ENV_NAMES","isProduction","includes","run","core","addModule","CoreOutput","vpcEnabled","vpc","VpcConfig","enabled","pageBuilder","ApiPageBuilder","COGNITO_REGION","getEnvVariableAwsRegion","COGNITO_USER_POOL_ID","cognitoUserPoolId","DB_TABLE","primaryDynamodbTableName","DB_TABLE_LOG","logDynamodbTableName","DB_TABLE_ELASTICSEARCH","elasticsearchDynamodbTableName","ELASTIC_SEARCH_ENDPOINT","elasticsearchDomainEndpoint","S3_BUCKET","fileManagerBucketId","apwScheduler","ApiApwScheduler","primaryDynamodbTableArn","graphql","ApiGraphql","EVENT_BUS","eventBusArn","IMPORT_CREATE_HANDLER","import","functions","output","arn","EXPORT_PROCESS_HANDLER","export","OKTA_ISSUER","APW_SCHEDULER_SCHEDULE_ACTION_HANDLER","scheduleAction","lambda","apwSchedulerEventRule","eventRule","apwSchedulerEventTarget","eventTarget","websocket","ApiWebsocket","fileManager","ApiFileManager","apiGateway","ApiGateway","method","function","download","cloudfront","ApiCloudfront","backgroundTask","ApiBackgroundTask","migration","ApiMigration","domains","applyCustomDomain","addOutputs","awsAccountId","getAwsAccountId","region","cognitoAppClientId","cognitoUserPoolPasswordPolicy","apwSchedulerScheduleAction","apwSchedulerExecuteAction","executeAction","apwSchedulerEventTargetId","targetId","dynamoDbTable","migrationLambdaArn","graphqlLambdaName","graphqlLambdaRole","role","backgroundTaskLambdaArn","backgroundTaskStepFunctionArn","stepFunction","websocketApiId","websocketApi","id","websocketApiUrl","dynamoDbElasticsearchTable","addDomainsUrlsOutputs","cloudfrontDistribution","map","distributionDomain","distributionUrl","usedDomain","usedUrl","tagResources","WbyProjectName","getEnvVariableWebinyProjectName","WbyEnvironment","getEnvVariableWebinyEnv","WbyEnvironmentVariant","getEnvVariableWebinyVariant","withServiceManifest","withCommonLambdaEnvVariables","addServiceManifest","manifest","bgTaskSfn","resources","distributionId","exports"],"sources":["createApiPulumiApp.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { createPulumiApp, PulumiAppParam, PulumiAppParamCallback } from \"@webiny/pulumi\";\nimport {\n ApiApwScheduler,\n ApiBackgroundTask,\n ApiCloudfront,\n ApiFileManager,\n ApiGateway,\n ApiGraphql,\n ApiMigration,\n ApiPageBuilder,\n ApiWebsocket,\n CoreOutput,\n CreateCorePulumiAppParams,\n VpcConfig\n} from \"~/apps\";\nimport { applyCustomDomain, CustomDomainParams } from \"../customDomain\";\nimport {\n addDomainsUrlsOutputs,\n tagResources,\n withCommonLambdaEnvVariables,\n withServiceManifest\n} from \"~/utils\";\nimport { DEFAULT_PROD_ENV_NAMES } from \"~/constants\";\nimport { getEnvVariableWebinyVariant } from \"~/env/variant\";\nimport { getEnvVariableWebinyEnv } from \"~/env/env\";\nimport { getEnvVariableWebinyProjectName } from \"~/env/projectName\";\nimport { getEnvVariableAwsRegion } from \"~/env/awsRegion\";\nimport { getAwsAccountId } from \"~/apps/awsUtils\";\n\nexport type ApiPulumiApp = ReturnType<typeof createApiPulumiApp>;\n\nexport interface ApiElasticsearchConfig {\n domainName: string;\n indexPrefix: string;\n sharedIndexes: boolean;\n}\n\nexport interface ApiOpenSearchConfig {\n domainName: string;\n indexPrefix: string;\n sharedIndexes: boolean;\n}\n\nexport interface CreateApiPulumiAppParams {\n /**\n * Enables ElasticSearch infrastructure.\n * Note that it requires also changes in application code.\n */\n elasticSearch?: PulumiAppParam<boolean | Partial<ApiElasticsearchConfig>>;\n\n /**\n * Enables OpenSearch infrastructure.\n * Note that it requires also changes in application code.\n */\n openSearch?: PulumiAppParam<boolean | Partial<ApiOpenSearchConfig>>;\n\n /**\n * Enables or disables VPC for the API.\n * For VPC to work you also have to enable it in the Core application.\n */\n vpc?: PulumiAppParam<boolean>;\n\n /** Custom domain configuration */\n domains?: PulumiAppParamCallback<CustomDomainParams>;\n\n /**\n * Provides a way to adjust existing Pulumi code (cloud infrastructure resources)\n * or add additional ones into the mix.\n */\n pulumi?: (app: ApiPulumiApp) => void | Promise<void>;\n\n /**\n * Prefixes names of all Pulumi cloud infrastructure resource with given prefix.\n */\n pulumiResourceNamePrefix?: PulumiAppParam<string>;\n\n /**\n * Treats provided environments as production environments, which\n * are deployed in production deployment mode.\n * https://www.webiny.com/docs/architecture/deployment-modes/production\n */\n productionEnvironments?: PulumiAppParam<string[]>;\n}\n\nexport const createApiPulumiApp = (projectAppParams: CreateApiPulumiAppParams = {}) => {\n const baseApp = createPulumiApp({\n name: \"api\",\n path: \"apps/api\",\n config: projectAppParams,\n program: async app => {\n let searchEngineParams:\n | CreateCorePulumiAppParams[\"openSearch\"]\n | CreateCorePulumiAppParams[\"elasticSearch\"]\n | null = null;\n\n if (projectAppParams.openSearch) {\n searchEngineParams = app.getParam(projectAppParams.openSearch);\n } else if (projectAppParams.elasticSearch) {\n searchEngineParams = app.getParam(projectAppParams.elasticSearch);\n }\n\n if (searchEngineParams) {\n const params = app.getParam(searchEngineParams);\n if (typeof params === \"object\") {\n if (params.domainName) {\n process.env.AWS_ELASTIC_SEARCH_DOMAIN_NAME = params.domainName;\n }\n\n if (params.indexPrefix) {\n process.env.ELASTIC_SEARCH_INDEX_PREFIX = params.indexPrefix;\n }\n\n if (params.sharedIndexes) {\n process.env.ELASTICSEARCH_SHARED_INDEXES = \"true\";\n }\n }\n }\n\n const pulumiResourceNamePrefix = app.getParam(\n projectAppParams.pulumiResourceNamePrefix\n );\n if (pulumiResourceNamePrefix) {\n app.onResource(resource => {\n if (!resource.name.startsWith(pulumiResourceNamePrefix)) {\n resource.name = `${pulumiResourceNamePrefix}${resource.name}`;\n }\n });\n }\n\n // Overrides must be applied via a handler, registered at the very start of the program.\n // By doing this, we're ensuring user's adjustments are not applied too late.\n if (projectAppParams.pulumi) {\n app.addHandler(() => {\n return projectAppParams.pulumi!(app as ApiPulumiApp);\n });\n }\n\n const productionEnvironments =\n app.params.create.productionEnvironments || DEFAULT_PROD_ENV_NAMES;\n const isProduction = productionEnvironments.includes(app.params.run.env);\n\n // Register core output as a module available to all the other modules\n const core = app.addModule(CoreOutput);\n\n // Register VPC config module to be available to other modules.\n const vpcEnabled = app.getParam(projectAppParams?.vpc) ?? isProduction;\n app.addModule(VpcConfig, { enabled: vpcEnabled });\n\n const pageBuilder = app.addModule(ApiPageBuilder, {\n env: {\n COGNITO_REGION: getEnvVariableAwsRegion(),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\n DB_TABLE_LOG: core.logDynamodbTableName,\n DB_TABLE_ELASTICSEARCH: core.elasticsearchDynamodbTableName,\n ELASTIC_SEARCH_ENDPOINT: core.elasticsearchDomainEndpoint,\n\n // Not required. Useful for testing purposes / ephemeral environments.\n // https://www.webiny.com/docs/key-topics/ci-cd/testing/slow-ephemeral-environments\n ELASTIC_SEARCH_INDEX_PREFIX: process.env.ELASTIC_SEARCH_INDEX_PREFIX,\n ELASTICSEARCH_SHARED_INDEXES: process.env.ELASTICSEARCH_SHARED_INDEXES,\n\n S3_BUCKET: core.fileManagerBucketId\n }\n });\n\n const apwScheduler = app.addModule(ApiApwScheduler, {\n primaryDynamodbTableArn: core.primaryDynamodbTableArn,\n\n env: {\n COGNITO_REGION: getEnvVariableAwsRegion(),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\n DB_TABLE_LOG: core.logDynamodbTableName,\n S3_BUCKET: core.fileManagerBucketId\n }\n });\n\n const graphql = app.addModule(ApiGraphql, {\n env: {\n COGNITO_REGION: getEnvVariableAwsRegion(),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\n DB_TABLE_LOG: core.logDynamodbTableName,\n DB_TABLE_ELASTICSEARCH: core.elasticsearchDynamodbTableName,\n ELASTIC_SEARCH_ENDPOINT: core.elasticsearchDomainEndpoint,\n\n // Not required. Useful for testing purposes / ephemeral environments.\n // https://www.webiny.com/docs/key-topics/ci-cd/testing/slow-ephemeral-environments\n ELASTIC_SEARCH_INDEX_PREFIX: process.env.ELASTIC_SEARCH_INDEX_PREFIX,\n ELASTICSEARCH_SHARED_INDEXES: process.env.ELASTICSEARCH_SHARED_INDEXES,\n\n S3_BUCKET: core.fileManagerBucketId,\n EVENT_BUS: core.eventBusArn,\n IMPORT_CREATE_HANDLER: pageBuilder.import.functions.create.output.arn,\n EXPORT_PROCESS_HANDLER: pageBuilder.export.functions.process.output.arn,\n // TODO: move to okta plugin\n OKTA_ISSUER: process.env[\"OKTA_ISSUER\"],\n APW_SCHEDULER_SCHEDULE_ACTION_HANDLER:\n apwScheduler.scheduleAction.lambda.output.arn\n },\n apwSchedulerEventRule: apwScheduler.eventRule.output,\n apwSchedulerEventTarget: apwScheduler.eventTarget.output\n });\n\n const websocket = app.addModule(ApiWebsocket);\n\n const fileManager = app.addModule(ApiFileManager, {\n env: {\n DB_TABLE: core.primaryDynamodbTableName,\n DB_TABLE_LOG: core.logDynamodbTableName\n }\n });\n\n const apiGateway = app.addModule(ApiGateway, {\n \"graphql-post\": {\n path: \"/graphql\",\n method: \"POST\",\n function: graphql.functions.graphql.output.arn\n },\n \"graphql-options\": {\n path: \"/graphql\",\n method: \"OPTIONS\",\n function: graphql.functions.graphql.output.arn\n },\n \"files-any\": {\n path: \"/files/{path+}\",\n method: \"ANY\",\n function: fileManager.functions.download.output.arn\n },\n \"private-any\": {\n path: \"/private/{path+}\",\n method: \"ANY\",\n function: fileManager.functions.download.output.arn\n },\n \"cms-post\": {\n path: \"/cms/{key+}\",\n method: \"POST\",\n function: graphql.functions.graphql.output.arn\n },\n \"cms-options\": {\n path: \"/cms/{key+}\",\n method: \"OPTIONS\",\n function: graphql.functions.graphql.output.arn\n },\n \"files-catch-all\": {\n path: \"/{path+}\",\n method: \"ANY\",\n function: fileManager.functions.download.output.arn\n }\n });\n\n const cloudfront = app.addModule(ApiCloudfront);\n const backgroundTask = app.addModule(ApiBackgroundTask);\n const migration = app.addModule(ApiMigration);\n\n const domains = app.getParam(projectAppParams.domains);\n if (domains) {\n applyCustomDomain(cloudfront, domains);\n }\n\n app.addOutputs({\n awsAccountId: getAwsAccountId(app),\n region: aws.config.region,\n cognitoUserPoolId: core.cognitoUserPoolId,\n cognitoAppClientId: core.cognitoAppClientId,\n cognitoUserPoolPasswordPolicy: core.cognitoUserPoolPasswordPolicy,\n apwSchedulerScheduleAction: apwScheduler.scheduleAction.lambda.output.arn,\n apwSchedulerExecuteAction: apwScheduler.executeAction.lambda.output.arn,\n apwSchedulerEventRule: apwScheduler.eventRule.output.name,\n apwSchedulerEventTargetId: apwScheduler.eventTarget.output.targetId,\n dynamoDbTable: core.primaryDynamodbTableName,\n migrationLambdaArn: migration.function.output.arn,\n graphqlLambdaName: graphql.functions.graphql.output.name,\n graphqlLambdaRole: graphql.role.output.arn,\n backgroundTaskLambdaArn: backgroundTask.backgroundTask.output.arn,\n backgroundTaskStepFunctionArn: backgroundTask.stepFunction.output.arn,\n websocketApiId: websocket.websocketApi.output.id,\n websocketApiUrl: websocket.websocketApiUrl\n });\n\n // Only add `dynamoDbElasticsearchTable` output if using search engine (ES/OS).\n if (searchEngineParams) {\n app.addOutputs({\n dynamoDbElasticsearchTable: core.elasticsearchDynamodbTableName\n });\n }\n\n app.addHandler(() => {\n addDomainsUrlsOutputs({\n app,\n cloudfrontDistribution: cloudfront,\n map: {\n distributionDomain: \"cloudfrontApiDomain\",\n distributionUrl: \"cloudfrontApiUrl\",\n usedDomain: \"apiDomain\",\n usedUrl: \"apiUrl\"\n }\n });\n });\n\n tagResources({\n WbyProjectName: getEnvVariableWebinyProjectName(),\n WbyEnvironment: getEnvVariableWebinyEnv(),\n WbyEnvironmentVariant: getEnvVariableWebinyVariant()\n });\n\n return {\n fileManager,\n graphql,\n apiGateway,\n websocket,\n cloudfront,\n apwScheduler,\n migration,\n backgroundTask\n };\n }\n });\n\n const app = withServiceManifest(withCommonLambdaEnvVariables(baseApp));\n\n app.addHandler(() => {\n app.addServiceManifest({\n name: \"api\",\n manifest: {\n bgTaskSfn: baseApp.resources.backgroundTask.stepFunction.output.arn,\n cloudfront: {\n distributionId: baseApp.resources.cloudfront.output.id\n }\n }\n });\n });\n\n return app;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,GAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAF,OAAA;AAcA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAMA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AAyDO,MAAMW,kBAAkB,GAAGA,CAACC,gBAA0C,GAAG,CAAC,CAAC,KAAK;EACnF,MAAMC,OAAO,GAAG,IAAAC,uBAAe,EAAC;IAC5BC,IAAI,EAAE,KAAK;IACXC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAEL,g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IAAAC,mCAA4B,EAACrI,OAAO,CAAC,CAAC;EAEtEM,GAAG,CAACmB,UAAU,CAAC,MAAM;IACjBnB,GAAG,CAACgI,kBAAkB,CAAC;MACnBpI,IAAI,EAAE,KAAK;MACXqI,QAAQ,EAAE;QACNC,SAAS,EAAExI,OAAO,CAACyI,SAAS,CAACjD,cAAc,CAACwB,YAAY,CAAC/C,MAAM,CAACC,GAAG;QACnEoB,UAAU,EAAE;UACRoD,cAAc,EAAE1I,OAAO,CAACyI,SAAS,CAACnD,UAAU,CAACrB,MAAM,CAACkD;QACxD;MACJ;IACJ,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,OAAO7G,GAAG;AACd,CAAC;AAACqI,OAAA,CAAA7I,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["aws","_interopRequireWildcard","require","_pulumi","_","_customDomain","_utils","_constants","_variant","_env","_projectName","_awsRegion","_index","_awsUtils","_ApiScheduler","createApiPulumiApp","projectAppParams","baseApp","createPulumiApp","name","path","config","program","app","searchEngineParams","openSearch","getParam","elasticSearch","params","domainName","process","env","AWS_ELASTIC_SEARCH_DOMAIN_NAME","indexPrefix","ELASTIC_SEARCH_INDEX_PREFIX","sharedIndexes","ELASTICSEARCH_SHARED_INDEXES","pulumiResourceNamePrefix","onResource","resource","startsWith","pulumi","addHandler","productionEnvironments","create","DEFAULT_PROD_ENV_NAMES","isProduction","includes","run","core","addModule","CoreOutput","vpcEnabled","vpc","VpcConfig","enabled","apwScheduler","ApiApwScheduler","primaryDynamodbTableArn","COGNITO_REGION","getEnvVariableAwsRegion","COGNITO_USER_POOL_ID","cognitoUserPoolId","DB_TABLE","primaryDynamodbTableName","DB_TABLE_LOG","logDynamodbTableName","S3_BUCKET","fileManagerBucketId","graphql","ApiGraphql","DB_TABLE_ELASTICSEARCH","elasticsearchDynamodbTableName","ELASTIC_SEARCH_ENDPOINT","elasticsearchDomainEndpoint","EVENT_BUS","eventBusArn","OKTA_ISSUER","APW_SCHEDULER_SCHEDULE_ACTION_HANDLER","scheduleAction","lambda","output","arn","apwSchedulerEventRule","eventRule","apwSchedulerEventTarget","eventTarget","websocket","ApiWebsocket","fileManager","ApiFileManager","apiGateway","ApiGateway","method","function","functions","download","cloudfront","ApiCloudfront","backgroundTask","ApiBackgroundTask","migration","ApiMigration","scheduler","ApiScheduler","domains","applyCustomDomain","addOutputs","awsAccountId","getAwsAccountId","region","cognitoAppClientId","cognitoUserPoolPasswordPolicy","apwSchedulerScheduleAction","apwSchedulerExecuteAction","executeAction","apwSchedulerEventTargetId","targetId","dynamoDbTable","migrationLambdaArn","graphqlLambdaName","graphqlLambdaRole","role","graphqlLambdaRoleName","backgroundTaskLambdaArn","backgroundTaskStepFunctionArn","stepFunction","fileManagerManageLambdaArn","manage","fileManagerManageLambdaRole","roles","fileManagerManageLambdaRoleName","fileManagerDownloadLambdaArn","websocketApiId","websocketApi","id","websocketApiUrl","schedulerLambdaInvokeRole","invokeRole","dynamoDbElasticsearchTable","addDomainsUrlsOutputs","cloudfrontDistribution","map","distributionDomain","distributionUrl","usedDomain","usedUrl","attachSyncSystem","tagResources","WbyProjectName","getEnvVariableWebinyProjectName","WbyEnvironment","getEnvVariableWebinyEnv","WbyEnvironmentVariant","getEnvVariableWebinyVariant","withServiceManifest","withCommonLambdaEnvVariables","addServiceManifest","manifest","bgTaskSfn","resources","distributionId","lambdaArn","roleArn","exports"],"sources":["createApiPulumiApp.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport type { PulumiAppParam, PulumiAppParamCallback } from \"@webiny/pulumi\";\nimport { createPulumiApp, type PulumiApp } from \"@webiny/pulumi\";\nimport type { CreateCorePulumiAppParams } from \"~/apps\";\nimport {\n ApiApwScheduler,\n ApiBackgroundTask,\n ApiCloudfront,\n ApiFileManager,\n ApiGateway,\n ApiGraphql,\n ApiMigration,\n ApiWebsocket,\n CoreOutput,\n VpcConfig\n} from \"~/apps\";\nimport type { CustomDomainParams } from \"../customDomain\";\nimport { applyCustomDomain } from \"../customDomain\";\nimport {\n addDomainsUrlsOutputs,\n tagResources,\n withCommonLambdaEnvVariables,\n withServiceManifest\n} from \"~/utils\";\nimport { DEFAULT_PROD_ENV_NAMES } from \"~/constants\";\nimport { getEnvVariableWebinyVariant } from \"~/env/variant\";\nimport { getEnvVariableWebinyEnv } from \"~/env/env\";\nimport { getEnvVariableWebinyProjectName } from \"~/env/projectName\";\nimport { getEnvVariableAwsRegion } from \"~/env/awsRegion\";\nimport { attachSyncSystem } from \"../syncSystem/api/index.js\";\nimport { getAwsAccountId } from \"~/apps/awsUtils\";\nimport type { WithServiceManifest } from \"~/utils/withServiceManifest.js\";\nimport { ApiScheduler } from \"~/apps/api/ApiScheduler.js\";\n\nexport type ApiPulumiApp = ReturnType<typeof createApiPulumiApp>;\n\nexport interface ApiElasticsearchConfig {\n domainName: string;\n indexPrefix: string;\n sharedIndexes: boolean;\n}\n\nexport interface ApiOpenSearchConfig {\n domainName: string;\n indexPrefix: string;\n sharedIndexes: boolean;\n}\n\nexport interface CreateApiPulumiAppParams {\n /**\n * Enables ElasticSearch infrastructure.\n * Note that it requires also changes in application code.\n */\n elasticSearch?: PulumiAppParam<boolean | Partial<ApiElasticsearchConfig>>;\n\n /**\n * Enables OpenSearch infrastructure.\n * Note that it requires also changes in application code.\n */\n openSearch?: PulumiAppParam<boolean | Partial<ApiOpenSearchConfig>>;\n\n /**\n * Enables or disables VPC for the API.\n * For VPC to work you also have to enable it in the Core application.\n */\n vpc?: PulumiAppParam<boolean>;\n\n /** Custom domain configuration */\n domains?: PulumiAppParamCallback<CustomDomainParams>;\n\n /**\n * Provides a way to adjust existing Pulumi code (cloud infrastructure resources)\n * or add additional ones into the mix.\n */\n pulumi?: (app: ApiPulumiApp) => void | Promise<void>;\n\n /**\n * Prefixes names of all Pulumi cloud infrastructure resource with given prefix.\n */\n pulumiResourceNamePrefix?: PulumiAppParam<string>;\n\n /**\n * Treats provided environments as production environments, which\n * are deployed in production deployment mode.\n * https://www.webiny.com/docs/architecture/deployment-modes/production\n */\n productionEnvironments?: PulumiAppParam<string[]>;\n}\n\nexport const createApiPulumiApp = (projectAppParams: CreateApiPulumiAppParams = {}) => {\n const baseApp = createPulumiApp({\n name: \"api\",\n path: \"apps/api\",\n config: projectAppParams,\n program: async (app: PulumiApp & WithServiceManifest) => {\n let searchEngineParams:\n | CreateCorePulumiAppParams[\"openSearch\"]\n | CreateCorePulumiAppParams[\"elasticSearch\"]\n | null = null;\n\n if (projectAppParams.openSearch) {\n searchEngineParams = app.getParam(projectAppParams.openSearch);\n } else if (projectAppParams.elasticSearch) {\n searchEngineParams = app.getParam(projectAppParams.elasticSearch);\n }\n\n if (searchEngineParams) {\n const params = app.getParam(searchEngineParams);\n if (typeof params === \"object\") {\n if (params.domainName) {\n process.env.AWS_ELASTIC_SEARCH_DOMAIN_NAME = params.domainName;\n }\n\n if (params.indexPrefix) {\n process.env.ELASTIC_SEARCH_INDEX_PREFIX = params.indexPrefix;\n }\n\n if (params.sharedIndexes) {\n process.env.ELASTICSEARCH_SHARED_INDEXES = \"true\";\n }\n }\n }\n\n const pulumiResourceNamePrefix = app.getParam(\n projectAppParams.pulumiResourceNamePrefix\n );\n if (pulumiResourceNamePrefix) {\n app.onResource(resource => {\n if (!resource.name.startsWith(pulumiResourceNamePrefix)) {\n resource.name = `${pulumiResourceNamePrefix}${resource.name}`;\n }\n });\n }\n\n // Overrides must be applied via a handler, registered at the very start of the program.\n // By doing this, we're ensuring user's adjustments are not applied too late.\n if (projectAppParams.pulumi) {\n app.addHandler(() => {\n return projectAppParams.pulumi!(app as ApiPulumiApp);\n });\n }\n\n const productionEnvironments =\n app.params.create.productionEnvironments || DEFAULT_PROD_ENV_NAMES;\n const isProduction = productionEnvironments.includes(app.params.run.env);\n\n // Register core output as a module available to all the other modules\n const core = app.addModule(CoreOutput);\n\n // Register VPC config module to be available to other modules.\n const vpcEnabled = app.getParam(projectAppParams?.vpc) ?? isProduction;\n app.addModule(VpcConfig, { enabled: vpcEnabled });\n\n // const pageBuilder = app.addModule(ApiPageBuilder, {\n // env: {\n // COGNITO_REGION: getEnvVariableAwsRegion(),\n // COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n // DB_TABLE: core.primaryDynamodbTableName,\n // DB_TABLE_LOG: core.logDynamodbTableName,\n // DB_TABLE_ELASTICSEARCH: core.elasticsearchDynamodbTableName,\n // ELASTIC_SEARCH_ENDPOINT: core.elasticsearchDomainEndpoint,\n //\n // // Not required. Useful for testing purposes / ephemeral environments.\n // // https://www.webiny.com/docs/key-topics/ci-cd/testing/slow-ephemeral-environments\n // ELASTIC_SEARCH_INDEX_PREFIX: process.env.ELASTIC_SEARCH_INDEX_PREFIX,\n // ELASTICSEARCH_SHARED_INDEXES: process.env.ELASTICSEARCH_SHARED_INDEXES,\n //\n // S3_BUCKET: core.fileManagerBucketId\n // }\n // });\n\n const apwScheduler = app.addModule(ApiApwScheduler, {\n primaryDynamodbTableArn: core.primaryDynamodbTableArn,\n\n env: {\n COGNITO_REGION: getEnvVariableAwsRegion(),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\n DB_TABLE_LOG: core.logDynamodbTableName,\n S3_BUCKET: core.fileManagerBucketId\n }\n });\n\n const graphql = app.addModule(ApiGraphql, {\n env: {\n COGNITO_REGION: getEnvVariableAwsRegion(),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\n DB_TABLE_LOG: core.logDynamodbTableName,\n DB_TABLE_ELASTICSEARCH: core.elasticsearchDynamodbTableName,\n ELASTIC_SEARCH_ENDPOINT: core.elasticsearchDomainEndpoint,\n\n // Not required. Useful for testing purposes / ephemeral environments.\n // https://www.webiny.com/docs/key-topics/ci-cd/testing/slow-ephemeral-environments\n ELASTIC_SEARCH_INDEX_PREFIX: process.env.ELASTIC_SEARCH_INDEX_PREFIX,\n ELASTICSEARCH_SHARED_INDEXES: process.env.ELASTICSEARCH_SHARED_INDEXES,\n\n S3_BUCKET: core.fileManagerBucketId,\n EVENT_BUS: core.eventBusArn,\n // IMPORT_CREATE_HANDLER: pageBuilder.import.functions.create.output.arn,\n // EXPORT_PROCESS_HANDLER: pageBuilder.export.functions.process.output.arn,\n // TODO: move to okta plugin\n OKTA_ISSUER: process.env[\"OKTA_ISSUER\"],\n APW_SCHEDULER_SCHEDULE_ACTION_HANDLER:\n apwScheduler.scheduleAction.lambda.output.arn\n },\n apwSchedulerEventRule: apwScheduler.eventRule.output,\n apwSchedulerEventTarget: apwScheduler.eventTarget.output\n });\n\n const websocket = app.addModule(ApiWebsocket);\n\n const fileManager = app.addModule(ApiFileManager, {\n env: {\n DB_TABLE: core.primaryDynamodbTableName,\n DB_TABLE_LOG: core.logDynamodbTableName\n }\n });\n\n const apiGateway = app.addModule(ApiGateway, {\n \"graphql-post\": {\n path: \"/graphql\",\n method: \"POST\",\n function: graphql.functions.graphql.output.arn\n },\n \"graphql-options\": {\n path: \"/graphql\",\n method: \"OPTIONS\",\n function: graphql.functions.graphql.output.arn\n },\n \"files-any\": {\n path: \"/files/{path+}\",\n method: \"ANY\",\n function: fileManager.functions.download.output.arn\n },\n \"private-any\": {\n path: \"/private/{path+}\",\n method: \"ANY\",\n function: fileManager.functions.download.output.arn\n },\n \"cms-post\": {\n path: \"/cms/{key+}\",\n method: \"POST\",\n function: graphql.functions.graphql.output.arn\n },\n \"cms-options\": {\n path: \"/cms/{key+}\",\n method: \"OPTIONS\",\n function: graphql.functions.graphql.output.arn\n },\n \"files-catch-all\": {\n path: \"/{path+}\",\n method: \"ANY\",\n function: fileManager.functions.download.output.arn\n }\n });\n\n const cloudfront = app.addModule(ApiCloudfront);\n const backgroundTask = app.addModule(ApiBackgroundTask);\n const migration = app.addModule(ApiMigration);\n const scheduler = app.addModule(ApiScheduler);\n\n const domains = app.getParam(projectAppParams.domains);\n if (domains) {\n applyCustomDomain(cloudfront, domains);\n }\n\n app.addOutputs({\n awsAccountId: getAwsAccountId(app),\n region: aws.config.region,\n cognitoUserPoolId: core.cognitoUserPoolId,\n cognitoAppClientId: core.cognitoAppClientId,\n cognitoUserPoolPasswordPolicy: core.cognitoUserPoolPasswordPolicy,\n apwSchedulerScheduleAction: apwScheduler.scheduleAction.lambda.output.arn,\n apwSchedulerExecuteAction: apwScheduler.executeAction.lambda.output.arn,\n apwSchedulerEventRule: apwScheduler.eventRule.output.name,\n apwSchedulerEventTargetId: apwScheduler.eventTarget.output.targetId,\n dynamoDbTable: core.primaryDynamodbTableName,\n migrationLambdaArn: migration.function.output.arn,\n graphqlLambdaName: graphql.functions.graphql.output.name,\n graphqlLambdaRole: graphql.role.output.arn,\n graphqlLambdaRoleName: graphql.role.output.name,\n backgroundTaskLambdaArn: backgroundTask.backgroundTask.output.arn,\n backgroundTaskStepFunctionArn: backgroundTask.stepFunction.output.arn,\n fileManagerManageLambdaArn: fileManager.functions.manage.output.arn,\n fileManagerManageLambdaRole: fileManager.roles.manage.output.arn,\n fileManagerManageLambdaRoleName: fileManager.roles.manage.output.name,\n fileManagerDownloadLambdaArn: fileManager.functions.download.output.arn,\n websocketApiId: websocket.websocketApi.output.id,\n websocketApiUrl: websocket.websocketApiUrl,\n schedulerLambdaInvokeRole: scheduler.invokeRole.output.arn\n });\n\n // Only add `dynamoDbElasticsearchTable` output if using search engine (ES/OS).\n if (searchEngineParams) {\n app.addOutputs({\n dynamoDbElasticsearchTable: core.elasticsearchDynamodbTableName\n });\n }\n\n app.addHandler(() => {\n addDomainsUrlsOutputs({\n app,\n cloudfrontDistribution: cloudfront,\n map: {\n distributionDomain: \"cloudfrontApiDomain\",\n distributionUrl: \"cloudfrontApiUrl\",\n usedDomain: \"apiDomain\",\n usedUrl: \"apiUrl\"\n }\n });\n });\n /**\n * We need to attach the Sync System if it exists.\n */\n attachSyncSystem({\n app,\n core,\n env: app.params.run.env\n });\n\n tagResources({\n WbyProjectName: getEnvVariableWebinyProjectName(),\n WbyEnvironment: getEnvVariableWebinyEnv(),\n WbyEnvironmentVariant: getEnvVariableWebinyVariant()\n });\n\n return {\n fileManager,\n graphql,\n apiGateway,\n websocket,\n cloudfront,\n apwScheduler,\n migration,\n backgroundTask,\n scheduler\n };\n }\n });\n\n const app = withServiceManifest(withCommonLambdaEnvVariables(baseApp));\n\n app.addHandler(() => {\n app.addServiceManifest({\n name: \"api\",\n manifest: {\n bgTaskSfn: baseApp.resources.backgroundTask.stepFunction.output.arn,\n cloudfront: {\n distributionId: baseApp.resources.cloudfront.output.id\n }\n }\n });\n\n app.addServiceManifest({\n name: \"scheduler\",\n manifest: {\n lambdaArn: baseApp.resources.graphql.functions.graphql.output.arn,\n roleArn: baseApp.resources.scheduler.invokeRole.output.arn\n }\n });\n });\n\n return app;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,GAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,CAAA,GAAAF,OAAA;AAaA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAMA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AAEA,IAAAY,aAAA,GAAAZ,OAAA;AAyDO,MAAMa,kBAAkB,GAAGA,CAACC,gBAA0C,GAAG,CAAC,CAAC,KAAK;EACnF,MAAMC,OAAO,GAAG,IAAAC,uBAAe,EAAC;IAC5BC,IAAI,EAAE,KAAK;IACXC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAEL,gBAAgB;IACxBM,OAAO,EAAE,MAAOC,GAAoC,IAAK;MACrD,IAAIC,kBAGM,GAAG,IAAI;MAEjB,IAAIR,gBAAgB,CAACS,UAAU,EAAE;QAC7BD,k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AG,CAACmB,UAAU,CAAC,MAAM;IACjBnB,GAAG,CAACsI,kBAAkB,CAAC;MACnB1I,IAAI,EAAE,KAAK;MACX2I,QAAQ,EAAE;QACNC,SAAS,EAAE9I,OAAO,CAAC+I,SAAS,CAAC7D,cAAc,CAAC2B,YAAY,CAAC7C,MAAM,CAACC,GAAG;QACnEe,UAAU,EAAE;UACRgE,cAAc,EAAEhJ,OAAO,CAAC+I,SAAS,CAAC/D,UAAU,CAAChB,MAAM,CAACsD;QACxD;MACJ;IACJ,CAAC,CAAC;IAEFhH,GAAG,CAACsI,kBAAkB,CAAC;MACnB1I,IAAI,EAAE,WAAW;MACjB2I,QAAQ,EAAE;QACNI,SAAS,EAAEjJ,OAAO,CAAC+I,SAAS,CAAC3F,OAAO,CAAC0B,SAAS,CAAC1B,OAAO,CAACY,MAAM,CAACC,GAAG;QACjEiF,OAAO,EAAElJ,OAAO,CAAC+I,SAAS,CAACzD,SAAS,CAACmC,UAAU,CAACzD,MAAM,CAACC;MAC3D;IACJ,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,OAAO3D,GAAG;AACd,CAAC;AAAC6I,OAAA,CAAArJ,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
package/apps/awsUtils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PulumiApp } from "@webiny/pulumi";
|
|
1
|
+
import type { PulumiApp } from "@webiny/pulumi";
|
|
2
2
|
export declare function getAwsAccountId(app: PulumiApp): import("@pulumi/pulumi").Output<string>;
|
|
3
|
-
export declare function getAwsRegion(app: PulumiApp): import("@pulumi/pulumi").Output<"
|
|
3
|
+
export declare function getAwsRegion(app: PulumiApp): import("@pulumi/pulumi").Output<"af-south-1" | "ap-east-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-northeast-3" | "ap-south-1" | "ap-south-2" | "ap-southeast-1" | "ap-southeast-2" | "ap-southeast-3" | "ap-southeast-4" | "ap-southeast-5" | "ap-southeast-7" | "ca-central-1" | "ca-west-1" | "eu-central-1" | "eu-central-2" | "eu-north-1" | "eu-south-1" | "eu-south-2" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "il-central-1" | "me-central-1" | "me-south-1" | "sa-east-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2" | "cn-north-1" | "cn-northwest-1" | "us-gov-east-1" | "us-gov-west-1" | "us-iso-east-1" | "us-iso-west-1" | "us-isob-east-1" | "eu-isoe-west-1">;
|
package/apps/awsUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["aws","_interopRequireWildcard","require","getAwsAccountId","app","addHandler","getCallerIdentity","then","x","accountId","getAwsRegion","config","requireRegion"],"sources":["awsUtils.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { PulumiApp } from \"@webiny/pulumi\";\n\nexport function getAwsAccountId(app: PulumiApp) {\n return app.addHandler(() => {\n return aws.getCallerIdentity({}).then(x => x.accountId);\n });\n}\n\nexport function getAwsRegion(app: PulumiApp) {\n return app.addHandler(() => {\n return aws.config.requireRegion();\n });\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,GAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGO,SAASC,eAAeA,CAACC,GAAc,EAAE;EAC5C,OAAOA,GAAG,CAACC,UAAU,CAAC,MAAM;IACxB,OAAOL,GAAG,CAACM,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAACC,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,SAAS,CAAC;EAC3D,CAAC,CAAC;AACN;AAEO,SAASC,YAAYA,CAACN,GAAc,EAAE;EACzC,OAAOA,GAAG,CAACC,UAAU,CAAC,MAAM;IACxB,OAAOL,GAAG,CAACW,MAAM,CAACC,aAAa,CAAC,CAAC;EACrC,CAAC,CAAC;AACN","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["aws","_interopRequireWildcard","require","getAwsAccountId","app","addHandler","getCallerIdentity","then","x","accountId","getAwsRegion","config","requireRegion"],"sources":["awsUtils.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport type { PulumiApp } from \"@webiny/pulumi\";\n\nexport function getAwsAccountId(app: PulumiApp) {\n return app.addHandler(() => {\n return aws.getCallerIdentity({}).then(x => x.accountId);\n });\n}\n\nexport function getAwsRegion(app: PulumiApp) {\n return app.addHandler(() => {\n return aws.config.requireRegion();\n });\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,GAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGO,SAASC,eAAeA,CAACC,GAAc,EAAE;EAC5C,OAAOA,GAAG,CAACC,UAAU,CAAC,MAAM;IACxB,OAAOL,GAAG,CAACM,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAACC,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,SAAS,CAAC;EAC3D,CAAC,CAAC;AACN;AAEO,SAASC,YAAYA,CAACN,GAAc,EAAE;EACzC,OAAOA,GAAG,CAACC,UAAU,CAAC,MAAM;IACxB,OAAOL,GAAG,CAACW,MAAM,CAACC,aAAa,CAAC,CAAC;EACrC,CAAC,CAAC;AACN","ignoreList":[]}
|
|
@@ -11,6 +11,12 @@ export interface OpenSearchConfig {
|
|
|
11
11
|
indexPrefix: string;
|
|
12
12
|
sharedIndexes: boolean;
|
|
13
13
|
}
|
|
14
|
+
export interface IDeploymentsCallableParams {
|
|
15
|
+
env: string;
|
|
16
|
+
}
|
|
17
|
+
export interface IDeploymentsCallable {
|
|
18
|
+
(params: IDeploymentsCallableParams): [IBlueGreenDeployment, IBlueGreenDeployment];
|
|
19
|
+
}
|
|
14
20
|
export interface CreateBlueGreenPulumiAppParams {
|
|
15
21
|
/**
|
|
16
22
|
* Secures against deleting database by accident.
|
|
@@ -51,7 +57,7 @@ export interface CreateBlueGreenPulumiAppParams {
|
|
|
51
57
|
* Available deployments for the Blue / Green switch.
|
|
52
58
|
* They will be validated before deploy.
|
|
53
59
|
*/
|
|
54
|
-
deployments:
|
|
60
|
+
deployments: IDeploymentsCallable;
|
|
55
61
|
/**
|
|
56
62
|
* Attach domains to the Blue/Green CloudFront.
|
|
57
63
|
*/
|
|
@@ -30,14 +30,14 @@ function createBlueGreenPulumiApp(projectAppParams) {
|
|
|
30
30
|
config: projectAppParams,
|
|
31
31
|
program: async app => {
|
|
32
32
|
const productionEnvironments = app.params.create.productionEnvironments || _constants.DEFAULT_PROD_ENV_NAMES;
|
|
33
|
-
const deployments = (0, _validateDeployments.validateDeployments)(projectAppParams.deployments());
|
|
33
|
+
const deployments = (0, _validateDeployments.validateDeployments)(projectAppParams.deployments(app.params.run));
|
|
34
34
|
const applicationsDomains = await (0, _getApplicationDomains.getApplicationDomains)({
|
|
35
35
|
stacks: deployments
|
|
36
36
|
});
|
|
37
37
|
const deploymentsDomains = (0, _convertApplicationDomains.convertApplicationDomains)({
|
|
38
38
|
input: applicationsDomains
|
|
39
39
|
});
|
|
40
|
-
const attachedDomains = projectAppParams.domains();
|
|
40
|
+
const attachedDomains = projectAppParams.domains(app.params.run);
|
|
41
41
|
const domains = (0, _resolveDomains.resolveDomains)({
|
|
42
42
|
attachedDomains,
|
|
43
43
|
deploymentsDomains
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_aws","_interopRequireWildcard","require","aws","_pulumi","_constants","_BlueGreenRouterCloudFront","_createCloudFrontDefaultCacheBehaviorPolicies","_tagResources","_projectName","_env","_BlueGreenRouterApiGateway","_BlueGreenRouterCloudFrontStore","_validateDeployments","_getApplicationDomains","_convertApplicationDomains","_resolveDomains","_customDomain","_attachDomainsToOutput","_constants2","createBlueGreenPulumiApp","projectAppParams","createPulumiApp","name","path","config","program","app","productionEnvironments","params","create","DEFAULT_PROD_ENV_NAMES","deployments","validateDeployments","applicationsDomains","getApplicationDomains","stacks","deploymentsDomains","convertApplicationDomains","input","attachedDomains","domains","resolveDomains","isProduction","includes","run","env","protect","getParam","region","Provider","Region","USEast1","forwardEverythingOriginRequestPolicyId","disableCachingCachePolicyId","createCloudFrontDefaultCacheBehaviorPolicies","store","addModule","BlueGreenRouterCloudFrontStore","addResource","cloudfront","KeyvaluestoreKey","keyValueStoreArn","cloudFrontStore","output","arn","key","BLUE_GREEN_ROUTER_STORE_KEY","value","apiGateway","BlueGreenRouterApiGateway","BlueGreenRouterCloudFront","cachePolicyId","originRequestPolicyId","domainNames","reduce","collection","domain","source","sources","push","applyCustomDomain","cloudFront","sslSupportMethod","acmCertificateArn","attachDomainsToOutput","tagResources","WebAppName","WbyProjectName","getEnvVariableWebinyProjectName","WbyEnvironment","getEnvVariableWebinyEnv"],"sources":["createBlueGreenPulumiApp.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { Region } from \"@pulumi/aws\";\nimport type { PulumiAppParam } from \"@webiny/pulumi\";\nimport { createPulumiApp } from \"@webiny/pulumi\";\nimport { DEFAULT_PROD_ENV_NAMES } from \"~/constants.js\";\nimport { BlueGreenRouterCloudFront } from \"./BlueGreenRouterCloudFront.js\";\nimport { createCloudFrontDefaultCacheBehaviorPolicies } from \"./cloudfront/createCloudFrontDefaultCacheBehaviorPolicies.js\";\nimport { tagResources } from \"~/utils/tagResources.js\";\nimport { getEnvVariableWebinyProjectName } from \"~/env/projectName.js\";\nimport { getEnvVariableWebinyEnv } from \"~/env/env.js\";\nimport { BlueGreenRouterApiGateway } from \"./BlueGreenRouterApiGateway.js\";\nimport { BlueGreenRouterCloudFrontStore } from \"./BlueGreenRouterCloudFrontStore.js\";\nimport type { IAttachDomainsCallable, IBlueGreenDeployment } from \"./types.js\";\nimport { validateDeployments } from \"./validation/validateDeployments.js\";\nimport { getApplicationDomains } from \"./domains/getApplicationDomains.js\";\nimport { convertApplicationDomains } from \"./domains/convertApplicationDomains.js\";\nimport { resolveDomains } from \"./domains/resolveDomains.js\";\nimport { applyCustomDomain } from \"~/apps/customDomain.js\";\nimport { attachDomainsToOutput } from \"~/apps/blueGreen/domains/attachDomainsToOutput.js\";\nimport { BLUE_GREEN_ROUTER_STORE_KEY } from \"./constants.js\";\n\nexport type BlueGreenRouterPulumiApp = ReturnType<typeof createBlueGreenPulumiApp>;\n\nexport interface ElasticsearchConfig {\n domainName: string;\n indexPrefix: string;\n sharedIndexes: boolean;\n}\n\nexport interface OpenSearchConfig {\n domainName: string;\n indexPrefix: string;\n sharedIndexes: boolean;\n}\n\nexport interface CreateBlueGreenPulumiAppParams {\n /**\n * Secures against deleting database by accident.\n * By default enabled in production environments.\n */\n protect?: PulumiAppParam<boolean>;\n\n /**\n * Enables ElasticSearch infrastructure.\n * Note that it requires also changes in application code.\n */\n elasticSearch?: PulumiAppParam<boolean | Partial<ElasticsearchConfig>>;\n\n /**\n * Enables OpenSearch infrastructure.\n * Note that it requires also changes in application code.\n */\n openSearch?: PulumiAppParam<boolean | Partial<OpenSearchConfig>>;\n\n /**\n * Enables VPC for the application.\n * By default enabled in production environments.\n */\n vpc?: PulumiAppParam<boolean>;\n\n /**\n * Provides a way to adjust existing Pulumi code (cloud infrastructure resources)\n * or add additional ones into the mix.\n */\n pulumi?: (app: BlueGreenRouterPulumiApp) => void | Promise<void>;\n\n /**\n * Prefixes names of all Pulumi cloud infrastructure resource with given prefix.\n */\n pulumiResourceNamePrefix?: PulumiAppParam<string>;\n\n /**\n * Treats provided environments as production environments, which\n * are deployed in production deployment mode.\n * https://www.webiny.com/docs/architecture/deployment-modes/production\n */\n productionEnvironments?: PulumiAppParam<string[]>;\n /**\n * Available deployments for the Blue / Green switch.\n * They will be validated before deploy.\n */\n deployments: () => [IBlueGreenDeployment, IBlueGreenDeployment];\n /**\n * Attach domains to the Blue/Green CloudFront.\n */\n domains: IAttachDomainsCallable;\n}\n\nexport function createBlueGreenPulumiApp(projectAppParams: CreateBlueGreenPulumiAppParams) {\n return createPulumiApp({\n name: \"blueGreen\",\n path: \"apps/blueGreen\",\n config: projectAppParams,\n program: async app => {\n const productionEnvironments =\n app.params.create.productionEnvironments || DEFAULT_PROD_ENV_NAMES;\n\n const deployments = validateDeployments(projectAppParams.deployments());\n\n const applicationsDomains = await getApplicationDomains({\n stacks: deployments\n });\n\n const deploymentsDomains = convertApplicationDomains({\n input: applicationsDomains\n });\n\n const attachedDomains = projectAppParams.domains();\n\n const domains = resolveDomains({\n attachedDomains,\n deploymentsDomains\n });\n const isProduction = productionEnvironments.includes(app.params.run.env);\n const protect = app.getParam(projectAppParams.protect) ?? isProduction;\n\n const region = new aws.Provider(Region.USEast1, {\n region: Region.USEast1\n });\n\n /**\n * Policies required for default Cache Behavior in CloudFront.\n * We need to do this outside the module creation because it is async.\n */\n const { forwardEverythingOriginRequestPolicyId, disableCachingCachePolicyId } =\n await createCloudFrontDefaultCacheBehaviorPolicies();\n const store = app.addModule(BlueGreenRouterCloudFrontStore, {\n protect,\n region\n });\n /**\n * TODO Maybe have switching via deployment instead of changing the key?\n * Key takes up to few minutes to propagate.\n * Deployment takes 10 seconds + 30-60 seconds for the CloudFront to propagate.\n */\n app.addResource(aws.cloudfront.KeyvaluestoreKey, {\n name: \"blue-green-router-store-key\",\n config: {\n keyValueStoreArn: store.cloudFrontStore.output.arn,\n key: BLUE_GREEN_ROUTER_STORE_KEY,\n value: \"green\"\n }\n });\n\n const apiGateway = app.addModule(BlueGreenRouterApiGateway, {\n protect,\n region\n });\n\n const cloudfront = app.addModule(BlueGreenRouterCloudFront, {\n protect,\n region,\n domains,\n cachePolicyId: disableCachingCachePolicyId,\n originRequestPolicyId: forwardEverythingOriginRequestPolicyId\n });\n\n const domainNames = domains.reduce<string[]>((collection, domain) => {\n for (const source of domain.sources) {\n if (collection.includes(source)) {\n continue;\n }\n collection.push(source);\n }\n return collection;\n }, []);\n\n applyCustomDomain(cloudfront.cloudFront, {\n domains: domainNames,\n sslSupportMethod: attachedDomains.sslSupportMethod,\n acmCertificateArn: attachedDomains.acmCertificateArn\n });\n\n attachDomainsToOutput({\n app,\n domains,\n cloudFront: cloudfront.cloudFront\n });\n\n tagResources({\n WebAppName: \"blueGreenRouter\",\n WbyProjectName: getEnvVariableWebinyProjectName(),\n WbyEnvironment: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,EAAElB,2BAA2B;QAC1CmB,qBAAqB,EAAEpB;MAC3B,CAAC,CAAC;MAEF,MAAMqB,WAAW,GAAGjC,OAAO,CAACkC,MAAM,CAAW,CAACC,UAAU,EAAEC,MAAM,KAAK;QACjE,KAAK,MAAMC,MAAM,IAAID,MAAM,CAACE,OAAO,EAAE;UACjC,IAAIH,UAAU,CAAChC,QAAQ,CAACkC,MAAM,CAAC,EAAE;YAC7B;UACJ;UACAF,UAAU,CAACI,IAAI,CAACF,MAAM,CAAC;QAC3B;QACA,OAAOF,UAAU;MACrB,CAAC,EAAE,EAAE,CAAC;MAEN,IAAAK,+BAAiB,EAACrB,UAAU,CAACsB,UAAU,EAAE;QACrCzC,OAAO,EAAEiC,WAAW;QACpBS,gBAAgB,EAAE3C,eAAe,CAAC2C,gBAAgB;QAClDC,iBAAiB,EAAE5C,eAAe,CAAC4C;MACvC,CAAC,CAAC;MAEF,IAAAC,4CAAqB,EAAC;QAClB1D,GAAG;QACHc,OAAO;QACPyC,UAAU,EAAEtB,UAAU,CAACsB;MAC3B,CAAC,CAAC;MAEF,IAAAI,0BAAY,EAAC;QACTC,UAAU,EAAE,iBAAiB;QAC7BC,cAAc,EAAE,IAAAC,4CAA+B,EAAC,CAAC;QACjDC,cAAc,EAAE,IAAAC,4BAAuB,EAAC;MAC5C,CAAC,CAAC;MAEF,OAAO;QACH1C,MAAM;QACNW,UAAU;QACVS,UAAU;QACVb;MACJ,CAAC;IACL;EACJ,CAAC,CAAC;AACN","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_aws","_interopRequireWildcard","require","aws","_pulumi","_constants","_BlueGreenRouterCloudFront","_createCloudFrontDefaultCacheBehaviorPolicies","_tagResources","_projectName","_env","_BlueGreenRouterApiGateway","_BlueGreenRouterCloudFrontStore","_validateDeployments","_getApplicationDomains","_convertApplicationDomains","_resolveDomains","_customDomain","_attachDomainsToOutput","_constants2","createBlueGreenPulumiApp","projectAppParams","createPulumiApp","name","path","config","program","app","productionEnvironments","params","create","DEFAULT_PROD_ENV_NAMES","deployments","validateDeployments","run","applicationsDomains","getApplicationDomains","stacks","deploymentsDomains","convertApplicationDomains","input","attachedDomains","domains","resolveDomains","isProduction","includes","env","protect","getParam","region","Provider","Region","USEast1","forwardEverythingOriginRequestPolicyId","disableCachingCachePolicyId","createCloudFrontDefaultCacheBehaviorPolicies","store","addModule","BlueGreenRouterCloudFrontStore","addResource","cloudfront","KeyvaluestoreKey","keyValueStoreArn","cloudFrontStore","output","arn","key","BLUE_GREEN_ROUTER_STORE_KEY","value","apiGateway","BlueGreenRouterApiGateway","BlueGreenRouterCloudFront","cachePolicyId","originRequestPolicyId","domainNames","reduce","collection","domain","source","sources","push","applyCustomDomain","cloudFront","sslSupportMethod","acmCertificateArn","attachDomainsToOutput","tagResources","WebAppName","WbyProjectName","getEnvVariableWebinyProjectName","WbyEnvironment","getEnvVariableWebinyEnv"],"sources":["createBlueGreenPulumiApp.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { Region } from \"@pulumi/aws\";\nimport type { PulumiAppParam } from \"@webiny/pulumi\";\nimport { createPulumiApp } from \"@webiny/pulumi\";\nimport { DEFAULT_PROD_ENV_NAMES } from \"~/constants.js\";\nimport { BlueGreenRouterCloudFront } from \"./BlueGreenRouterCloudFront.js\";\nimport { createCloudFrontDefaultCacheBehaviorPolicies } from \"./cloudfront/createCloudFrontDefaultCacheBehaviorPolicies.js\";\nimport { tagResources } from \"~/utils/tagResources.js\";\nimport { getEnvVariableWebinyProjectName } from \"~/env/projectName.js\";\nimport { getEnvVariableWebinyEnv } from \"~/env/env.js\";\nimport { BlueGreenRouterApiGateway } from \"./BlueGreenRouterApiGateway.js\";\nimport { BlueGreenRouterCloudFrontStore } from \"./BlueGreenRouterCloudFrontStore.js\";\nimport type { IAttachDomainsCallable, IBlueGreenDeployment } from \"./types.js\";\nimport { validateDeployments } from \"./validation/validateDeployments.js\";\nimport { getApplicationDomains } from \"./domains/getApplicationDomains.js\";\nimport { convertApplicationDomains } from \"./domains/convertApplicationDomains.js\";\nimport { resolveDomains } from \"./domains/resolveDomains.js\";\nimport { applyCustomDomain } from \"~/apps/customDomain.js\";\nimport { attachDomainsToOutput } from \"~/apps/blueGreen/domains/attachDomainsToOutput.js\";\nimport { BLUE_GREEN_ROUTER_STORE_KEY } from \"./constants.js\";\n\nexport type BlueGreenRouterPulumiApp = ReturnType<typeof createBlueGreenPulumiApp>;\n\nexport interface ElasticsearchConfig {\n domainName: string;\n indexPrefix: string;\n sharedIndexes: boolean;\n}\n\nexport interface OpenSearchConfig {\n domainName: string;\n indexPrefix: string;\n sharedIndexes: boolean;\n}\n\nexport interface IDeploymentsCallableParams {\n env: string;\n}\n\nexport interface IDeploymentsCallable {\n (params: IDeploymentsCallableParams): [IBlueGreenDeployment, IBlueGreenDeployment];\n}\n\nexport interface CreateBlueGreenPulumiAppParams {\n /**\n * Secures against deleting database by accident.\n * By default enabled in production environments.\n */\n protect?: PulumiAppParam<boolean>;\n\n /**\n * Enables ElasticSearch infrastructure.\n * Note that it requires also changes in application code.\n */\n elasticSearch?: PulumiAppParam<boolean | Partial<ElasticsearchConfig>>;\n\n /**\n * Enables OpenSearch infrastructure.\n * Note that it requires also changes in application code.\n */\n openSearch?: PulumiAppParam<boolean | Partial<OpenSearchConfig>>;\n\n /**\n * Enables VPC for the application.\n * By default enabled in production environments.\n */\n vpc?: PulumiAppParam<boolean>;\n\n /**\n * Provides a way to adjust existing Pulumi code (cloud infrastructure resources)\n * or add additional ones into the mix.\n */\n pulumi?: (app: BlueGreenRouterPulumiApp) => void | Promise<void>;\n\n /**\n * Prefixes names of all Pulumi cloud infrastructure resource with given prefix.\n */\n pulumiResourceNamePrefix?: PulumiAppParam<string>;\n\n /**\n * Treats provided environments as production environments, which\n * are deployed in production deployment mode.\n * https://www.webiny.com/docs/architecture/deployment-modes/production\n */\n productionEnvironments?: PulumiAppParam<string[]>;\n /**\n * Available deployments for the Blue / Green switch.\n * They will be validated before deploy.\n */\n deployments: IDeploymentsCallable;\n /**\n * Attach domains to the Blue/Green CloudFront.\n */\n domains: IAttachDomainsCallable;\n}\n\nexport function createBlueGreenPulumiApp(projectAppParams: CreateBlueGreenPulumiAppParams) {\n return createPulumiApp({\n name: \"blueGreen\",\n path: \"apps/blueGreen\",\n config: projectAppParams,\n program: async app => {\n const productionEnvironments =\n app.params.create.productionEnvironments || DEFAULT_PROD_ENV_NAMES;\n\n const deployments = validateDeployments(projectAppParams.deployments(app.params.run));\n\n const applicationsDomains = await getApplicationDomains({\n stacks: deployments\n });\n\n const deploymentsDomains = convertApplicationDomains({\n input: applicationsDomains\n });\n\n const attachedDomains = projectAppParams.domains(app.params.run);\n\n const domains = resolveDomains({\n attachedDomains,\n deploymentsDomains\n });\n const isProduction = productionEnvironments.includes(app.params.run.env);\n const protect = app.getParam(projectAppParams.protect) ?? isProduction;\n\n const region = new aws.Provider(Region.USEast1, {\n region: Region.USEast1\n });\n\n /**\n * Policies required for default Cache Behavior in CloudFront.\n * We need to do this outside the module creation because it is async.\n */\n const { forwardEverythingOriginRequestPolicyId, disableCachingCachePolicyId } =\n await createCloudFrontDefaultCacheBehaviorPolicies();\n const store = app.addModule(BlueGreenRouterCloudFrontStore, {\n protect,\n region\n });\n /**\n * TODO Maybe have switching via deployment instead of changing the key?\n * Key takes up to few minutes to propagate.\n * Deployment takes 10 seconds + 30-60 seconds for the CloudFront to propagate.\n */\n app.addResource(aws.cloudfront.KeyvaluestoreKey, {\n name: \"blue-green-router-store-key\",\n config: {\n keyValueStoreArn: store.cloudFrontStore.output.arn,\n key: BLUE_GREEN_ROUTER_STORE_KEY,\n value: \"green\"\n }\n });\n\n const apiGateway = app.addModule(BlueGreenRouterApiGateway, {\n protect,\n region\n });\n\n const cloudfront = app.addModule(BlueGreenRouterCloudFront, {\n protect,\n region,\n domains,\n cachePolicyId: disableCachingCachePolicyId,\n originRequestPolicyId: forwardEverythingOriginRequestPolicyId\n });\n\n const domainNames = domains.reduce<string[]>((collection, domain) => {\n for (const source of domain.sources) {\n if (collection.includes(source)) {\n continue;\n }\n collection.push(source);\n }\n return collection;\n }, []);\n\n applyCustomDomain(cloudfront.cloudFront, {\n domains: domainNames,\n sslSupportMethod: attachedDomains.sslSupportMethod,\n acmCertificateArn: attachedDomains.acmCertificateArn\n });\n\n attachDomainsToOutput({\n app,\n domains,\n cloudFront: cloudfront.cloudFront\n });\n\n tagResources({\n WebAppName: \"blueGreenRouter\",\n WbyProjectName: getEnvVariableWebinyProjectName(),\n WbyEnvironment: getEnvVariableWebinyEnv()\n });\n\n return {\n region,\n cloudfront,\n apiGateway,\n store\n };\n }\n });\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAmC,IAAAC,GAAA,GAAAH,IAAA;AAGnC,IAAAI,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,0BAAA,GAAAJ,OAAA;AACA,IAAAK,6CAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,IAAA,GAAAR,OAAA;AACA,IAAAS,0BAAA,GAAAT,OAAA;AACA,IAAAU,+BAAA,GAAAV,OAAA;AAEA,IAAAW,oBAAA,GAAAX,OAAA;AACA,IAAAY,sBAAA,GAAAZ,OAAA;AACA,IAAAa,0BAAA,GAAAb,OAAA;AACA,IAAAc,eAAA,GAAAd,OAAA;AACA,IAAAe,aAAA,GAAAf,OAAA;AACA,IAAAgB,sBAAA,GAAAhB,OAAA;AACA,IAAAiB,WAAA,GAAAjB,OAAA;AA6EO,SAASkB,wBAAwBA,CAACC,gBAAgD,EAAE;EACvF,OAAO,IAAAC,uBAAe,EAAC;IACnBC,IAAI,EAAE,WAAW;IACjBC,IAAI,EAAE,gBAAgB;IACtBC,MAAM,EAAEJ,gBAAgB;IACxBK,OAAO,EAAE,MAAMC,GAAG,IAAI;MAClB,MAAMC,sBAAsB,G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;QACNW,UAAU;QACVS,UAAU;QACVb;MACJ,CAAC;IACL;EACJ,CAAC,CAAC;AACN","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["attachDomainsToOutput","params","app","cloudFront","addHandler","distributionDomain","output","domainName","distributionUrl","apply","value","addOutputs","domains","config","aliases","alias","push","exports"],"sources":["attachDomainsToOutput.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { type PulumiApp, type PulumiAppResource } from \"@webiny/pulumi\";\nimport type { IResolvedDomains } from \"~/apps/blueGreen/types.js\";\n\nexport interface IAttachDomainsToOutputParams {\n app: PulumiApp;\n domains: IResolvedDomains;\n cloudFront: PulumiAppResource<typeof aws.cloudfront.Distribution>;\n}\n\nexport const attachDomainsToOutput = (params: IAttachDomainsToOutputParams) => {\n const { app, cloudFront } = params;\n\n app.addHandler(() => {\n const distributionDomain = cloudFront.output.domainName;\n const distributionUrl = distributionDomain.apply(value => `https://${value}`);\n\n app.addOutputs({\n [\"distributionDomain\"]: distributionDomain,\n [\"distributionUrl\"]: distributionUrl,\n [\"environments\"]: params.domains,\n [\"domains\"]: []\n });\n // We're adjusting the outputs via the `config.aliases` setter.\n // At the time of implementing this, could not find a better solution.\n cloudFront.config.aliases(aliases => {\n const domains: string[] = [];\n\n for (const alias of aliases || []) {\n domains.push(alias);\n }\n\n app.addOutputs({\n [\"domains\"]: domains\n });\n\n return aliases;\n });\n });\n};\n"],"mappings":";;;;;;AAUO,MAAMA,qBAAqB,GAAIC,MAAoC,IAAK;EAC3E,MAAM;IAAEC,GAAG;IAAEC;EAAW,CAAC,GAAGF,MAAM;EAElCC,GAAG,CAACE,UAAU,CAAC,MAAM;IACjB,MAAMC,kBAAkB,GAAGF,UAAU,CAACG,MAAM,CAACC,UAAU;IACvD,MAAMC,eAAe,GAAGH,kBAAkB,CAACI,KAAK,CAACC,KAAK,IAAI,WAAWA,KAAK,EAAE,CAAC;IAE7ER,GAAG,CAACS,UAAU,CAAC;MACX,CAAC,oBAAoB,GAAGN,kBAAkB;MAC1C,CAAC,iBAAiB,GAAGG,eAAe;MACpC,CAAC,cAAc,GAAGP,MAAM,CAACW,OAAO;MAChC,CAAC,SAAS,GAAG;IACjB,CAAC,CAAC;IACF;IACA;IACAT,UAAU,CAACU,MAAM,CAACC,OAAO,CAACA,OAAO,IAAI;MACjC,MAAMF,OAAiB,GAAG,EAAE;MAE5B,KAAK,MAAMG,KAAK,IAAID,OAAO,IAAI,EAAE,EAAE;QAC/BF,OAAO,CAACI,IAAI,CAACD,KAAK,CAAC;MACvB;MAEAb,GAAG,CAACS,UAAU,CAAC;QACX,CAAC,SAAS,GAAGC;MACjB,CAAC,CAAC;MAEF,OAAOE,OAAO;IAClB,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAACG,OAAA,CAAAjB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["attachDomainsToOutput","params","app","cloudFront","addHandler","distributionDomain","output","domainName","distributionUrl","apply","value","addOutputs","domains","config","aliases","alias","push","exports"],"sources":["attachDomainsToOutput.ts"],"sourcesContent":["import type * as aws from \"@pulumi/aws\";\nimport { type PulumiApp, type PulumiAppResource } from \"@webiny/pulumi\";\nimport type { IResolvedDomains } from \"~/apps/blueGreen/types.js\";\n\nexport interface IAttachDomainsToOutputParams {\n app: PulumiApp;\n domains: IResolvedDomains;\n cloudFront: PulumiAppResource<typeof aws.cloudfront.Distribution>;\n}\n\nexport const attachDomainsToOutput = (params: IAttachDomainsToOutputParams) => {\n const { app, cloudFront } = params;\n\n app.addHandler(() => {\n const distributionDomain = cloudFront.output.domainName;\n const distributionUrl = distributionDomain.apply(value => `https://${value}`);\n\n app.addOutputs({\n [\"distributionDomain\"]: distributionDomain,\n [\"distributionUrl\"]: distributionUrl,\n [\"environments\"]: params.domains,\n [\"domains\"]: []\n });\n // We're adjusting the outputs via the `config.aliases` setter.\n // At the time of implementing this, could not find a better solution.\n cloudFront.config.aliases(aliases => {\n const domains: string[] = [];\n\n for (const alias of aliases || []) {\n domains.push(alias);\n }\n\n app.addOutputs({\n [\"domains\"]: domains\n });\n\n return aliases;\n });\n });\n};\n"],"mappings":";;;;;;AAUO,MAAMA,qBAAqB,GAAIC,MAAoC,IAAK;EAC3E,MAAM;IAAEC,GAAG;IAAEC;EAAW,CAAC,GAAGF,MAAM;EAElCC,GAAG,CAACE,UAAU,CAAC,MAAM;IACjB,MAAMC,kBAAkB,GAAGF,UAAU,CAACG,MAAM,CAACC,UAAU;IACvD,MAAMC,eAAe,GAAGH,kBAAkB,CAACI,KAAK,CAACC,KAAK,IAAI,WAAWA,KAAK,EAAE,CAAC;IAE7ER,GAAG,CAACS,UAAU,CAAC;MACX,CAAC,oBAAoB,GAAGN,kBAAkB;MAC1C,CAAC,iBAAiB,GAAGG,eAAe;MACpC,CAAC,cAAc,GAAGP,MAAM,CAACW,OAAO;MAChC,CAAC,SAAS,GAAG;IACjB,CAAC,CAAC;IACF;IACA;IACAT,UAAU,CAACU,MAAM,CAACC,OAAO,CAACA,OAAO,IAAI;MACjC,MAAMF,OAAiB,GAAG,EAAE;MAE5B,KAAK,MAAMG,KAAK,IAAID,OAAO,IAAI,EAAE,EAAE;QAC/BF,OAAO,CAACI,IAAI,CAACD,KAAK,CAAC;MACvB;MAEAb,GAAG,CAACS,UAAU,CAAC;QACX,CAAC,SAAS,GAAGC;MACjB,CAAC,CAAC;MAEF,OAAOE,OAAO;IAClB,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAACG,OAAA,CAAAjB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
|
@@ -39,8 +39,11 @@ export interface IAttachedDomains {
|
|
|
39
39
|
*/
|
|
40
40
|
domains?: IAttachedDomainsTypes;
|
|
41
41
|
}
|
|
42
|
+
export interface IAttachDomainsCallableParams {
|
|
43
|
+
env: string;
|
|
44
|
+
}
|
|
42
45
|
export interface IAttachDomainsCallable {
|
|
43
|
-
(): IAttachedDomains;
|
|
46
|
+
(params: IAttachDomainsCallableParams): IAttachedDomains;
|
|
44
47
|
}
|
|
45
48
|
export type IAttachedDomainKey = keyof IAttachedDomainsTypes;
|
|
46
49
|
export interface IResolvedDomain {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { IStackOutput } from \"@webiny/cli-plugin-deploy-pulumi/utils/index.js\";\n\nexport type GenericRecord<K extends PropertyKey = PropertyKey, V = any> = Record<K, V>;\n\nexport type NonEmptyArray<T> = [T, ...T[]];\n\nexport interface IDeploymentDomain {\n /**\n * A name of the deployment (e.g. \"green\" or \"blue\").\n */\n name: string;\n env: string;\n variant: string | undefined;\n domains: {\n api: string;\n admin: string;\n website: string | undefined;\n preview: string | undefined;\n };\n}\n\nexport type IDeploymentsDomains = [IDeploymentDomain, IDeploymentDomain];\n\nexport interface IBlueGreenDeployment {\n /**\n * Name by this deployment will be accessible in the Pulumi program.\n */\n name: string;\n env: string;\n variant: string | undefined;\n}\n\nexport interface IAttachedDomainsTypes {\n api: NonEmptyArray<string>;\n admin: NonEmptyArray<string>;\n website: NonEmptyArray<string> | undefined;\n preview: NonEmptyArray<string> | undefined;\n}\n\nexport interface IAttachedDomains {\n acmCertificateArn: string;\n sslSupportMethod?: string;\n /**\n * We need to allow system to be deployed without any domains for start.\n * User can attach domains later.\n */\n domains?: IAttachedDomainsTypes;\n}\n\nexport interface IAttachDomainsCallable {\n (): IAttachedDomains;\n}\n\nexport type IAttachedDomainKey = keyof IAttachedDomainsTypes;\n\nexport interface IResolvedDomain {\n /**\n * Environment and variant of the deployment.\n */\n env: string;\n variant: string | undefined;\n /**\n * Name of the deployment (e.g. \"green\" or \"blue\").\n */\n name: string;\n /**\n * Type of the domain (e.g. \"api\", \"admin\", \"website\", \"preview\").\n */\n type: IAttachedDomainKey;\n /**\n * List of domains that will be used as source and transferred to the target domain.\n */\n sources: NonEmptyArray<string>;\n /**\n * The target CloudFront domain of the deployment.\n */\n target: string;\n}\n\nexport type IResolvedDomains = IResolvedDomain[];\n\nexport interface IBlueGreenStackOutput extends IStackOutput {\n distributionDomain: string;\n distributionUrl: string;\n /**\n * TODO fix later\n */\n // @ts-expect-error\n environments?: IResolvedDomains;\n domains?: string[];\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { IStackOutput } from \"@webiny/cli-plugin-deploy-pulumi/utils/index.js\";\n\nexport type GenericRecord<K extends PropertyKey = PropertyKey, V = any> = Record<K, V>;\n\nexport type NonEmptyArray<T> = [T, ...T[]];\n\nexport interface IDeploymentDomain {\n /**\n * A name of the deployment (e.g. \"green\" or \"blue\").\n */\n name: string;\n env: string;\n variant: string | undefined;\n domains: {\n api: string;\n admin: string;\n website: string | undefined;\n preview: string | undefined;\n };\n}\n\nexport type IDeploymentsDomains = [IDeploymentDomain, IDeploymentDomain];\n\nexport interface IBlueGreenDeployment {\n /**\n * Name by this deployment will be accessible in the Pulumi program.\n */\n name: string;\n env: string;\n variant: string | undefined;\n}\n\nexport interface IAttachedDomainsTypes {\n api: NonEmptyArray<string>;\n admin: NonEmptyArray<string>;\n website: NonEmptyArray<string> | undefined;\n preview: NonEmptyArray<string> | undefined;\n}\n\nexport interface IAttachedDomains {\n acmCertificateArn: string;\n sslSupportMethod?: string;\n /**\n * We need to allow system to be deployed without any domains for start.\n * User can attach domains later.\n */\n domains?: IAttachedDomainsTypes;\n}\n\nexport interface IAttachDomainsCallableParams {\n env: string;\n}\n\nexport interface IAttachDomainsCallable {\n (params: IAttachDomainsCallableParams): IAttachedDomains;\n}\n\nexport type IAttachedDomainKey = keyof IAttachedDomainsTypes;\n\nexport interface IResolvedDomain {\n /**\n * Environment and variant of the deployment.\n */\n env: string;\n variant: string | undefined;\n /**\n * Name of the deployment (e.g. \"green\" or \"blue\").\n */\n name: string;\n /**\n * Type of the domain (e.g. \"api\", \"admin\", \"website\", \"preview\").\n */\n type: IAttachedDomainKey;\n /**\n * List of domains that will be used as source and transferred to the target domain.\n */\n sources: NonEmptyArray<string>;\n /**\n * The target CloudFront domain of the deployment.\n */\n target: string;\n}\n\nexport type IResolvedDomains = IResolvedDomain[];\n\nexport interface IBlueGreenStackOutput extends IStackOutput {\n distributionDomain: string;\n distributionUrl: string;\n /**\n * TODO fix later\n */\n // @ts-expect-error\n environments?: IResolvedDomains;\n domains?: string[];\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { PulumiAppModule } from "@webiny/pulumi";
|
|
1
|
+
import type { PulumiAppModule } from "@webiny/pulumi";
|
|
2
2
|
export type CoreOutput = PulumiAppModule<typeof CoreOutput>;
|
|
3
3
|
export declare const CoreOutput: import("@webiny/pulumi").PulumiAppModuleDefinition<import("@pulumi/pulumi").Output<import("@pulumi/pulumi").UnwrappedObject<{
|
|
4
4
|
fileManagerBucketId: string;
|
|
5
|
+
fileManagerBucketArn: string;
|
|
5
6
|
primaryDynamodbTableArn: string;
|
|
6
7
|
primaryDynamodbTableName: string;
|
|
7
8
|
primaryDynamodbTableHashKey: string;
|
|
@@ -20,6 +20,7 @@ const CoreOutput = exports.CoreOutput = (0, _pulumi.createAppModule)({
|
|
|
20
20
|
}
|
|
21
21
|
return {
|
|
22
22
|
fileManagerBucketId: output["fileManagerBucketId"],
|
|
23
|
+
fileManagerBucketArn: output["fileManagerBucketArn"],
|
|
23
24
|
primaryDynamodbTableArn: output["primaryDynamodbTableArn"],
|
|
24
25
|
primaryDynamodbTableName: output["primaryDynamodbTableName"],
|
|
25
26
|
primaryDynamodbTableHashKey: output["primaryDynamodbTableHashKey"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pulumi","require","_utils","CoreOutput","exports","createAppModule","name","config","app","addHandler","output","getStackOutput","folder","env","params","run","variant","Error","fileManagerBucketId","primaryDynamodbTableArn","primaryDynamodbTableName","primaryDynamodbTableHashKey","primaryDynamodbTableRangeKey","logDynamodbTableArn","logDynamodbTableName","logDynamodbTableHashKey","logDynamodbTableRangeKey","cognitoUserPoolId","cognitoUserPoolArn","cognitoUserPoolPasswordPolicy","cognitoAppClientId","eventBusName","eventBusArn","vpcPublicSubnetIds","vpcPrivateSubnetIds","vpcSecurityGroupIds","elasticsearchDomainArn","elasticsearchDomainEndpoint","elasticsearchDynamodbTableArn","elasticsearchDynamodbTableName"],"sources":["CoreOutput.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["_pulumi","require","_utils","CoreOutput","exports","createAppModule","name","config","app","addHandler","output","getStackOutput","folder","env","params","run","variant","Error","fileManagerBucketId","fileManagerBucketArn","primaryDynamodbTableArn","primaryDynamodbTableName","primaryDynamodbTableHashKey","primaryDynamodbTableRangeKey","logDynamodbTableArn","logDynamodbTableName","logDynamodbTableHashKey","logDynamodbTableRangeKey","cognitoUserPoolId","cognitoUserPoolArn","cognitoUserPoolPasswordPolicy","cognitoAppClientId","eventBusName","eventBusArn","vpcPublicSubnetIds","vpcPrivateSubnetIds","vpcSecurityGroupIds","elasticsearchDomainArn","elasticsearchDomainEndpoint","elasticsearchDynamodbTableArn","elasticsearchDynamodbTableName"],"sources":["CoreOutput.ts"],"sourcesContent":["import type { PulumiAppModule } from \"@webiny/pulumi\";\nimport { createAppModule } from \"@webiny/pulumi\";\nimport { getStackOutput } from \"@webiny/cli-plugin-deploy-pulumi/utils\";\n\nexport type CoreOutput = PulumiAppModule<typeof CoreOutput>;\n\nexport const CoreOutput = createAppModule({\n name: \"CoreOutput\",\n config(app) {\n return app.addHandler(async () => {\n const output = getStackOutput({\n folder: \"apps/core\",\n env: app.params.run.env,\n variant: app.params.run.variant\n });\n\n if (!output) {\n throw new Error(\"Core application is not deployed.\");\n }\n\n return {\n fileManagerBucketId: output[\"fileManagerBucketId\"],\n fileManagerBucketArn: output[\"fileManagerBucketArn\"],\n primaryDynamodbTableArn: output[\"primaryDynamodbTableArn\"],\n primaryDynamodbTableName: output[\"primaryDynamodbTableName\"],\n primaryDynamodbTableHashKey: output[\"primaryDynamodbTableHashKey\"],\n primaryDynamodbTableRangeKey: output[\"primaryDynamodbTableRangeKey\"],\n logDynamodbTableArn: output[\"logDynamodbTableArn\"],\n logDynamodbTableName: output[\"logDynamodbTableName\"],\n logDynamodbTableHashKey: output[\"logDynamodbTableHashKey\"],\n logDynamodbTableRangeKey: output[\"logDynamodbTableRangeKey\"],\n cognitoUserPoolId: output[\"cognitoUserPoolId\"],\n cognitoUserPoolArn: output[\"cognitoUserPoolArn\"],\n cognitoUserPoolPasswordPolicy: output[\"cognitoUserPoolPasswordPolicy\"],\n cognitoAppClientId: output[\"cognitoAppClientId\"],\n eventBusName: output[\"eventBusName\"],\n eventBusArn: output[\"eventBusArn\"],\n // These outputs are optional, since VPC is not always enabled.\n vpcPublicSubnetIds: output[\"vpcPublicSubnetIds\"],\n vpcPrivateSubnetIds: output[\"vpcPrivateSubnetIds\"],\n vpcSecurityGroupIds: output[\"vpcSecurityGroupIds\"],\n // These outputs are optional, since Elasticsearch is not always enabled.\n elasticsearchDomainArn: output[\"elasticsearchDomainArn\"],\n elasticsearchDomainEndpoint: output[\"elasticsearchDomainEndpoint\"],\n elasticsearchDynamodbTableArn: output[\"elasticsearchDynamodbTableArn\"],\n elasticsearchDynamodbTableName: output[\"elasticsearchDynamodbTableName\"]\n };\n });\n }\n});\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAIO,MAAME,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,IAAAE,uBAAe,EAAC;EACtCC,IAAI,EAAE,YAAY;EAClBC,MAAMA,CAACC,GAAG,EAAE;IACR,OAAOA,GAAG,CAACC,UAAU,CAAC,YAAY;MAC9B,MAAMC,MAAM,GAAG,IAAAC,qBAAc,EAAC;QAC1BC,MAAM,EAAE,WAAW;QACnBC,GAAG,EAAEL,GAAG,CAACM,MAAM,CAACC,GAAG,CAACF,GAAG;QACvBG,OA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,6BAA6B,EAAE7B,MAAM,CAAC,+BAA+B,CAAC;QACtE8B,8BAA8B,EAAE9B,MAAM,CAAC,gCAAgC;MAC3E,CAAC;IACL,CAAC,CAAC;EACN;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pulumi","require","_CoreOutput","VpcConfig","exports","createAppModule","name","config","app","params","getModule","CoreOutput","apply","core","functionVpcConfig","subnetIds","securityGroupIds","enabled","Boolean","vpcPrivateSubnetIds","vpcSecurityGroupIds"],"sources":["VpcConfig.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\n\nimport { createAppModule } from \"@webiny/pulumi\";\nimport { CoreOutput } from \"./CoreOutput\";\n\nexport interface VpcParams {\n enabled: boolean | undefined;\n}\n\nexport const VpcConfig = createAppModule({\n name: \"VpcConfig\",\n config(app, params: VpcParams) {\n return app.getModule(CoreOutput).apply(core => {\n const functionVpcConfig: aws.types.input.lambda.FunctionVpcConfig = {\n subnetIds: [],\n securityGroupIds: []\n };\n\n const enabled = Boolean(params.enabled);\n\n if (enabled) {\n // If VPC is not manually disabled we extract details from core.\n functionVpcConfig.subnetIds = core.vpcPrivateSubnetIds || [];\n functionVpcConfig.securityGroupIds = core.vpcSecurityGroupIds || [];\n }\n\n return {\n functionVpcConfig,\n enabled\n };\n });\n }\n});\n"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAMO,MAAME,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,uBAAe,EAAC;EACrCC,IAAI,EAAE,WAAW;EACjBC,MAAMA,CAACC,GAAG,EAAEC,MAAiB,EAAE;IAC3B,OAAOD,GAAG,CAACE,SAAS,CAACC,sBAAU,CAAC,CAACC,KAAK,CAACC,IAAI,IAAI;MAC3C,MAAMC,iBAA2D,GAAG;QAChEC,SAAS,EAAE,EAAE;QACbC,gBAAgB,EAAE;MACtB,CAAC;MAED,MAAMC,OAAO,GAAGC,OAAO,CAACT,MAAM,CAACQ,OAAO,CAAC;MAEvC,IAAIA,OAAO,EAAE;QACT;QACAH,iBAAiB,CAACC,SAAS,GAAGF,IAAI,CAACM,mBAAmB,IAAI,EAAE;QAC5DL,iBAAiB,CAACE,gBAAgB,GAAGH,IAAI,CAACO,mBAAmB,IAAI,EAAE;MACvE;MAEA,OAAO;QACHN,iBAAiB;QACjBG;MACJ,CAAC;IACL,CAAC,CAAC;EACN;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_pulumi","require","_CoreOutput","VpcConfig","exports","createAppModule","name","config","app","params","getModule","CoreOutput","apply","core","functionVpcConfig","subnetIds","securityGroupIds","enabled","Boolean","vpcPrivateSubnetIds","vpcSecurityGroupIds"],"sources":["VpcConfig.ts"],"sourcesContent":["import type * as aws from \"@pulumi/aws\";\n\nimport { createAppModule } from \"@webiny/pulumi\";\nimport { CoreOutput } from \"./CoreOutput\";\n\nexport interface VpcParams {\n enabled: boolean | undefined;\n}\n\nexport const VpcConfig = createAppModule({\n name: \"VpcConfig\",\n config(app, params: VpcParams) {\n return app.getModule(CoreOutput).apply(core => {\n const functionVpcConfig: aws.types.input.lambda.FunctionVpcConfig = {\n subnetIds: [],\n securityGroupIds: []\n };\n\n const enabled = Boolean(params.enabled);\n\n if (enabled) {\n // If VPC is not manually disabled we extract details from core.\n functionVpcConfig.subnetIds = core.vpcPrivateSubnetIds || [];\n functionVpcConfig.securityGroupIds = core.vpcSecurityGroupIds || [];\n }\n\n return {\n functionVpcConfig,\n enabled\n };\n });\n }\n});\n"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAMO,MAAME,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,uBAAe,EAAC;EACrCC,IAAI,EAAE,WAAW;EACjBC,MAAMA,CAACC,GAAG,EAAEC,MAAiB,EAAE;IAC3B,OAAOD,GAAG,CAACE,SAAS,CAACC,sBAAU,CAAC,CAACC,KAAK,CAACC,IAAI,IAAI;MAC3C,MAAMC,iBAA2D,GAAG;QAChEC,SAAS,EAAE,EAAE;QACbC,gBAAgB,EAAE;MACtB,CAAC;MAED,MAAMC,OAAO,GAAGC,OAAO,CAACT,MAAM,CAACQ,OAAO,CAAC;MAEvC,IAAIA,OAAO,EAAE;QACT;QACAH,iBAAiB,CAACC,SAAS,GAAGF,IAAI,CAACM,mBAAmB,IAAI,EAAE;QAC5DL,iBAAiB,CAACE,gBAAgB,GAAGH,IAAI,CAACO,mBAAmB,IAAI,EAAE;MACvE;MAEA,OAAO;QACHN,iBAAiB;QACjBG;MACJ,CAAC;IACL,CAAC,CAAC;EACN;AACJ,CAAC,CAAC","ignoreList":[]}
|