@webiny/pulumi-aws 5.25.0-beta.6 → 5.25.1-beta.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/AdminApp.d.ts +14 -0
- package/apps/admin/AdminApp.js +134 -0
- package/apps/admin/AdminApp.js.map +1 -0
- package/apps/admin/AdminUpload.d.ts +6 -0
- package/apps/admin/AdminUpload.js +50 -0
- package/apps/admin/AdminUpload.js.map +1 -0
- package/apps/api/ApiApp.d.ts +66 -0
- package/apps/api/ApiApp.js +223 -0
- package/apps/api/ApiApp.js.map +1 -0
- package/apps/api/ApiApwScheduler.d.ts +23 -0
- package/apps/api/ApiApwScheduler.js +240 -0
- package/apps/api/ApiApwScheduler.js.map +1 -0
- package/apps/api/ApiCloudfront.d.ts +4 -0
- package/apps/api/ApiCloudfront.js +103 -0
- package/apps/api/ApiCloudfront.js.map +1 -0
- package/apps/api/ApiFileManager.d.ts +18 -0
- package/apps/api/ApiFileManager.js +168 -0
- package/apps/api/ApiFileManager.js.map +1 -0
- package/apps/api/ApiGateway.d.ts +19 -0
- package/apps/api/ApiGateway.js +90 -0
- package/apps/api/ApiGateway.js.map +1 -0
- package/apps/api/ApiGraphql.d.ts +27 -0
- package/apps/api/ApiGraphql.js +128 -0
- package/apps/api/ApiGraphql.js.map +1 -0
- package/apps/api/ApiHeadlessCMS.d.ts +18 -0
- package/apps/api/ApiHeadlessCMS.js +90 -0
- package/apps/api/ApiHeadlessCMS.js.map +1 -0
- package/apps/api/ApiLambdaUtils.d.ts +11 -0
- package/apps/api/ApiLambdaUtils.js +45 -0
- package/apps/api/ApiLambdaUtils.js.map +1 -0
- package/apps/api/ApiPageBuilder.d.ts +40 -0
- package/apps/api/ApiPageBuilder.js +289 -0
- package/apps/api/ApiPageBuilder.js.map +1 -0
- package/apps/api/ApiPrerendering.d.ts +24 -0
- package/apps/api/ApiPrerendering.js +200 -0
- package/apps/api/ApiPrerendering.js.map +1 -0
- package/apps/api/ApiVpc.d.ts +10 -0
- package/apps/api/ApiVpc.js +129 -0
- package/apps/api/ApiVpc.js.map +1 -0
- package/apps/api/index.d.ts +8 -0
- package/apps/api/index.js +109 -0
- package/apps/api/index.js.map +1 -0
- package/apps/awsUtils.d.ts +3 -0
- package/apps/awsUtils.js +25 -0
- package/apps/awsUtils.js.map +1 -0
- package/apps/createAppBucket.d.ts +13 -0
- package/apps/createAppBucket.js +107 -0
- package/apps/createAppBucket.js.map +1 -0
- package/apps/customDomain.d.ts +9 -0
- package/apps/customDomain.js +14 -0
- package/apps/customDomain.js.map +1 -0
- package/apps/getStorageOutput.d.ts +13 -0
- package/apps/getStorageOutput.js +29 -0
- package/apps/getStorageOutput.js.map +1 -0
- package/apps/index.d.ts +5 -0
- package/apps/index.js +72 -0
- package/apps/index.js.map +1 -0
- package/apps/storage/StorageApp.d.ts +16 -0
- package/apps/storage/StorageApp.js +90 -0
- package/apps/storage/StorageApp.js.map +1 -0
- package/apps/storage/StorageCognito.d.ts +11 -0
- package/apps/storage/StorageCognito.js +102 -0
- package/apps/storage/StorageCognito.js.map +1 -0
- package/apps/storage/StorageDynamo.d.ts +6 -0
- package/apps/storage/StorageDynamo.js +53 -0
- package/apps/storage/StorageDynamo.js.map +1 -0
- package/apps/storage/StorageFileManager.d.ts +6 -0
- package/apps/storage/StorageFileManager.js +40 -0
- package/apps/storage/StorageFileManager.js.map +1 -0
- package/apps/storage/index.d.ts +4 -0
- package/apps/storage/index.js +57 -0
- package/apps/storage/index.js.map +1 -0
- package/apps/website/WebsiteApp.d.ts +22 -0
- package/apps/website/WebsiteApp.js +206 -0
- package/apps/website/WebsiteApp.js.map +1 -0
- package/apps/website/WebsiteHookRender.d.ts +1 -0
- package/apps/website/WebsiteHookRender.js +65 -0
- package/apps/website/WebsiteHookRender.js.map +1 -0
- package/apps/website/WebsiteHookUpdatePbSettings.d.ts +5 -0
- package/apps/website/WebsiteHookUpdatePbSettings.js +80 -0
- package/apps/website/WebsiteHookUpdatePbSettings.js.map +1 -0
- package/apps/website/WebsiteHookUpload.d.ts +1 -0
- package/apps/website/WebsiteHookUpload.js +65 -0
- package/apps/website/WebsiteHookUpload.js.map +1 -0
- package/components/tenantRouter/functions/origin/request.js +54 -8
- package/components/tenantRouter/functions/origin/request.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +18 -1
- package/index.js.map +1 -1
- package/package.json +10 -6
- package/types.d.ts +2 -0
- package/types.js +5 -0
- package/types.js.map +1 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.StorageApp = void 0;
|
|
9
|
+
exports.createStorageApp = createStorageApp;
|
|
10
|
+
|
|
11
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
+
|
|
13
|
+
var _pulumiSdk = require("@webiny/pulumi-sdk");
|
|
14
|
+
|
|
15
|
+
var _StorageCognito = require("./StorageCognito");
|
|
16
|
+
|
|
17
|
+
var _StorageDynamo = require("./StorageDynamo");
|
|
18
|
+
|
|
19
|
+
var _StorageFileManager = require("./StorageFileManager");
|
|
20
|
+
|
|
21
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
+
|
|
23
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
|
+
|
|
25
|
+
const StorageApp = (0, _pulumiSdk.defineApp)({
|
|
26
|
+
name: "storage",
|
|
27
|
+
|
|
28
|
+
config(app, config) {
|
|
29
|
+
var _config$protect, _config$legacy;
|
|
30
|
+
|
|
31
|
+
const protect = ((_config$protect = config.protect) === null || _config$protect === void 0 ? void 0 : _config$protect.call(config, app.ctx)) ?? app.ctx.env !== "dev";
|
|
32
|
+
const legacyConfig = (config === null || config === void 0 ? void 0 : (_config$legacy = config.legacy) === null || _config$legacy === void 0 ? void 0 : _config$legacy.call(config, app.ctx)) ?? {}; // Setup DynamoDB table
|
|
33
|
+
|
|
34
|
+
const dynamoDbTable = app.addModule(_StorageDynamo.StorageDynamo, {
|
|
35
|
+
protect
|
|
36
|
+
}); // Setup Cognito
|
|
37
|
+
|
|
38
|
+
const cognito = app.addModule(_StorageCognito.StorageCognito, {
|
|
39
|
+
protect,
|
|
40
|
+
useEmailAsUsername: legacyConfig.useEmailAsUsername ?? false
|
|
41
|
+
}); // Setup file storage bucket
|
|
42
|
+
|
|
43
|
+
const fileManagerBucket = app.addModule(_StorageFileManager.StorageFileManger, {
|
|
44
|
+
protect
|
|
45
|
+
});
|
|
46
|
+
app.addOutputs({
|
|
47
|
+
fileManagerBucketId: fileManagerBucket.output.id,
|
|
48
|
+
primaryDynamodbTableArn: dynamoDbTable.output.arn,
|
|
49
|
+
primaryDynamodbTableName: dynamoDbTable.output.name,
|
|
50
|
+
primaryDynamodbTableHashKey: dynamoDbTable.output.hashKey,
|
|
51
|
+
primaryDynamodbTableRangeKey: dynamoDbTable.output.rangeKey,
|
|
52
|
+
cognitoUserPoolId: cognito.userPool.output.id,
|
|
53
|
+
cognitoUserPoolArn: cognito.userPool.output.arn,
|
|
54
|
+
cognitoUserPoolPasswordPolicy: cognito.userPool.output.passwordPolicy,
|
|
55
|
+
cognitoAppClientId: cognito.userPoolClient.output.id
|
|
56
|
+
});
|
|
57
|
+
return _objectSpread(_objectSpread({
|
|
58
|
+
dynamoDbTable
|
|
59
|
+
}, cognito), {}, {
|
|
60
|
+
fileManagerBucket
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
});
|
|
65
|
+
exports.StorageApp = StorageApp;
|
|
66
|
+
|
|
67
|
+
function createStorageApp(config) {
|
|
68
|
+
return (0, _pulumiSdk.createGenericApplication)({
|
|
69
|
+
id: "storage",
|
|
70
|
+
name: "storage",
|
|
71
|
+
description: "Your project's persistent storages.",
|
|
72
|
+
|
|
73
|
+
async app(ctx) {
|
|
74
|
+
var _config$config;
|
|
75
|
+
|
|
76
|
+
// Create the app instance.
|
|
77
|
+
const app = new StorageApp(ctx); // Run the default application setup.
|
|
78
|
+
|
|
79
|
+
await app.setup(config || {}); // Run the custom user config.
|
|
80
|
+
|
|
81
|
+
await (config === null || config === void 0 ? void 0 : (_config$config = config.config) === null || _config$config === void 0 ? void 0 : _config$config.call(config, app, ctx));
|
|
82
|
+
return app;
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
onBeforeBuild: config === null || config === void 0 ? void 0 : config.onBeforeBuild,
|
|
86
|
+
onAfterBuild: config === null || config === void 0 ? void 0 : config.onAfterBuild,
|
|
87
|
+
onBeforeDeploy: config === null || config === void 0 ? void 0 : config.onBeforeDeploy,
|
|
88
|
+
onAfterDeploy: config === null || config === void 0 ? void 0 : config.onAfterDeploy
|
|
89
|
+
});
|
|
90
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["StorageApp.ts"],"names":["StorageApp","name","config","app","protect","ctx","env","legacyConfig","legacy","dynamoDbTable","addModule","StorageDynamo","cognito","StorageCognito","useEmailAsUsername","fileManagerBucket","StorageFileManger","addOutputs","fileManagerBucketId","output","id","primaryDynamodbTableArn","arn","primaryDynamodbTableName","primaryDynamodbTableHashKey","hashKey","primaryDynamodbTableRangeKey","rangeKey","cognitoUserPoolId","userPool","cognitoUserPoolArn","cognitoUserPoolPasswordPolicy","passwordPolicy","cognitoAppClientId","userPoolClient","createStorageApp","description","setup","onBeforeBuild","onAfterBuild","onBeforeDeploy","onAfterDeploy"],"mappings":"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","sourcesContent":["import {\n defineApp,\n createGenericApplication,\n ApplicationContext,\n ApplicationHooks,\n ApplicationConfig\n} from \"@webiny/pulumi-sdk\";\n\nimport { StorageCognito } from \"./StorageCognito\";\nimport { StorageDynamo } from \"./StorageDynamo\";\nimport { StorageFileManger } from \"./StorageFileManager\";\n\nexport interface StorageAppConfig extends Partial<ApplicationHooks> {\n protect?(ctx: ApplicationContext): boolean;\n legacy?(ctx: ApplicationContext): StorageAppLegacyConfig;\n}\n\nexport interface StorageAppLegacyConfig {\n useEmailAsUsername?: boolean;\n}\n\nexport const StorageApp = defineApp({\n name: \"storage\",\n config(app, config: StorageAppConfig) {\n const protect = config.protect?.(app.ctx) ?? app.ctx.env !== \"dev\";\n const legacyConfig = config?.legacy?.(app.ctx) ?? {};\n\n // Setup DynamoDB table\n const dynamoDbTable = app.addModule(StorageDynamo, { protect });\n\n // Setup Cognito\n const cognito = app.addModule(StorageCognito, {\n protect,\n useEmailAsUsername: legacyConfig.useEmailAsUsername ?? false\n });\n\n // Setup file storage bucket\n const fileManagerBucket = app.addModule(StorageFileManger, { protect });\n\n app.addOutputs({\n fileManagerBucketId: fileManagerBucket.output.id,\n primaryDynamodbTableArn: dynamoDbTable.output.arn,\n primaryDynamodbTableName: dynamoDbTable.output.name,\n primaryDynamodbTableHashKey: dynamoDbTable.output.hashKey,\n primaryDynamodbTableRangeKey: dynamoDbTable.output.rangeKey,\n cognitoUserPoolId: cognito.userPool.output.id,\n cognitoUserPoolArn: cognito.userPool.output.arn,\n cognitoUserPoolPasswordPolicy: cognito.userPool.output.passwordPolicy,\n cognitoAppClientId: cognito.userPoolClient.output.id\n });\n\n return {\n dynamoDbTable,\n ...cognito,\n fileManagerBucket\n };\n }\n});\n\nexport type StorageApp = InstanceType<typeof StorageApp>;\n\nexport function createStorageApp(config?: StorageAppConfig & ApplicationConfig<StorageApp>) {\n return createGenericApplication({\n id: \"storage\",\n name: \"storage\",\n description: \"Your project's persistent storages.\",\n async app(ctx) {\n // Create the app instance.\n const app = new StorageApp(ctx);\n // Run the default application setup.\n await app.setup(config || {});\n // Run the custom user config.\n await config?.config?.(app, ctx);\n return app;\n },\n onBeforeBuild: config?.onBeforeBuild,\n onAfterBuild: config?.onAfterBuild,\n onBeforeDeploy: config?.onBeforeDeploy,\n onAfterDeploy: config?.onAfterDeploy\n });\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as aws from "@pulumi/aws";
|
|
2
|
+
import { PulumiAppModule } from "@webiny/pulumi-sdk";
|
|
3
|
+
export interface StorageCognitoParams {
|
|
4
|
+
protect: boolean;
|
|
5
|
+
useEmailAsUsername: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare type StorageCognito = PulumiAppModule<typeof StorageCognito>;
|
|
8
|
+
export declare const StorageCognito: import("@webiny/pulumi-sdk").PulumiAppModuleDefinition<{
|
|
9
|
+
userPool: import("@webiny/pulumi-sdk").PulumiAppResource<typeof aws.cognito.UserPool>;
|
|
10
|
+
userPoolClient: import("@webiny/pulumi-sdk").PulumiAppResource<typeof aws.cognito.UserPoolClient>;
|
|
11
|
+
}, StorageCognitoParams>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StorageCognito = void 0;
|
|
7
|
+
|
|
8
|
+
var aws = _interopRequireWildcard(require("@pulumi/aws"));
|
|
9
|
+
|
|
10
|
+
var _pulumiSdk = require("@webiny/pulumi-sdk");
|
|
11
|
+
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
|
|
16
|
+
const StorageCognito = (0, _pulumiSdk.defineAppModule)({
|
|
17
|
+
name: "Cognito",
|
|
18
|
+
|
|
19
|
+
config(app, params) {
|
|
20
|
+
const userPool = app.addResource(aws.cognito.UserPool, {
|
|
21
|
+
name: "user-pool",
|
|
22
|
+
config: {
|
|
23
|
+
passwordPolicy: {
|
|
24
|
+
minimumLength: 8,
|
|
25
|
+
requireLowercase: false,
|
|
26
|
+
requireNumbers: false,
|
|
27
|
+
requireSymbols: false,
|
|
28
|
+
requireUppercase: false,
|
|
29
|
+
temporaryPasswordValidityDays: 7
|
|
30
|
+
},
|
|
31
|
+
adminCreateUserConfig: {
|
|
32
|
+
allowAdminCreateUserOnly: true
|
|
33
|
+
},
|
|
34
|
+
autoVerifiedAttributes: ["email"],
|
|
35
|
+
emailConfiguration: {
|
|
36
|
+
emailSendingAccount: "COGNITO_DEFAULT"
|
|
37
|
+
},
|
|
38
|
+
// In a legacy setup we use email as username.
|
|
39
|
+
// We need to provide a way for users to have this setup,
|
|
40
|
+
// because changing it would require whole cognito pool to be recreated.
|
|
41
|
+
usernameAttributes: params.useEmailAsUsername ? ["email"] : undefined,
|
|
42
|
+
aliasAttributes: params.useEmailAsUsername ? undefined : ["preferred_username"],
|
|
43
|
+
lambdaConfig: {},
|
|
44
|
+
mfaConfiguration: "OFF",
|
|
45
|
+
userPoolAddOns: {
|
|
46
|
+
advancedSecurityMode: "OFF"
|
|
47
|
+
/* required */
|
|
48
|
+
|
|
49
|
+
},
|
|
50
|
+
verificationMessageTemplate: {
|
|
51
|
+
defaultEmailOption: "CONFIRM_WITH_CODE"
|
|
52
|
+
},
|
|
53
|
+
schemas: [{
|
|
54
|
+
attributeDataType: "String",
|
|
55
|
+
name: "email",
|
|
56
|
+
required: true,
|
|
57
|
+
developerOnlyAttribute: false,
|
|
58
|
+
mutable: true,
|
|
59
|
+
stringAttributeConstraints: {
|
|
60
|
+
maxLength: "2048",
|
|
61
|
+
minLength: "0"
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
attributeDataType: "String",
|
|
65
|
+
name: "family_name",
|
|
66
|
+
required: true,
|
|
67
|
+
developerOnlyAttribute: false,
|
|
68
|
+
mutable: true,
|
|
69
|
+
stringAttributeConstraints: {
|
|
70
|
+
maxLength: "2048",
|
|
71
|
+
minLength: "0"
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
attributeDataType: "String",
|
|
75
|
+
name: "given_name",
|
|
76
|
+
required: true,
|
|
77
|
+
developerOnlyAttribute: false,
|
|
78
|
+
mutable: true,
|
|
79
|
+
stringAttributeConstraints: {
|
|
80
|
+
maxLength: "2048",
|
|
81
|
+
minLength: "0"
|
|
82
|
+
}
|
|
83
|
+
}]
|
|
84
|
+
},
|
|
85
|
+
opts: {
|
|
86
|
+
protect: params.protect
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const userPoolClient = app.addResource(aws.cognito.UserPoolClient, {
|
|
90
|
+
name: "user-pool-client",
|
|
91
|
+
config: {
|
|
92
|
+
userPoolId: userPool.output.id
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
return {
|
|
96
|
+
userPool,
|
|
97
|
+
userPoolClient
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
});
|
|
102
|
+
exports.StorageCognito = StorageCognito;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["StorageCognito.ts"],"names":["StorageCognito","name","config","app","params","userPool","addResource","aws","cognito","UserPool","passwordPolicy","minimumLength","requireLowercase","requireNumbers","requireSymbols","requireUppercase","temporaryPasswordValidityDays","adminCreateUserConfig","allowAdminCreateUserOnly","autoVerifiedAttributes","emailConfiguration","emailSendingAccount","usernameAttributes","useEmailAsUsername","undefined","aliasAttributes","lambdaConfig","mfaConfiguration","userPoolAddOns","advancedSecurityMode","verificationMessageTemplate","defaultEmailOption","schemas","attributeDataType","required","developerOnlyAttribute","mutable","stringAttributeConstraints","maxLength","minLength","opts","protect","userPoolClient","UserPoolClient","userPoolId","output","id"],"mappings":"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","sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { defineAppModule, PulumiApp, PulumiAppModule } from \"@webiny/pulumi-sdk\";\n\nexport interface StorageCognitoParams {\n protect: boolean;\n useEmailAsUsername: boolean;\n}\n\nexport type StorageCognito = PulumiAppModule<typeof StorageCognito>;\n\nexport const StorageCognito = defineAppModule({\n name: \"Cognito\",\n config(app: PulumiApp, params: StorageCognitoParams) {\n const userPool = app.addResource(aws.cognito.UserPool, {\n name: \"user-pool\",\n config: {\n passwordPolicy: {\n minimumLength: 8,\n requireLowercase: false,\n requireNumbers: false,\n requireSymbols: false,\n requireUppercase: false,\n temporaryPasswordValidityDays: 7\n },\n adminCreateUserConfig: {\n allowAdminCreateUserOnly: true\n },\n autoVerifiedAttributes: [\"email\"],\n emailConfiguration: {\n emailSendingAccount: \"COGNITO_DEFAULT\"\n },\n // In a legacy setup we use email as username.\n // We need to provide a way for users to have this setup,\n // because changing it would require whole cognito pool to be recreated.\n usernameAttributes: params.useEmailAsUsername ? [\"email\"] : undefined,\n aliasAttributes: params.useEmailAsUsername ? undefined : [\"preferred_username\"],\n lambdaConfig: {},\n mfaConfiguration: \"OFF\",\n userPoolAddOns: {\n advancedSecurityMode: \"OFF\" /* required */\n },\n verificationMessageTemplate: {\n defaultEmailOption: \"CONFIRM_WITH_CODE\"\n },\n schemas: [\n {\n attributeDataType: \"String\",\n name: \"email\",\n required: true,\n developerOnlyAttribute: false,\n mutable: true,\n stringAttributeConstraints: {\n maxLength: \"2048\",\n minLength: \"0\"\n }\n },\n {\n attributeDataType: \"String\",\n name: \"family_name\",\n required: true,\n developerOnlyAttribute: false,\n mutable: true,\n stringAttributeConstraints: {\n maxLength: \"2048\",\n minLength: \"0\"\n }\n },\n {\n attributeDataType: \"String\",\n name: \"given_name\",\n required: true,\n developerOnlyAttribute: false,\n mutable: true,\n stringAttributeConstraints: {\n maxLength: \"2048\",\n minLength: \"0\"\n }\n }\n ]\n },\n opts: {\n protect: params.protect\n }\n });\n\n const userPoolClient = app.addResource(aws.cognito.UserPoolClient, {\n name: \"user-pool-client\",\n config: {\n userPoolId: userPool.output.id\n }\n });\n\n return {\n userPool,\n userPoolClient\n };\n }\n});\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as aws from "@pulumi/aws";
|
|
2
|
+
import { PulumiAppModule } from "@webiny/pulumi-sdk";
|
|
3
|
+
export declare type StorageDynamo = PulumiAppModule<typeof StorageDynamo>;
|
|
4
|
+
export declare const StorageDynamo: import("@webiny/pulumi-sdk").PulumiAppModuleDefinition<import("@webiny/pulumi-sdk").PulumiAppResource<typeof aws.dynamodb.Table>, {
|
|
5
|
+
protect: boolean;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StorageDynamo = void 0;
|
|
7
|
+
|
|
8
|
+
var aws = _interopRequireWildcard(require("@pulumi/aws"));
|
|
9
|
+
|
|
10
|
+
var _pulumiSdk = require("@webiny/pulumi-sdk");
|
|
11
|
+
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
|
|
16
|
+
const StorageDynamo = (0, _pulumiSdk.defineAppModule)({
|
|
17
|
+
name: "DynamoDb",
|
|
18
|
+
|
|
19
|
+
config(app, params) {
|
|
20
|
+
return app.addResource(aws.dynamodb.Table, {
|
|
21
|
+
name: "webiny",
|
|
22
|
+
config: {
|
|
23
|
+
attributes: [{
|
|
24
|
+
name: "PK",
|
|
25
|
+
type: "S"
|
|
26
|
+
}, {
|
|
27
|
+
name: "SK",
|
|
28
|
+
type: "S"
|
|
29
|
+
}, {
|
|
30
|
+
name: "GSI1_PK",
|
|
31
|
+
type: "S"
|
|
32
|
+
}, {
|
|
33
|
+
name: "GSI1_SK",
|
|
34
|
+
type: "S"
|
|
35
|
+
}],
|
|
36
|
+
billingMode: "PAY_PER_REQUEST",
|
|
37
|
+
hashKey: "PK",
|
|
38
|
+
rangeKey: "SK",
|
|
39
|
+
globalSecondaryIndexes: [{
|
|
40
|
+
name: "GSI1",
|
|
41
|
+
hashKey: "GSI1_PK",
|
|
42
|
+
rangeKey: "GSI1_SK",
|
|
43
|
+
projectionType: "ALL"
|
|
44
|
+
}]
|
|
45
|
+
},
|
|
46
|
+
opts: {
|
|
47
|
+
protect: params.protect
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
});
|
|
53
|
+
exports.StorageDynamo = StorageDynamo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["StorageDynamo.ts"],"names":["StorageDynamo","name","config","app","params","addResource","aws","dynamodb","Table","attributes","type","billingMode","hashKey","rangeKey","globalSecondaryIndexes","projectionType","opts","protect"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAIO,MAAMA,aAAa,GAAG,gCAAgB;AACzCC,EAAAA,IAAI,EAAE,UADmC;;AAEzCC,EAAAA,MAAM,CAACC,GAAD,EAAiBC,MAAjB,EAA+C;AACjD,WAAOD,GAAG,CAACE,WAAJ,CAAgBC,GAAG,CAACC,QAAJ,CAAaC,KAA7B,EAAoC;AACvCP,MAAAA,IAAI,EAAE,QADiC;AAEvCC,MAAAA,MAAM,EAAE;AACJO,QAAAA,UAAU,EAAE,CACR;AAAER,UAAAA,IAAI,EAAE,IAAR;AAAcS,UAAAA,IAAI,EAAE;AAApB,SADQ,EAER;AAAET,UAAAA,IAAI,EAAE,IAAR;AAAcS,UAAAA,IAAI,EAAE;AAApB,SAFQ,EAGR;AAAET,UAAAA,IAAI,EAAE,SAAR;AAAmBS,UAAAA,IAAI,EAAE;AAAzB,SAHQ,EAIR;AAAET,UAAAA,IAAI,EAAE,SAAR;AAAmBS,UAAAA,IAAI,EAAE;AAAzB,SAJQ,CADR;AAOJC,QAAAA,WAAW,EAAE,iBAPT;AAQJC,QAAAA,OAAO,EAAE,IARL;AASJC,QAAAA,QAAQ,EAAE,IATN;AAUJC,QAAAA,sBAAsB,EAAE,CACpB;AACIb,UAAAA,IAAI,EAAE,MADV;AAEIW,UAAAA,OAAO,EAAE,SAFb;AAGIC,UAAAA,QAAQ,EAAE,SAHd;AAIIE,UAAAA,cAAc,EAAE;AAJpB,SADoB;AAVpB,OAF+B;AAqBvCC,MAAAA,IAAI,EAAE;AACFC,QAAAA,OAAO,EAAEb,MAAM,CAACa;AADd;AArBiC,KAApC,CAAP;AAyBH;;AA5BwC,CAAhB,CAAtB","sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { defineAppModule, PulumiApp, PulumiAppModule } from \"@webiny/pulumi-sdk\";\n\nexport type StorageDynamo = PulumiAppModule<typeof StorageDynamo>;\n\nexport const StorageDynamo = defineAppModule({\n name: \"DynamoDb\",\n config(app: PulumiApp, params: { protect: boolean }) {\n return app.addResource(aws.dynamodb.Table, {\n name: \"webiny\",\n config: {\n attributes: [\n { name: \"PK\", type: \"S\" },\n { name: \"SK\", type: \"S\" },\n { name: \"GSI1_PK\", type: \"S\" },\n { name: \"GSI1_SK\", type: \"S\" }\n ],\n billingMode: \"PAY_PER_REQUEST\",\n hashKey: \"PK\",\n rangeKey: \"SK\",\n globalSecondaryIndexes: [\n {\n name: \"GSI1\",\n hashKey: \"GSI1_PK\",\n rangeKey: \"GSI1_SK\",\n projectionType: \"ALL\"\n }\n ]\n },\n opts: {\n protect: params.protect\n }\n });\n }\n});\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as aws from "@pulumi/aws";
|
|
2
|
+
import { PulumiAppModule } from "@webiny/pulumi-sdk";
|
|
3
|
+
export declare type StorageFileManger = PulumiAppModule<typeof StorageFileManger>;
|
|
4
|
+
export declare const StorageFileManger: import("@webiny/pulumi-sdk").PulumiAppModuleDefinition<import("@webiny/pulumi-sdk").PulumiAppResource<typeof aws.s3.Bucket>, {
|
|
5
|
+
protect: boolean;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StorageFileManger = void 0;
|
|
7
|
+
|
|
8
|
+
var aws = _interopRequireWildcard(require("@pulumi/aws"));
|
|
9
|
+
|
|
10
|
+
var _pulumiSdk = require("@webiny/pulumi-sdk");
|
|
11
|
+
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
|
|
16
|
+
const StorageFileManger = (0, _pulumiSdk.defineAppModule)({
|
|
17
|
+
name: "FileManagerBucket",
|
|
18
|
+
|
|
19
|
+
config(app, params) {
|
|
20
|
+
return app.addResource(aws.s3.Bucket, {
|
|
21
|
+
name: "fm-bucket",
|
|
22
|
+
config: {
|
|
23
|
+
acl: "private",
|
|
24
|
+
// We definitely don't want to force-destroy if "protected" flag is true.
|
|
25
|
+
forceDestroy: !params.protect,
|
|
26
|
+
corsRules: [{
|
|
27
|
+
allowedHeaders: ["*"],
|
|
28
|
+
allowedMethods: ["POST", "GET"],
|
|
29
|
+
allowedOrigins: ["*"],
|
|
30
|
+
maxAgeSeconds: 3000
|
|
31
|
+
}]
|
|
32
|
+
},
|
|
33
|
+
opts: {
|
|
34
|
+
protect: params.protect
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
});
|
|
40
|
+
exports.StorageFileManger = StorageFileManger;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["StorageFileManager.ts"],"names":["StorageFileManger","name","config","app","params","addResource","aws","s3","Bucket","acl","forceDestroy","protect","corsRules","allowedHeaders","allowedMethods","allowedOrigins","maxAgeSeconds","opts"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAGO,MAAMA,iBAAiB,GAAG,gCAAgB;AAC7CC,EAAAA,IAAI,EAAE,mBADuC;;AAE7CC,EAAAA,MAAM,CAACC,GAAD,EAAiBC,MAAjB,EAA+C;AACjD,WAAOD,GAAG,CAACE,WAAJ,CAAgBC,GAAG,CAACC,EAAJ,CAAOC,MAAvB,EAA+B;AAClCP,MAAAA,IAAI,EAAE,WAD4B;AAElCC,MAAAA,MAAM,EAAE;AACJO,QAAAA,GAAG,EAAE,SADD;AAEJ;AACAC,QAAAA,YAAY,EAAE,CAACN,MAAM,CAACO,OAHlB;AAIJC,QAAAA,SAAS,EAAE,CACP;AACIC,UAAAA,cAAc,EAAE,CAAC,GAAD,CADpB;AAEIC,UAAAA,cAAc,EAAE,CAAC,MAAD,EAAS,KAAT,CAFpB;AAGIC,UAAAA,cAAc,EAAE,CAAC,GAAD,CAHpB;AAIIC,UAAAA,aAAa,EAAE;AAJnB,SADO;AAJP,OAF0B;AAelCC,MAAAA,IAAI,EAAE;AACFN,QAAAA,OAAO,EAAEP,MAAM,CAACO;AADd;AAf4B,KAA/B,CAAP;AAmBH;;AAtB4C,CAAhB,CAA1B","sourcesContent":["import * as aws from \"@pulumi/aws\";\nimport { defineAppModule, PulumiApp, PulumiAppModule } from \"@webiny/pulumi-sdk\";\n\nexport type StorageFileManger = PulumiAppModule<typeof StorageFileManger>;\nexport const StorageFileManger = defineAppModule({\n name: \"FileManagerBucket\",\n config(app: PulumiApp, params: { protect: boolean }) {\n return app.addResource(aws.s3.Bucket, {\n name: \"fm-bucket\",\n config: {\n acl: \"private\",\n // We definitely don't want to force-destroy if \"protected\" flag is true.\n forceDestroy: !params.protect,\n corsRules: [\n {\n allowedHeaders: [\"*\"],\n allowedMethods: [\"POST\", \"GET\"],\n allowedOrigins: [\"*\"],\n maxAgeSeconds: 3000\n }\n ]\n },\n opts: {\n protect: params.protect\n }\n });\n }\n});\n"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _StorageApp = require("./StorageApp");
|
|
8
|
+
|
|
9
|
+
Object.keys(_StorageApp).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _StorageApp[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _StorageApp[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _StorageCognito = require("./StorageCognito");
|
|
21
|
+
|
|
22
|
+
Object.keys(_StorageCognito).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _StorageCognito[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _StorageCognito[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _StorageDynamo = require("./StorageDynamo");
|
|
34
|
+
|
|
35
|
+
Object.keys(_StorageDynamo).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _StorageDynamo[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _StorageDynamo[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
var _StorageFileManager = require("./StorageFileManager");
|
|
47
|
+
|
|
48
|
+
Object.keys(_StorageFileManager).forEach(function (key) {
|
|
49
|
+
if (key === "default" || key === "__esModule") return;
|
|
50
|
+
if (key in exports && exports[key] === _StorageFileManager[key]) return;
|
|
51
|
+
Object.defineProperty(exports, key, {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () {
|
|
54
|
+
return _StorageFileManager[key];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from \"./StorageApp\";\nexport * from \"./StorageCognito\";\nexport * from \"./StorageDynamo\";\nexport * from \"./StorageFileManager\";\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as aws from "@pulumi/aws";
|
|
2
|
+
import { ApplicationContext } from "@webiny/pulumi-sdk";
|
|
3
|
+
import { CustomDomainParams } from "../customDomain";
|
|
4
|
+
import { ApplicationConfig } from "@webiny/pulumi-sdk";
|
|
5
|
+
export interface WebsiteAppConfig {
|
|
6
|
+
/** Custom domain configuration */
|
|
7
|
+
domain?(ctx: ApplicationContext): CustomDomainParams;
|
|
8
|
+
}
|
|
9
|
+
export declare const WebsiteApp: new (ctx: ApplicationContext) => import("@webiny/pulumi-sdk").PulumiApp<WebsiteAppConfig> & {
|
|
10
|
+
app: {
|
|
11
|
+
cloudfront: import("@webiny/pulumi-sdk").PulumiAppResource<typeof aws.cloudfront.Distribution>;
|
|
12
|
+
bucket: import("@webiny/pulumi-sdk").PulumiAppResource<typeof aws.s3.Bucket>;
|
|
13
|
+
origin: aws.types.input.cloudfront.DistributionOrigin;
|
|
14
|
+
};
|
|
15
|
+
delivery: {
|
|
16
|
+
cloudfront: import("@webiny/pulumi-sdk").PulumiAppResource<typeof aws.cloudfront.Distribution>;
|
|
17
|
+
bucket: import("@webiny/pulumi-sdk").PulumiAppResource<typeof aws.s3.Bucket>;
|
|
18
|
+
origin: aws.types.input.cloudfront.DistributionOrigin;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare type WebsiteApp = InstanceType<typeof WebsiteApp>;
|
|
22
|
+
export declare function createWebsiteApp(config?: WebsiteAppConfig & ApplicationConfig<WebsiteApp>): import("@webiny/pulumi-sdk").ApplicationBuilderGeneric;
|