@webiny/pulumi-aws 5.34.6-beta.1 → 5.34.6-beta.3
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/api/createApiPulumiApp.d.ts +5 -0
- package/apps/api/createApiPulumiApp.js +10 -2
- package/apps/api/createApiPulumiApp.js.map +1 -1
- package/apps/awsUtils.d.ts +1 -1
- package/apps/react/createReactPulumiApp.js +10 -4
- package/apps/react/createReactPulumiApp.js.map +1 -1
- package/apps/website/createWebsitePulumiApp.d.ts +5 -1
- package/apps/website/createWebsitePulumiApp.js +21 -5
- package/apps/website/createWebsitePulumiApp.js.map +1 -1
- package/package.json +9 -9
- package/utils/addDomainsUrlsOutputs.d.ts +18 -0
- package/utils/addDomainsUrlsOutputs.js +50 -0
- package/utils/addDomainsUrlsOutputs.js.map +1 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +14 -0
- package/utils/index.js.map +1 -1
|
@@ -52,6 +52,11 @@ export declare const createApiPulumiApp: (projectAppParams?: CreateApiPulumiAppP
|
|
|
52
52
|
apiGateway: {
|
|
53
53
|
api: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/apigatewayv2/api").Api>;
|
|
54
54
|
stage: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/apigatewayv2/stage").Stage>;
|
|
55
|
+
/**
|
|
56
|
+
* Treats provided environments as production environments, which
|
|
57
|
+
* are deployed in production deployment mode.
|
|
58
|
+
* https://www.webiny.com/docs/architecture/deployment-modes/production
|
|
59
|
+
*/
|
|
55
60
|
routes: Record<string, {
|
|
56
61
|
integration: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/apigatewayv2/integration").Integration>;
|
|
57
62
|
route: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/apigatewayv2/route").Route>;
|
|
@@ -157,8 +157,6 @@ const createApiPulumiApp = (projectAppParams = {}) => {
|
|
|
157
157
|
|
|
158
158
|
app.addOutputs({
|
|
159
159
|
region: process.env.AWS_REGION,
|
|
160
|
-
apiUrl: cloudfront.output.domainName.apply(value => `https://${value}`),
|
|
161
|
-
apiDomain: cloudfront.output.domainName,
|
|
162
160
|
cognitoUserPoolId: core.cognitoUserPoolId,
|
|
163
161
|
cognitoAppClientId: core.cognitoAppClientId,
|
|
164
162
|
cognitoUserPoolPasswordPolicy: core.cognitoUserPoolPasswordPolicy,
|
|
@@ -169,6 +167,16 @@ const createApiPulumiApp = (projectAppParams = {}) => {
|
|
|
169
167
|
dynamoDbTable: core.primaryDynamodbTableName,
|
|
170
168
|
dynamoDbElasticsearchTable: core.elasticsearchDynamodbTableName
|
|
171
169
|
});
|
|
170
|
+
(0, _utils.addDomainsUrlsOutputs)({
|
|
171
|
+
app,
|
|
172
|
+
cloudfrontDistribution: cloudfront,
|
|
173
|
+
map: {
|
|
174
|
+
distributionDomain: "cloudfrontApiDomain",
|
|
175
|
+
distributionUrl: "cloudfrontApiUrl",
|
|
176
|
+
usedDomain: "apiDomain",
|
|
177
|
+
usedUrl: "apiUrl"
|
|
178
|
+
}
|
|
179
|
+
});
|
|
172
180
|
(0, _utils.tagResources)({
|
|
173
181
|
WbyProjectName: String(process.env["WEBINY_PROJECT_NAME"]),
|
|
174
182
|
WbyEnvironment: String(process.env["WEBINY_ENV"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createApiPulumiApp","projectAppParams","app","createPulumiApp","name","path","config","program","pulumiResourceNamePrefix","getParam","onResource","resource","startsWith","pulumi","addHandler","productionEnvironments","params","create","isProduction","includes","run","env","WEBINY_LOGS_FORWARD_URL","String","process","core","addModule","CoreOutput","vpcEnabled","vpc","VpcConfig","enabled","pageBuilder","ApiPageBuilder","COGNITO_REGION","AWS_REGION","COGNITO_USER_POOL_ID","cognitoUserPoolId","DB_TABLE","primaryDynamodbTableName","DB_TABLE_ELASTICSEARCH","elasticsearchDynamodbTableName","ELASTIC_SEARCH_ENDPOINT","elasticsearchDomainEndpoint","ELASTIC_SEARCH_INDEX_PREFIX","S3_BUCKET","fileManagerBucketId","fileManager","ApiFileManager","apwScheduler","ApiApwScheduler","primaryDynamodbTableArn","headlessCms","ApiHeadlessCMS","OKTA_ISSUER","APW_SCHEDULER_SCHEDULE_ACTION_HANDLER","scheduleAction","lambda","output","arn","graphql","ApiGraphql","EVENT_BUS","eventBusArn","IMPORT_CREATE_HANDLER","import","functions","EXPORT_PROCESS_HANDLER","export","apwSchedulerEventRule","eventRule","apwSchedulerEventTarget","eventTarget","apiGateway","ApiGateway","method","function","download","cloudfront","ApiCloudfront","domains","applyCustomDomain","addOutputs","region","apiUrl","domainName","apply","value","apiDomain","cognitoAppClientId","cognitoUserPoolPasswordPolicy","apwSchedulerScheduleAction","apwSchedulerExecuteAction","executeAction","apwSchedulerEventTargetId","targetId","dynamoDbTable","dynamoDbElasticsearchTable","tagResources","WbyProjectName","WbyEnvironment","withCommonLambdaEnvVariables"],"sources":["createApiPulumiApp.ts"],"sourcesContent":["import { createPulumiApp, PulumiAppParam, PulumiAppParamCallback } from \"@webiny/pulumi\";\nimport {\n ApiGateway,\n ApiApwScheduler,\n ApiCloudfront,\n ApiFileManager,\n ApiGraphql,\n ApiHeadlessCMS,\n ApiPageBuilder,\n CoreOutput,\n VpcConfig\n} from \"~/apps\";\nimport { applyCustomDomain, CustomDomainParams } from \"../customDomain\";\nimport { tagResources } from \"~/utils\";\nimport { withCommonLambdaEnvVariables } from \"~/utils\";\n\nexport type ApiPulumiApp = ReturnType<typeof createApiPulumiApp>;\n\nexport interface CreateApiPulumiAppParams {\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 app = createPulumiApp({\n name: \"api\",\n path: \"apps/api\",\n config: projectAppParams,\n program: async app => {\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 = app.params.create.productionEnvironments || [\"prod\"];\n const isProduction = productionEnvironments.includes(app.params.run.env);\n\n // Enables logs forwarding.\n // https://www.webiny.com/docs/how-to-guides/use-watch-command#enabling-logs-forwarding\n const WEBINY_LOGS_FORWARD_URL = String(process.env.WEBINY_LOGS_FORWARD_URL);\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: String(process.env.AWS_REGION),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\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\n S3_BUCKET: core.fileManagerBucketId,\n WEBINY_LOGS_FORWARD_URL\n }\n });\n\n const fileManager = app.addModule(ApiFileManager);\n\n const apwScheduler = app.addModule(ApiApwScheduler, {\n primaryDynamodbTableArn: core.primaryDynamodbTableArn,\n\n env: {\n COGNITO_REGION: String(process.env.AWS_REGION),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\n S3_BUCKET: core.fileManagerBucketId,\n WEBINY_LOGS_FORWARD_URL\n }\n });\n\n const headlessCms = app.addModule(ApiHeadlessCMS, {\n env: {\n COGNITO_REGION: String(process.env.AWS_REGION),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\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\n S3_BUCKET: core.fileManagerBucketId,\n // TODO: move to okta plugin\n OKTA_ISSUER: process.env[\"OKTA_ISSUER\"],\n WEBINY_LOGS_FORWARD_URL,\n /**\n * APW\n */\n APW_SCHEDULER_SCHEDULE_ACTION_HANDLER:\n apwScheduler.scheduleAction.lambda.output.arn\n }\n });\n\n const graphql = app.addModule(ApiGraphql, {\n env: {\n COGNITO_REGION: String(process.env.AWS_REGION),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\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\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 WEBINY_LOGS_FORWARD_URL,\n /**\n * APW\n */\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 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 \"cms-post\": {\n path: \"/cms/{key+}\",\n method: \"POST\",\n function: headlessCms.functions.graphql.output.arn\n },\n \"cms-options\": {\n path: \"/cms/{key+}\",\n method: \"OPTIONS\",\n function: headlessCms.functions.graphql.output.arn\n }\n });\n\n const cloudfront = app.addModule(ApiCloudfront);\n\n const domains = app.getParam(projectAppParams.domains);\n if (domains) {\n applyCustomDomain(cloudfront, domains);\n }\n\n app.addOutputs({\n region: process.env.AWS_REGION,\n apiUrl: cloudfront.output.domainName.apply(value => `https://${value}`),\n apiDomain: cloudfront.output.domainName,\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 dynamoDbElasticsearchTable: core.elasticsearchDynamodbTableName\n });\n\n tagResources({\n WbyProjectName: String(process.env[\"WEBINY_PROJECT_NAME\"]),\n WbyEnvironment: String(process.env[\"WEBINY_ENV\"])\n });\n\n return {\n fileManager,\n graphql,\n headlessCms,\n apiGateway,\n cloudfront,\n apwScheduler\n };\n }\n });\n\n return withCommonLambdaEnvVariables(app);\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAWA;;AACA;;AAkCO,MAAMA,kBAAkB,GAAG,CAACC,gBAA0C,GAAG,EAA9C,KAAqD;EACnF,MAAMC,GAAG,GAAG,IAAAC,uBAAA,EAAgB;IACxBC,IAAI,EAAE,KADkB;IAExBC,IAAI,EAAE,UAFkB;IAGxBC,MAAM,EAAEL,gBAHgB;IAIxBM,OAAO,EAAE,MAAML,GAAN,IAAa;MAClB,MAAMM,wBAAwB,GAAGN,GAAG,CAACO,QAAJ,CAC7BR,gBAAgB,CAACO,wBADY,CAAjC;;MAGA,IAAIA,wBAAJ,EAA8B;QAC1BN,GAAG,CAACQ,UAAJ,CAAeC,QAAQ,IAAI;UACvB,IAAI,CAACA,QAAQ,CAACP,IAAT,CAAcQ,UAAd,CAAyBJ,wBAAzB,CAAL,EAAyD;YACrDG,QAAQ,CAACP,IAAT,GAAiB,GAAEI,wBAAyB,GAAEG,QAAQ,CAACP,IAAK,EAA5D;UACH;QACJ,CAJD;MAKH,CAViB,CAYlB;MACA;;;MACA,IAAIH,gBAAgB,CAACY,MAArB,EAA6B;QACzBX,GAAG,CAACY,UAAJ,CAAe,MAAM;UACjB,OAAOb,gBAAgB,CAACY,MAAjB,CAAyBX,GAAz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AA3B,CAAkCC,MAAlC,CAAyCC,GARzD;QASXU,qBAAqB,EAAEpB,YAAY,CAACqB,SAAb,CAAuBZ,MAAvB,CAA8BtD,IAT1C;QAUX0F,yBAAyB,EAAE7C,YAAY,CAACuB,WAAb,CAAyBd,MAAzB,CAAgCqC,QAVhD;QAWXC,aAAa,EAAEvE,IAAI,CAACc,wBAXT;QAYX0D,0BAA0B,EAAExE,IAAI,CAACgB;MAZtB,CAAf;MAeA,IAAAyD,mBAAA,EAAa;QACTC,cAAc,EAAE5E,MAAM,CAACC,OAAO,CAACH,GAAR,CAAY,qBAAZ,CAAD,CADb;QAET+E,cAAc,EAAE7E,MAAM,CAACC,OAAO,CAACH,GAAR,CAAY,YAAZ,CAAD;MAFb,CAAb;MAKA,OAAO;QACH0B,WADG;QAEHa,OAFG;QAGHR,WAHG;QAIHqB,UAJG;QAKHK,UALG;QAMH7B;MANG,CAAP;IAQH;EAzLuB,CAAhB,CAAZ;EA4LA,OAAO,IAAAoD,mCAAA,EAA6BnG,GAA7B,CAAP;AACH,CA9LM"}
|
|
1
|
+
{"version":3,"names":["createApiPulumiApp","projectAppParams","app","createPulumiApp","name","path","config","program","pulumiResourceNamePrefix","getParam","onResource","resource","startsWith","pulumi","addHandler","productionEnvironments","params","create","isProduction","includes","run","env","WEBINY_LOGS_FORWARD_URL","String","process","core","addModule","CoreOutput","vpcEnabled","vpc","VpcConfig","enabled","pageBuilder","ApiPageBuilder","COGNITO_REGION","AWS_REGION","COGNITO_USER_POOL_ID","cognitoUserPoolId","DB_TABLE","primaryDynamodbTableName","DB_TABLE_ELASTICSEARCH","elasticsearchDynamodbTableName","ELASTIC_SEARCH_ENDPOINT","elasticsearchDomainEndpoint","ELASTIC_SEARCH_INDEX_PREFIX","S3_BUCKET","fileManagerBucketId","fileManager","ApiFileManager","apwScheduler","ApiApwScheduler","primaryDynamodbTableArn","headlessCms","ApiHeadlessCMS","OKTA_ISSUER","APW_SCHEDULER_SCHEDULE_ACTION_HANDLER","scheduleAction","lambda","output","arn","graphql","ApiGraphql","EVENT_BUS","eventBusArn","IMPORT_CREATE_HANDLER","import","functions","EXPORT_PROCESS_HANDLER","export","apwSchedulerEventRule","eventRule","apwSchedulerEventTarget","eventTarget","apiGateway","ApiGateway","method","function","download","cloudfront","ApiCloudfront","domains","applyCustomDomain","addOutputs","region","cognitoAppClientId","cognitoUserPoolPasswordPolicy","apwSchedulerScheduleAction","apwSchedulerExecuteAction","executeAction","apwSchedulerEventTargetId","targetId","dynamoDbTable","dynamoDbElasticsearchTable","addDomainsUrlsOutputs","cloudfrontDistribution","map","distributionDomain","distributionUrl","usedDomain","usedUrl","tagResources","WbyProjectName","WbyEnvironment","withCommonLambdaEnvVariables"],"sources":["createApiPulumiApp.ts"],"sourcesContent":["import { createPulumiApp, PulumiAppParam, PulumiAppParamCallback } from \"@webiny/pulumi\";\nimport {\n ApiGateway,\n ApiApwScheduler,\n ApiCloudfront,\n ApiFileManager,\n ApiGraphql,\n ApiHeadlessCMS,\n ApiPageBuilder,\n CoreOutput,\n VpcConfig\n} from \"~/apps\";\nimport { applyCustomDomain, CustomDomainParams } from \"../customDomain\";\nimport { tagResources, withCommonLambdaEnvVariables, addDomainsUrlsOutputs } from \"~/utils\";\n\nexport type ApiPulumiApp = ReturnType<typeof createApiPulumiApp>;\n\nexport interface CreateApiPulumiAppParams {\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 app = createPulumiApp({\n name: \"api\",\n path: \"apps/api\",\n config: projectAppParams,\n program: async app => {\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 = app.params.create.productionEnvironments || [\"prod\"];\n const isProduction = productionEnvironments.includes(app.params.run.env);\n\n // Enables logs forwarding.\n // https://www.webiny.com/docs/how-to-guides/use-watch-command#enabling-logs-forwarding\n const WEBINY_LOGS_FORWARD_URL = String(process.env.WEBINY_LOGS_FORWARD_URL);\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: String(process.env.AWS_REGION),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\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\n S3_BUCKET: core.fileManagerBucketId,\n WEBINY_LOGS_FORWARD_URL\n }\n });\n\n const fileManager = app.addModule(ApiFileManager);\n\n const apwScheduler = app.addModule(ApiApwScheduler, {\n primaryDynamodbTableArn: core.primaryDynamodbTableArn,\n\n env: {\n COGNITO_REGION: String(process.env.AWS_REGION),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\n S3_BUCKET: core.fileManagerBucketId,\n WEBINY_LOGS_FORWARD_URL\n }\n });\n\n const headlessCms = app.addModule(ApiHeadlessCMS, {\n env: {\n COGNITO_REGION: String(process.env.AWS_REGION),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\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\n S3_BUCKET: core.fileManagerBucketId,\n // TODO: move to okta plugin\n OKTA_ISSUER: process.env[\"OKTA_ISSUER\"],\n WEBINY_LOGS_FORWARD_URL,\n /**\n * APW\n */\n APW_SCHEDULER_SCHEDULE_ACTION_HANDLER:\n apwScheduler.scheduleAction.lambda.output.arn\n }\n });\n\n const graphql = app.addModule(ApiGraphql, {\n env: {\n COGNITO_REGION: String(process.env.AWS_REGION),\n COGNITO_USER_POOL_ID: core.cognitoUserPoolId,\n DB_TABLE: core.primaryDynamodbTableName,\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\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 WEBINY_LOGS_FORWARD_URL,\n /**\n * APW\n */\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 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 \"cms-post\": {\n path: \"/cms/{key+}\",\n method: \"POST\",\n function: headlessCms.functions.graphql.output.arn\n },\n \"cms-options\": {\n path: \"/cms/{key+}\",\n method: \"OPTIONS\",\n function: headlessCms.functions.graphql.output.arn\n }\n });\n\n const cloudfront = app.addModule(ApiCloudfront);\n\n const domains = app.getParam(projectAppParams.domains);\n if (domains) {\n applyCustomDomain(cloudfront, domains);\n }\n\n app.addOutputs({\n region: process.env.AWS_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 dynamoDbElasticsearchTable: core.elasticsearchDynamodbTableName\n });\n\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 tagResources({\n WbyProjectName: String(process.env[\"WEBINY_PROJECT_NAME\"]),\n WbyEnvironment: String(process.env[\"WEBINY_ENV\"])\n });\n\n return {\n fileManager,\n graphql,\n headlessCms,\n apiGateway,\n cloudfront,\n apwScheduler\n };\n }\n });\n\n return withCommonLambdaEnvVariables(app);\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAWA;;AACA;;AAiCO,MAAMA,kBAAkB,GAAG,CAACC,gBAA0C,GAAG,EAA9C,KAAqD;EACnF,MAAMC,GAAG,GAAG,IAAAC,uBAAA,EAAgB;IACxBC,IAAI,EAAE,KADkB;IAExBC,IAAI,EAAE,UAFkB;IAGxBC,MAAM,EAAEL,gBAHgB;IAIxBM,OAAO,EAAE,MAAML,GAAN,IAAa;MAClB,MAAMM,wBAAwB,GAAGN,GAAG,CAACO,QAAJ,CAC7BR,gBAAgB,CAACO,wBADY,CAAjC;;MAGA,IAAIA,wBAAJ,EAA8B;QAC1BN,GAAG,CAACQ,UAAJ,CAAeC,QAAQ,IAAI;UACvB,IAAI,CAACA,QAAQ,CAACP,IAAT,CAAcQ,UAAd,CAAyBJ,wBAAzB,CAAL,EAAyD;YACrDG,QAAQ,CAACP,IAAT,GAAiB,GAAEI,wBAAyB,GAAEG,QAAQ,CAACP,IAAK,EAA5D;UACH;QACJ,CAJD;MAKH,CAViB,CAYlB;MACA;;;MACA,IAAIH,gBAAgB,CAACY,MAArB,EAA6B;QACzBX,GAAG,CAACY,UAAJ,CAAe,MAAM;UACjB,OAAOb,gBAAgB,CAACY,MAAjB,CAAyBX,GAAzB,CAAP;QACH,CAFD;MAGH;;MAED,MAAMa,sBAAsB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ATT;QAUXqD,0BAA0B,EAAEnE,IAAI,CAACgB;MAVtB,CAAf;MAaA,IAAAoD,4BAAA,EAAsB;QAClB3F,GADkB;QAElB4F,sBAAsB,EAAEhB,UAFN;QAGlBiB,GAAG,EAAE;UACDC,kBAAkB,EAAE,qBADnB;UAEDC,eAAe,EAAE,kBAFhB;UAGDC,UAAU,EAAE,WAHX;UAIDC,OAAO,EAAE;QAJR;MAHa,CAAtB;MAWA,IAAAC,mBAAA,EAAa;QACTC,cAAc,EAAE9E,MAAM,CAACC,OAAO,CAACH,GAAR,CAAY,qBAAZ,CAAD,CADb;QAETiF,cAAc,EAAE/E,MAAM,CAACC,OAAO,CAACH,GAAR,CAAY,YAAZ,CAAD;MAFb,CAAb;MAKA,OAAO;QACH0B,WADG;QAEHa,OAFG;QAGHR,WAHG;QAIHqB,UAJG;QAKHK,UALG;QAMH7B;MANG,CAAP;IAQH;EAlMuB,CAAhB,CAAZ;EAqMA,OAAO,IAAAsD,mCAAA,EAA6BrG,GAA7B,CAAP;AACH,CAvMM"}
|
package/apps/awsUtils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { 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-southeast-2" | "ap-southeast-1" | "ca-central-1" | "cn-north-1" | "cn-northwest-1" | "eu-central-1" | "eu-north-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-south-1" | "me-south-1" | "sa-east-1" | "us-gov-east-1" | "us-gov-west-1" | "us-east-1" | "us-east-2" | "us-west-1" | "us-west-2">;
|
|
@@ -101,10 +101,16 @@ const createReactPulumiApp = projectAppParams => {
|
|
|
101
101
|
(0, _customDomain.applyCustomDomain)(cloudfront, domains);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
app.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
app.addOutput("appStorage", bucket.bucket.output.id);
|
|
105
|
+
(0, _utils.addDomainsUrlsOutputs)({
|
|
106
|
+
app,
|
|
107
|
+
cloudfrontDistribution: cloudfront,
|
|
108
|
+
map: {
|
|
109
|
+
distributionDomain: "cloudfrontAppDomain",
|
|
110
|
+
distributionUrl: "cloudfrontAppUrl",
|
|
111
|
+
usedDomain: "appDomain",
|
|
112
|
+
usedUrl: "appUrl"
|
|
113
|
+
}
|
|
108
114
|
});
|
|
109
115
|
(0, _utils.tagResources)({
|
|
110
116
|
WbyAppName: name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createReactPulumiApp","projectAppParams","createPulumiApp","name","path","folder","config","program","app","pulumiResourceNamePrefix","getParam","onResource","resource","startsWith","core","addModule","CoreOutput","pulumi","addHandler","bucket","createPrivateAppBucket","cloudfront","addResource","aws","Distribution","enabled","waitForDeployment","origins","origin","defaultRootObject","defaultCacheBehavior","compress","targetOriginId","originId","viewerProtocolPolicy","allowedMethods","cachedMethods","forwardedValues","cookies","forward","queryString","minTtl","defaultTtl","maxTtl","priceClass","customErrorResponses","errorCode","responseCode","responsePagePath","restrictions","geoRestriction","restrictionType","viewerCertificate","cloudfrontDefaultCertificate","domains","applyCustomDomain","addOutputs","appStorage","output","id","appDomain","domainName","appUrl","apply","value","tagResources","WbyAppName","WbyProjectName","String","process","env","WbyEnvironment","dynamodb","TableItem","tableName","primaryDynamodbTableName","hashKey","primaryDynamodbTableHashKey","rangeKey","primaryDynamodbTableRangeKey","key","item","interpolate","params","run","variant"],"sources":["createReactPulumiApp.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\n\nimport { createPulumiApp, PulumiAppParam, PulumiAppParamCallback } from \"@webiny/pulumi\";\nimport { tagResources } from \"~/utils\";\nimport { createPrivateAppBucket } from \"../createAppBucket\";\nimport { applyCustomDomain, CustomDomainParams } from \"../customDomain\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport { CoreOutput } from \"../common/CoreOutput\";\n\nexport type ReactPulumiApp = ReturnType<typeof createReactPulumiApp>;\n\nexport interface CreateReactPulumiAppParams {\n /**\n * A name of the app, e.g., \"user-area\"\n */\n name: string;\n\n /**\n * A folder where the app is located, e.g., \"apps/user-area\"\n */\n folder: string;\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: ReactPulumiApp) => 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 createReactPulumiApp = (projectAppParams: CreateReactPulumiAppParams) => {\n return createPulumiApp({\n name: projectAppParams.name,\n path: projectAppParams.folder,\n config: projectAppParams,\n program: async app => {\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 const { name } = projectAppParams;\n\n // Register core output as a module available for all other modules\n const core = app.addModule(CoreOutput);\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 to late.\n if (projectAppParams.pulumi) {\n app.addHandler(() => {\n return projectAppParams.pulumi!(app as ReactPulumiApp);\n });\n }\n\n const bucket = createPrivateAppBucket(app, `${name}-app`);\n\n const cloudfront = app.addResource(aws.cloudfront.Distribution, {\n name: `${name}-app-cdn`,\n config: {\n enabled: true,\n waitForDeployment: false,\n origins: [bucket.origin],\n defaultRootObject: \"index.html\",\n defaultCacheBehavior: {\n compress: true,\n targetOriginId: bucket.origin.originId,\n viewerProtocolPolicy: \"redirect-to-https\",\n allowedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n cachedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n forwardedValues: {\n cookies: { forward: \"none\" },\n queryString: false\n },\n // MinTTL <= DefaultTTL <= MaxTTL\n minTtl: 0,\n defaultTtl: 600,\n maxTtl: 600\n },\n priceClass: \"PriceClass_100\",\n customErrorResponses: [\n { errorCode: 404, responseCode: 404, responsePagePath: \"/index.html\" }\n ],\n restrictions: {\n geoRestriction: {\n restrictionType: \"none\"\n }\n },\n viewerCertificate: {\n cloudfrontDefaultCertificate: true\n }\n }\n });\n\n const domains = app.getParam(projectAppParams.domains);\n if (domains) {\n applyCustomDomain(cloudfront, domains);\n }\n\n app.addOutputs({\n appStorage: bucket.bucket.output.id,\n appDomain: cloudfront.output.domainName,\n appUrl: cloudfront.output.domainName.apply(value => `https://${value}`)\n });\n\n tagResources({\n WbyAppName: name,\n WbyProjectName: String(process.env[\"WEBINY_PROJECT_NAME\"]),\n WbyEnvironment: String(process.env[\"WEBINY_ENV\"])\n });\n\n /**\n * We need to store the appUrl to the admin settings item in the dynamodb\n */\n app.addResource(aws.dynamodb.TableItem, {\n name: \"adminSettings\",\n config: {\n tableName: core.primaryDynamodbTableName,\n hashKey: core.primaryDynamodbTableHashKey,\n rangeKey: pulumi\n .output(core.primaryDynamodbTableRangeKey)\n .apply(key => key || \"SK\"),\n item: pulumi.interpolate`{\n \"PK\": {\"S\": \"ADMIN#SETTINGS\"},\n \"SK\": {\"S\": \"${app.params.run.variant || \"default\"}\"},\n \"data\": {\n \"M\": {\n \"appUrl\": {\n \"S\": \"${cloudfront.output.domainName.apply(\n value => `https://${value}`\n )}\"\n }\n }\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;QAGXC,MAAM,EAAEzC,UAAU,CAACqC,MAAX,CAAkBG,UAAlB,CAA6BE,KAA7B,CAAmCC,KAAK,IAAK,WAAUA,KAAM,EAA7D;MAHG,CAAf;MAMA,IAAAC,mBAAA,EAAa;QACTC,UAAU,EAAE/D,IADH;QAETgE,cAAc,EAAEC,MAAM,CAACC,OAAO,CAACC,GAAR,CAAY,qBAAZ,CAAD,CAFb;QAGTC,cAAc,EAAEH,MAAM,CAACC,OAAO,CAACC,GAAR,CAAY,YAAZ,CAAD;MAHb,CAAb;MAMA;AACZ;AACA;;MACY9D,GAAG,CAACc,WAAJ,CAAgBC,GAAG,CAACiD,QAAJ,CAAaC,SAA7B,EAAwC;QACpCtE,IAAI,EAAE,eAD8B;QAEpCG,MAAM,EAAE;UACJoE,SAAS,EAAE5D,IAAI,CAAC6D,wBADZ;UAEJC,OAAO,EAAE9D,IAAI,CAAC+D,2BAFV;UAGJC,QAAQ,EAAE7D,MAAM,CACXyC,MADK,CACE5C,IAAI,CAACiE,4BADP,EAELhB,KAFK,CAECiB,GAAG,IAAIA,GAAG,IAAI,IAFf,CAHN;UAMJC,IAAI,EAAEhE,MAAM,CAACiE,WAAY;AAC7C;AACA,yCAAyC1E,GAAG,CAAC2E,MAAJ,CAAWC,GAAX,CAAeC,OAAf,IAA0B,SAAU;AAC7E;AACA;AACA;AACA,wCAAwChE,UAAU,CAACqC,MAAX,CAAkBG,UAAlB,CAA6BE,KAA7B,CACJC,KAAK,IAAK,WAAUA,KAAM,EADtB,CAEN;AAClC;AACA;AACA;AACA;QAlBwB;MAF4B,CAAxC;MAwBA,mEACO7C,MADP;QAEIE;MAFJ;IAIH;EApHkB,CAAhB,CAAP;AAsHH,CAvHM"}
|
|
1
|
+
{"version":3,"names":["createReactPulumiApp","projectAppParams","createPulumiApp","name","path","folder","config","program","app","pulumiResourceNamePrefix","getParam","onResource","resource","startsWith","core","addModule","CoreOutput","pulumi","addHandler","bucket","createPrivateAppBucket","cloudfront","addResource","aws","Distribution","enabled","waitForDeployment","origins","origin","defaultRootObject","defaultCacheBehavior","compress","targetOriginId","originId","viewerProtocolPolicy","allowedMethods","cachedMethods","forwardedValues","cookies","forward","queryString","minTtl","defaultTtl","maxTtl","priceClass","customErrorResponses","errorCode","responseCode","responsePagePath","restrictions","geoRestriction","restrictionType","viewerCertificate","cloudfrontDefaultCertificate","domains","applyCustomDomain","addOutput","output","id","addDomainsUrlsOutputs","cloudfrontDistribution","map","distributionDomain","distributionUrl","usedDomain","usedUrl","tagResources","WbyAppName","WbyProjectName","String","process","env","WbyEnvironment","dynamodb","TableItem","tableName","primaryDynamodbTableName","hashKey","primaryDynamodbTableHashKey","rangeKey","primaryDynamodbTableRangeKey","apply","key","item","interpolate","params","run","variant","domainName","value"],"sources":["createReactPulumiApp.ts"],"sourcesContent":["import * as aws from \"@pulumi/aws\";\n\nimport { createPulumiApp, PulumiAppParam, PulumiAppParamCallback } from \"@webiny/pulumi\";\nimport { addDomainsUrlsOutputs, tagResources } from \"~/utils\";\nimport { createPrivateAppBucket } from \"../createAppBucket\";\nimport { applyCustomDomain, CustomDomainParams } from \"../customDomain\";\nimport * as pulumi from \"@pulumi/pulumi\";\nimport { CoreOutput } from \"../common/CoreOutput\";\n\nexport type ReactPulumiApp = ReturnType<typeof createReactPulumiApp>;\n\nexport interface CreateReactPulumiAppParams {\n /**\n * A name of the app, e.g., \"user-area\"\n */\n name: string;\n\n /**\n * A folder where the app is located, e.g., \"apps/user-area\"\n */\n folder: string;\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: ReactPulumiApp) => 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 createReactPulumiApp = (projectAppParams: CreateReactPulumiAppParams) => {\n return createPulumiApp({\n name: projectAppParams.name,\n path: projectAppParams.folder,\n config: projectAppParams,\n program: async app => {\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 const { name } = projectAppParams;\n\n // Register core output as a module available for all other modules\n const core = app.addModule(CoreOutput);\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 to late.\n if (projectAppParams.pulumi) {\n app.addHandler(() => {\n return projectAppParams.pulumi!(app as ReactPulumiApp);\n });\n }\n\n const bucket = createPrivateAppBucket(app, `${name}-app`);\n\n const cloudfront = app.addResource(aws.cloudfront.Distribution, {\n name: `${name}-app-cdn`,\n config: {\n enabled: true,\n waitForDeployment: false,\n origins: [bucket.origin],\n defaultRootObject: \"index.html\",\n defaultCacheBehavior: {\n compress: true,\n targetOriginId: bucket.origin.originId,\n viewerProtocolPolicy: \"redirect-to-https\",\n allowedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n cachedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n forwardedValues: {\n cookies: { forward: \"none\" },\n queryString: false\n },\n // MinTTL <= DefaultTTL <= MaxTTL\n minTtl: 0,\n defaultTtl: 600,\n maxTtl: 600\n },\n priceClass: \"PriceClass_100\",\n customErrorResponses: [\n { errorCode: 404, responseCode: 404, responsePagePath: \"/index.html\" }\n ],\n restrictions: {\n geoRestriction: {\n restrictionType: \"none\"\n }\n },\n viewerCertificate: {\n cloudfrontDefaultCertificate: true\n }\n }\n });\n\n const domains = app.getParam(projectAppParams.domains);\n if (domains) {\n applyCustomDomain(cloudfront, domains);\n }\n\n app.addOutput(\"appStorage\", bucket.bucket.output.id);\n\n addDomainsUrlsOutputs({\n app,\n cloudfrontDistribution: cloudfront,\n map: {\n distributionDomain: \"cloudfrontAppDomain\",\n distributionUrl: \"cloudfrontAppUrl\",\n usedDomain: \"appDomain\",\n usedUrl: \"appUrl\"\n }\n });\n\n tagResources({\n WbyAppName: name,\n WbyProjectName: String(process.env[\"WEBINY_PROJECT_NAME\"]),\n WbyEnvironment: String(process.env[\"WEBINY_ENV\"])\n });\n\n /**\n * We need to store the appUrl to the admin settings item in the dynamodb\n */\n app.addResource(aws.dynamodb.TableItem, {\n name: \"adminSettings\",\n config: {\n tableName: core.primaryDynamodbTableName,\n hashKey: core.primaryDynamodbTableHashKey,\n rangeKey: pulumi\n .output(core.primaryDynamodbTableRangeKey)\n .apply(key => key || \"SK\"),\n item: pulumi.interpolate`{\n \"PK\": {\"S\": \"ADMIN#SETTINGS\"},\n \"SK\": {\"S\": \"${app.params.run.variant || \"default\"}\"},\n \"data\": {\n \"M\": {\n \"appUrl\": {\n \"S\": \"${cloudfront.output.domainName.apply(\n value => `https://${value}`\n )}\"\n }\n }\n }\n }`\n }\n });\n\n return {\n ...bucket,\n cloudfront\n };\n }\n });\n};\n"],"mappings":";;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAqCO,MAAMA,oBAAoB,GAAIC,gBAAD,IAAkD;EAClF,OAAO,IAAAC,uBAAA,EAAgB;IACnBC,IAAI,EAAEF,gBAAgB,CAACE,IADJ;IAEnBC,IAAI,EAAEH,gBAAgB,CAACI,MAFJ;IAGnBC,MAAM,EAAEL,gBAHW;IAInBM,OAAO,EAAE,MAAMC,GAAN,IAAa;MAClB,MAAMC,wBAAwB,GAAGD,GAAG,CAACE,QAAJ,CAC7BT,gBAAgB,CAACQ,wBADY,CAAjC;;MAGA,IAAIA,wBAAJ,EAA8B;QAC1BD,GAAG,CAACG,UAAJ,CAAeC,QAAQ,IAAI;UACvB,IAAI,CAACA,QA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AC8D,wBADZ;UAEJC,OAAO,EAAE/D,IAAI,CAACgE,2BAFV;UAGJC,QAAQ,EAAE9D,MAAM,CACXwC,MADK,CACE3C,IAAI,CAACkE,4BADP,EAELC,KAFK,CAECC,GAAG,IAAIA,GAAG,IAAI,IAFf,CAHN;UAMJC,IAAI,EAAElE,MAAM,CAACmE,WAAY;AAC7C;AACA,yCAAyC5E,GAAG,CAAC6E,MAAJ,CAAWC,GAAX,CAAeC,OAAf,IAA0B,SAAU;AAC7E;AACA;AACA;AACA,wCAAwClE,UAAU,CAACoC,MAAX,CAAkB+B,UAAlB,CAA6BP,KAA7B,CACJQ,KAAK,IAAK,WAAUA,KAAM,EADtB,CAEN;AAClC;AACA;AACA;AACA;QAlBwB;MAF4B,CAAxC;MAwBA,mEACOtE,MADP;QAEIE;MAFJ;IAIH;EA3HkB,CAAhB,CAAP;AA6HH,CA9HM"}
|
|
@@ -59,7 +59,11 @@ export declare const createWebsitePulumiApp: (projectAppParams?: CreateWebsitePu
|
|
|
59
59
|
};
|
|
60
60
|
settings: {
|
|
61
61
|
tableItem: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/dynamodb/tableItem").TableItem>;
|
|
62
|
-
};
|
|
62
|
+
}; /**
|
|
63
|
+
* Treats provided environments as production environments, which
|
|
64
|
+
* are deployed in production deployment mode.
|
|
65
|
+
* https://www.webiny.com/docs/architecture/deployment-modes/production
|
|
66
|
+
*/
|
|
63
67
|
};
|
|
64
68
|
app: {
|
|
65
69
|
cloudfront: import("@webiny/pulumi").PulumiAppResource<typeof import("@pulumi/aws/cloudfront/distribution").Distribution>;
|
|
@@ -216,15 +216,31 @@ const createWebsitePulumiApp = (projectAppParams = {}) => {
|
|
|
216
216
|
// The files that are generated in that process are stored in the `deliveryStorage` S3 bucket further below.
|
|
217
217
|
appId: appCloudfront.output.id,
|
|
218
218
|
appStorage: appBucket.bucket.output.id,
|
|
219
|
-
appUrl: appCloudfront.output.domainName.apply(value => `https://${value}`),
|
|
220
|
-
appDomain: appCloudfront.output.domainName,
|
|
221
219
|
// These are the Cloudfront and S3 bucket that will deliver static pages to the actual website visitors.
|
|
222
220
|
// The static HTML snapshots delivered from them still rely on the app's S3 bucket
|
|
223
221
|
// defined above, for serving static assets (JS, CSS, images).
|
|
224
222
|
deliveryId: deliveryCloudfront.output.id,
|
|
225
|
-
deliveryStorage: deliveryBucket.bucket.output.id
|
|
226
|
-
|
|
227
|
-
|
|
223
|
+
deliveryStorage: deliveryBucket.bucket.output.id
|
|
224
|
+
});
|
|
225
|
+
(0, _utils.addDomainsUrlsOutputs)({
|
|
226
|
+
app,
|
|
227
|
+
cloudfrontDistribution: appCloudfront,
|
|
228
|
+
map: {
|
|
229
|
+
distributionDomain: "cloudfrontAppDomain",
|
|
230
|
+
distributionUrl: "cloudfrontAppUrl",
|
|
231
|
+
usedDomain: "appDomain",
|
|
232
|
+
usedUrl: "appUrl"
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
(0, _utils.addDomainsUrlsOutputs)({
|
|
236
|
+
app,
|
|
237
|
+
cloudfrontDistribution: deliveryCloudfront,
|
|
238
|
+
map: {
|
|
239
|
+
distributionDomain: "cloudfrontDeliveryDomain",
|
|
240
|
+
distributionUrl: "cloudfrontDeliveryUrl",
|
|
241
|
+
usedDomain: "deliveryDomain",
|
|
242
|
+
usedUrl: "deliveryUrl"
|
|
243
|
+
}
|
|
228
244
|
});
|
|
229
245
|
(0, _utils.tagResources)({
|
|
230
246
|
WbyProjectName: String(process.env["WEBINY_PROJECT_NAME"]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createWebsitePulumiApp","projectAppParams","app","createPulumiApp","name","path","config","program","pulumiResourceNamePrefix","getParam","onResource","resource","startsWith","pulumi","addHandler","productionEnvironments","params","create","isProduction","includes","run","env","core","addModule","CoreOutput","vpcEnabled","vpc","VpcConfig","enabled","appBucket","createPrivateAppBucket","appCloudfront","addResource","aws","cloudfront","Distribution","waitForDeployment","origins","origin","defaultRootObject","defaultCacheBehavior","compress","targetOriginId","originId","viewerProtocolPolicy","allowedMethods","cachedMethods","forwardedValues","cookies","forward","queryString","minTtl","defaultTtl","maxTtl","priceClass","customErrorResponses","errorCode","responseCode","responsePagePath","restrictions","geoRestriction","restrictionType","viewerCertificate","cloudfrontDefaultCertificate","deliveryBucket","viewerRequest","Function","runtime","publish","code","fs","readFileSync","__dirname","deliveryCloudfront","originRequestPolicyId","functionAssociations","functionArn","output","arn","eventType","orderedCacheBehaviors","headers","pathPattern","prerendering","createPrerenderingService","dbTableName","primaryDynamodbTableName","dbTableHashKey","primaryDynamodbTableHashKey","dbTableRangeKey","primaryDynamodbTableRangeKey","appUrl","interpolate","domainName","deliveryUrl","bucket","cloudfrontId","id","domains","applyCustomDomain","previewDomains","process","WCP_PROJECT_ENVIRONMENT","WEBINY_MULTI_TENANCY","applyTenantRouter","addOutputs","appId","appStorage","apply","value","appDomain","deliveryId","deliveryStorage","deliveryDomain","tagResources","WbyProjectName","String","WbyEnvironment","delivery","withCommonLambdaEnvVariables"],"sources":["createWebsitePulumiApp.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport fs from \"fs\";\nimport { createPulumiApp, PulumiAppParamCallback, PulumiAppParam } from \"@webiny/pulumi\";\nimport { createPrivateAppBucket } from \"../createAppBucket\";\nimport { applyCustomDomain, CustomDomainParams } from \"../customDomain\";\nimport { createPrerenderingService } from \"./WebsitePrerendering\";\nimport { CoreOutput, VpcConfig } from \"~/apps\";\nimport { tagResources, withCommonLambdaEnvVariables } from \"~/utils\";\nimport { applyTenantRouter } from \"~/apps/tenantRouter\";\n\nexport type WebsitePulumiApp = ReturnType<typeof createWebsitePulumiApp>;\n\nexport interface CreateWebsitePulumiAppParams {\n /**\n * Custom domain(s) configuration.\n */\n domains?: PulumiAppParamCallback<CustomDomainParams>;\n\n /**\n * Custom preview domain(s) configuration.\n */\n previewDomains?: PulumiAppParamCallback<CustomDomainParams>;\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 | undefined>;\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: WebsitePulumiApp) => 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 createWebsitePulumiApp = (projectAppParams: CreateWebsitePulumiAppParams = {}) => {\n const app = createPulumiApp({\n name: \"website\",\n path: \"apps/website\",\n config: projectAppParams,\n program: async app => {\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 to late.\n if (projectAppParams.pulumi) {\n app.addHandler(() => {\n return projectAppParams.pulumi!(app as WebsitePulumiApp);\n });\n }\n\n const productionEnvironments = app.params.create.productionEnvironments || [\"prod\"];\n const isProduction = productionEnvironments.includes(app.params.run.env);\n\n // Register core output as a module available for all 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 appBucket = createPrivateAppBucket(app, \"app\");\n\n const appCloudfront = app.addResource(aws.cloudfront.Distribution, {\n name: \"app\",\n config: {\n enabled: true,\n waitForDeployment: true,\n origins: [appBucket.origin],\n defaultRootObject: \"index.html\",\n defaultCacheBehavior: {\n compress: true,\n targetOriginId: appBucket.origin.originId,\n viewerProtocolPolicy: \"redirect-to-https\",\n allowedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n cachedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n forwardedValues: {\n cookies: { forward: \"none\" },\n queryString: false\n },\n // MinTTL <= DefaultTTL <= MaxTTL\n minTtl: 0,\n defaultTtl: 0,\n maxTtl: 0\n },\n priceClass: \"PriceClass_100\",\n customErrorResponses: [\n { errorCode: 404, responseCode: 404, responsePagePath: \"/index.html\" }\n ],\n restrictions: {\n geoRestriction: {\n restrictionType: \"none\"\n }\n },\n viewerCertificate: {\n cloudfrontDefaultCertificate: true\n }\n }\n });\n\n const deliveryBucket = createPrivateAppBucket(app, \"delivery\");\n\n /**\n * We need to have a Cloudfront Function to perform a simple request rewrite, so the request always includes\n * an \"/index.html\". This is necessary because our buckets are not \"website\" buckets, and we need to\n * have an exact object key when requesting page paths.\n */\n const viewerRequest = app.addResource(aws.cloudfront.Function, {\n name: \"cfViewerRequest\",\n config: {\n runtime: \"cloudfront-js-1.0\",\n publish: true,\n code: fs.readFileSync(__dirname + `/deliveryViewerRequest.js`, \"utf8\")\n }\n });\n\n const deliveryCloudfront = app.addResource(aws.cloudfront.Distribution, {\n name: \"delivery\",\n config: {\n enabled: true,\n waitForDeployment: true,\n origins: [deliveryBucket.origin, appBucket.origin],\n defaultRootObject: \"index.html\",\n defaultCacheBehavior: {\n compress: true,\n targetOriginId: deliveryBucket.origin.originId,\n viewerProtocolPolicy: \"redirect-to-https\",\n allowedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n cachedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n originRequestPolicyId: \"\",\n forwardedValues: {\n cookies: { forward: \"none\" },\n queryString: true\n },\n // MinTTL <= DefaultTTL <= MaxTTL\n minTtl: 0,\n defaultTtl: 30,\n maxTtl: 30,\n functionAssociations: [\n { functionArn: viewerRequest.output.arn, eventType: \"viewer-request\" }\n ]\n },\n orderedCacheBehaviors: [\n {\n compress: true,\n allowedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n cachedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n forwardedValues: {\n cookies: {\n forward: \"none\"\n },\n headers: [],\n queryString: false\n },\n pathPattern: \"/static/*\",\n viewerProtocolPolicy: \"allow-all\",\n targetOriginId: appBucket.origin.originId,\n // MinTTL <= DefaultTTL <= MaxTTL\n minTtl: 0,\n defaultTtl: 2592000, // 30 days\n maxTtl: 2592000\n }\n ],\n customErrorResponses: [\n {\n errorCode: 404,\n responseCode: 404,\n responsePagePath: \"/_NOT_FOUND_PAGE_/index.html\"\n }\n ],\n priceClass: \"PriceClass_100\",\n restrictions: {\n geoRestriction: {\n restrictionType: \"none\"\n }\n },\n viewerCertificate: {\n cloudfrontDefaultCertificate: true\n }\n }\n });\n\n const prerendering = createPrerenderingService(app, {\n dbTableName: core.primaryDynamodbTableName,\n dbTableHashKey: core.primaryDynamodbTableHashKey,\n dbTableRangeKey: core.primaryDynamodbTableRangeKey,\n appUrl: pulumi.interpolate`https://${appCloudfront.output.domainName}`,\n deliveryUrl: pulumi.interpolate`https://${deliveryCloudfront.output.domainName}`,\n bucket: deliveryBucket.bucket.output.bucket,\n cloudfrontId: deliveryCloudfront.output.id\n });\n\n const domains = app.getParam(projectAppParams.domains);\n if (domains) {\n applyCustomDomain(deliveryCloudfront, domains);\n }\n\n const previewDomains = app.getParam(projectAppParams.previewDomains);\n if (previewDomains) {\n applyCustomDomain(appCloudfront, previewDomains);\n }\n\n if (\n process.env.WCP_PROJECT_ENVIRONMENT ||\n process.env.WEBINY_MULTI_TENANCY === \"true\"\n ) {\n applyTenantRouter(app, deliveryCloudfront);\n }\n\n app.addOutputs({\n // Cloudfront and S3 bucket used to host the single-page application (SPA). The URL of the distribution is mainly\n // utilized by the Page Builder app's prerendering engine. Using this URL, it accesses the SPA and creates HTML snapshots.\n // The files that are generated in that process are stored in the `deliveryStorage` S3 bucket further below.\n appId: appCloudfront.output.id,\n appStorage: appBucket.bucket.output.id,\n appUrl: appCloudfront.output.domainName.apply(value => `https://${value}`),\n appDomain: appCloudfront.output.domainName,\n // These are the Cloudfront and S3 bucket that will deliver static pages to the actual website visitors.\n // The static HTML snapshots delivered from them still rely on the app's S3 bucket\n // defined above, for serving static assets (JS, CSS, images).\n deliveryId: deliveryCloudfront.output.id,\n deliveryStorage: deliveryBucket.bucket.output.id,\n deliveryDomain: deliveryCloudfront.output.domainName,\n deliveryUrl: deliveryCloudfront.output.domainName.apply(value => `https://${value}`)\n });\n\n tagResources({\n WbyProjectName: String(process.env[\"WEBINY_PROJECT_NAME\"]),\n WbyEnvironment: String(process.env[\"WEBINY_ENV\"])\n });\n\n return {\n prerendering,\n app: {\n ...appBucket,\n cloudfront: appCloudfront\n },\n delivery: {\n ...deliveryBucket,\n cloudfront: deliveryCloudfront\n }\n };\n }\n });\n\n return withCommonLambdaEnvVariables(app);\n};\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAwCO,MAAMA,sBAAsB,GAAG,CAACC,gBAA8C,GAAG,EAAlD,KAAyD;EAC3F,MAAMC,GAAG,GAAG,IAAAC,wBAAA,EAAgB;IACxBC,IAAI,EAAE,SADkB;IAExBC,IAAI,EAAE,cAFkB;IAGxBC,MAAM,EAAEL,gBAHgB;IAIxBM,OAAO,EAAE,MAAML,GAAN,IAAa;MAClB,MAAMM,wBAAwB,GAAGN,GAAG,CAACO,QAAJ,CAC7BR,gBAAgB,CAACO,wBADY,CAAjC;;MAGA,IAAIA,wBAAJ,EAA8B;QAC1BN,GAAG,CAACQ,UAAJ,CAAeC,QAAQ,IAAI;UACvB,IAAI,CAACA,QAAQ,CAACP,IAAT,CAAcQ,UAAd,CAAyBJ,wBAAzB,CAAL,EAAyD;YACrDG,QAAQ,CAACP,IAAT,GAAiB,GAAEI,wBAAyB,GAAEG,QAAQ,CAAC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AA6BrH,GAA7B,CAAP;AACH,CA5NM"}
|
|
1
|
+
{"version":3,"names":["createWebsitePulumiApp","projectAppParams","app","createPulumiApp","name","path","config","program","pulumiResourceNamePrefix","getParam","onResource","resource","startsWith","pulumi","addHandler","productionEnvironments","params","create","isProduction","includes","run","env","core","addModule","CoreOutput","vpcEnabled","vpc","VpcConfig","enabled","appBucket","createPrivateAppBucket","appCloudfront","addResource","aws","cloudfront","Distribution","waitForDeployment","origins","origin","defaultRootObject","defaultCacheBehavior","compress","targetOriginId","originId","viewerProtocolPolicy","allowedMethods","cachedMethods","forwardedValues","cookies","forward","queryString","minTtl","defaultTtl","maxTtl","priceClass","customErrorResponses","errorCode","responseCode","responsePagePath","restrictions","geoRestriction","restrictionType","viewerCertificate","cloudfrontDefaultCertificate","deliveryBucket","viewerRequest","Function","runtime","publish","code","fs","readFileSync","__dirname","deliveryCloudfront","originRequestPolicyId","functionAssociations","functionArn","output","arn","eventType","orderedCacheBehaviors","headers","pathPattern","prerendering","createPrerenderingService","dbTableName","primaryDynamodbTableName","dbTableHashKey","primaryDynamodbTableHashKey","dbTableRangeKey","primaryDynamodbTableRangeKey","appUrl","interpolate","domainName","deliveryUrl","bucket","cloudfrontId","id","domains","applyCustomDomain","previewDomains","process","WCP_PROJECT_ENVIRONMENT","WEBINY_MULTI_TENANCY","applyTenantRouter","addOutputs","appId","appStorage","deliveryId","deliveryStorage","addDomainsUrlsOutputs","cloudfrontDistribution","map","distributionDomain","distributionUrl","usedDomain","usedUrl","tagResources","WbyProjectName","String","WbyEnvironment","delivery","withCommonLambdaEnvVariables"],"sources":["createWebsitePulumiApp.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport fs from \"fs\";\nimport { createPulumiApp, PulumiAppParamCallback, PulumiAppParam } from \"@webiny/pulumi\";\nimport { createPrivateAppBucket } from \"../createAppBucket\";\nimport { applyCustomDomain, CustomDomainParams } from \"../customDomain\";\nimport { createPrerenderingService } from \"./WebsitePrerendering\";\nimport { CoreOutput, VpcConfig } from \"~/apps\";\nimport { addDomainsUrlsOutputs, tagResources, withCommonLambdaEnvVariables } from \"~/utils\";\nimport { applyTenantRouter } from \"~/apps/tenantRouter\";\n\nexport type WebsitePulumiApp = ReturnType<typeof createWebsitePulumiApp>;\n\nexport interface CreateWebsitePulumiAppParams {\n /**\n * Custom domain(s) configuration.\n */\n domains?: PulumiAppParamCallback<CustomDomainParams>;\n\n /**\n * Custom preview domain(s) configuration.\n */\n previewDomains?: PulumiAppParamCallback<CustomDomainParams>;\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 | undefined>;\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: WebsitePulumiApp) => 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 createWebsitePulumiApp = (projectAppParams: CreateWebsitePulumiAppParams = {}) => {\n const app = createPulumiApp({\n name: \"website\",\n path: \"apps/website\",\n config: projectAppParams,\n program: async app => {\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 to late.\n if (projectAppParams.pulumi) {\n app.addHandler(() => {\n return projectAppParams.pulumi!(app as WebsitePulumiApp);\n });\n }\n\n const productionEnvironments = app.params.create.productionEnvironments || [\"prod\"];\n const isProduction = productionEnvironments.includes(app.params.run.env);\n\n // Register core output as a module available for all 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 appBucket = createPrivateAppBucket(app, \"app\");\n\n const appCloudfront = app.addResource(aws.cloudfront.Distribution, {\n name: \"app\",\n config: {\n enabled: true,\n waitForDeployment: true,\n origins: [appBucket.origin],\n defaultRootObject: \"index.html\",\n defaultCacheBehavior: {\n compress: true,\n targetOriginId: appBucket.origin.originId,\n viewerProtocolPolicy: \"redirect-to-https\",\n allowedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n cachedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n forwardedValues: {\n cookies: { forward: \"none\" },\n queryString: false\n },\n // MinTTL <= DefaultTTL <= MaxTTL\n minTtl: 0,\n defaultTtl: 0,\n maxTtl: 0\n },\n priceClass: \"PriceClass_100\",\n customErrorResponses: [\n { errorCode: 404, responseCode: 404, responsePagePath: \"/index.html\" }\n ],\n restrictions: {\n geoRestriction: {\n restrictionType: \"none\"\n }\n },\n viewerCertificate: {\n cloudfrontDefaultCertificate: true\n }\n }\n });\n\n const deliveryBucket = createPrivateAppBucket(app, \"delivery\");\n\n /**\n * We need to have a Cloudfront Function to perform a simple request rewrite, so the request always includes\n * an \"/index.html\". This is necessary because our buckets are not \"website\" buckets, and we need to\n * have an exact object key when requesting page paths.\n */\n const viewerRequest = app.addResource(aws.cloudfront.Function, {\n name: \"cfViewerRequest\",\n config: {\n runtime: \"cloudfront-js-1.0\",\n publish: true,\n code: fs.readFileSync(__dirname + `/deliveryViewerRequest.js`, \"utf8\")\n }\n });\n\n const deliveryCloudfront = app.addResource(aws.cloudfront.Distribution, {\n name: \"delivery\",\n config: {\n enabled: true,\n waitForDeployment: true,\n origins: [deliveryBucket.origin, appBucket.origin],\n defaultRootObject: \"index.html\",\n defaultCacheBehavior: {\n compress: true,\n targetOriginId: deliveryBucket.origin.originId,\n viewerProtocolPolicy: \"redirect-to-https\",\n allowedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n cachedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n originRequestPolicyId: \"\",\n forwardedValues: {\n cookies: { forward: \"none\" },\n queryString: true\n },\n // MinTTL <= DefaultTTL <= MaxTTL\n minTtl: 0,\n defaultTtl: 30,\n maxTtl: 30,\n functionAssociations: [\n { functionArn: viewerRequest.output.arn, eventType: \"viewer-request\" }\n ]\n },\n orderedCacheBehaviors: [\n {\n compress: true,\n allowedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n cachedMethods: [\"GET\", \"HEAD\", \"OPTIONS\"],\n forwardedValues: {\n cookies: {\n forward: \"none\"\n },\n headers: [],\n queryString: false\n },\n pathPattern: \"/static/*\",\n viewerProtocolPolicy: \"allow-all\",\n targetOriginId: appBucket.origin.originId,\n // MinTTL <= DefaultTTL <= MaxTTL\n minTtl: 0,\n defaultTtl: 2592000, // 30 days\n maxTtl: 2592000\n }\n ],\n customErrorResponses: [\n {\n errorCode: 404,\n responseCode: 404,\n responsePagePath: \"/_NOT_FOUND_PAGE_/index.html\"\n }\n ],\n priceClass: \"PriceClass_100\",\n restrictions: {\n geoRestriction: {\n restrictionType: \"none\"\n }\n },\n viewerCertificate: {\n cloudfrontDefaultCertificate: true\n }\n }\n });\n\n const prerendering = createPrerenderingService(app, {\n dbTableName: core.primaryDynamodbTableName,\n dbTableHashKey: core.primaryDynamodbTableHashKey,\n dbTableRangeKey: core.primaryDynamodbTableRangeKey,\n appUrl: pulumi.interpolate`https://${appCloudfront.output.domainName}`,\n deliveryUrl: pulumi.interpolate`https://${deliveryCloudfront.output.domainName}`,\n bucket: deliveryBucket.bucket.output.bucket,\n cloudfrontId: deliveryCloudfront.output.id\n });\n\n const domains = app.getParam(projectAppParams.domains);\n if (domains) {\n applyCustomDomain(deliveryCloudfront, domains);\n }\n\n const previewDomains = app.getParam(projectAppParams.previewDomains);\n if (previewDomains) {\n applyCustomDomain(appCloudfront, previewDomains);\n }\n\n if (\n process.env.WCP_PROJECT_ENVIRONMENT ||\n process.env.WEBINY_MULTI_TENANCY === \"true\"\n ) {\n applyTenantRouter(app, deliveryCloudfront);\n }\n\n app.addOutputs({\n // Cloudfront and S3 bucket used to host the single-page application (SPA). The URL of the distribution is mainly\n // utilized by the Page Builder app's prerendering engine. Using this URL, it accesses the SPA and creates HTML snapshots.\n // The files that are generated in that process are stored in the `deliveryStorage` S3 bucket further below.\n appId: appCloudfront.output.id,\n appStorage: appBucket.bucket.output.id,\n\n // These are the Cloudfront and S3 bucket that will deliver static pages to the actual website visitors.\n // The static HTML snapshots delivered from them still rely on the app's S3 bucket\n // defined above, for serving static assets (JS, CSS, images).\n deliveryId: deliveryCloudfront.output.id,\n deliveryStorage: deliveryBucket.bucket.output.id\n });\n\n addDomainsUrlsOutputs({\n app,\n cloudfrontDistribution: appCloudfront,\n map: {\n distributionDomain: \"cloudfrontAppDomain\",\n distributionUrl: \"cloudfrontAppUrl\",\n usedDomain: \"appDomain\",\n usedUrl: \"appUrl\"\n }\n });\n\n addDomainsUrlsOutputs({\n app,\n cloudfrontDistribution: deliveryCloudfront,\n map: {\n distributionDomain: \"cloudfrontDeliveryDomain\",\n distributionUrl: \"cloudfrontDeliveryUrl\",\n usedDomain: \"deliveryDomain\",\n usedUrl: \"deliveryUrl\"\n }\n });\n\n tagResources({\n WbyProjectName: String(process.env[\"WEBINY_PROJECT_NAME\"]),\n WbyEnvironment: String(process.env[\"WEBINY_ENV\"])\n });\n\n return {\n prerendering,\n app: {\n ...appBucket,\n cloudfront: appCloudfront\n },\n delivery: {\n ...deliveryBucket,\n cloudfront: deliveryCloudfront\n }\n };\n }\n });\n\n return withCommonLambdaEnvVariables(app);\n};\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;A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B;MAWA,IAAAN,4BAAA,EAAsB;QAClB5G,GADkB;QAElB6G,sBAAsB,EAAEtC,kBAFN;QAGlBuC,GAAG,EAAE;UACDC,kBAAkB,EAAE,0BADnB;UAEDC,eAAe,EAAE,uBAFhB;UAGDC,UAAU,EAAE,gBAHX;UAIDC,OAAO,EAAE;QAJR;MAHa,CAAtB;MAWA,IAAAC,mBAAA,EAAa;QACTC,cAAc,EAAEC,MAAM,CAAClB,OAAO,CAAChF,GAAR,CAAY,qBAAZ,CAAD,CADb;QAETmG,cAAc,EAAED,MAAM,CAAClB,OAAO,CAAChF,GAAR,CAAY,YAAZ,CAAD;MAFb,CAAb;MAKA,OAAO;QACH8D,YADG;QAEHjF,GAAG,8DACI2B,SADJ;UAECK,UAAU,EAAEH;QAFb,EAFA;QAMH0F,QAAQ,8DACDzD,cADC;UAEJ9B,UAAU,EAAEuC;QAFR;MANL,CAAP;IAWH;EA1OuB,CAAhB,CAAZ;EA6OA,OAAO,IAAAiD,mCAAA,EAA6BxH,GAA7B,CAAP;AACH,CA/OM"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/pulumi-aws",
|
|
3
|
-
"version": "5.34.6-beta.
|
|
3
|
+
"version": "5.34.6-beta.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/webiny/webiny-js.git"
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@pulumi/aws": "^5.8.0",
|
|
17
17
|
"@pulumi/pulumi": "^3.34.0",
|
|
18
|
-
"@webiny/cli-plugin-deploy-pulumi": "5.34.6-beta.
|
|
19
|
-
"@webiny/pulumi": "5.34.6-beta.
|
|
18
|
+
"@webiny/cli-plugin-deploy-pulumi": "5.34.6-beta.3",
|
|
19
|
+
"@webiny/pulumi": "5.34.6-beta.3",
|
|
20
20
|
"form-data": "4.0.0",
|
|
21
21
|
"node-fetch": "2.6.7"
|
|
22
22
|
},
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"@babel/preset-env": "^7.19.4",
|
|
27
27
|
"@babel/preset-typescript": "^7.18.6",
|
|
28
28
|
"@babel/runtime": "^7.19.0",
|
|
29
|
-
"@webiny/api-page-builder": "^5.34.6-beta.
|
|
30
|
-
"@webiny/aws-layers": "^5.34.6-beta.
|
|
31
|
-
"@webiny/cli": "^5.34.6-beta.
|
|
32
|
-
"@webiny/project-utils": "^5.34.6-beta.
|
|
29
|
+
"@webiny/api-page-builder": "^5.34.6-beta.3",
|
|
30
|
+
"@webiny/aws-layers": "^5.34.6-beta.3",
|
|
31
|
+
"@webiny/cli": "^5.34.6-beta.3",
|
|
32
|
+
"@webiny/project-utils": "^5.34.6-beta.3",
|
|
33
33
|
"chalk": "^4.1.0",
|
|
34
34
|
"lodash": "^4.5.0",
|
|
35
|
-
"mime": "2.5.2",
|
|
35
|
+
"mime": "^2.5.2",
|
|
36
36
|
"rimraf": "^3.0.2",
|
|
37
37
|
"ttypescript": "^1.5.12",
|
|
38
38
|
"typescript": "4.7.4"
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
]
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "fb21d506f1de4037aa39a68513e6399bc73b7375"
|
|
53
53
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as aws from "@pulumi/aws";
|
|
2
|
+
import { PulumiApp, PulumiAppResource } from "@webiny/pulumi";
|
|
3
|
+
interface AddDomainsUrlsOutputsParams {
|
|
4
|
+
cloudfrontDistribution: PulumiAppResource<typeof aws.cloudfront.Distribution>;
|
|
5
|
+
app: PulumiApp;
|
|
6
|
+
map: {
|
|
7
|
+
distributionDomain: string;
|
|
8
|
+
distributionUrl: string;
|
|
9
|
+
usedDomain: string;
|
|
10
|
+
usedUrl: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Based on the provided Cloudfront distribution and map,
|
|
15
|
+
* adds domain and URL-related values to final stack output.
|
|
16
|
+
*/
|
|
17
|
+
export declare const addDomainsUrlsOutputs: (params: AddDomainsUrlsOutputsParams) => void;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.addDomainsUrlsOutputs = void 0;
|
|
9
|
+
|
|
10
|
+
var pulumi = _interopRequireWildcard(require("@pulumi/pulumi"));
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Based on the provided Cloudfront distribution and map,
|
|
14
|
+
* adds domain and URL-related values to final stack output.
|
|
15
|
+
*/
|
|
16
|
+
const addDomainsUrlsOutputs = params => {
|
|
17
|
+
const {
|
|
18
|
+
cloudfrontDistribution,
|
|
19
|
+
app,
|
|
20
|
+
map
|
|
21
|
+
} = params; // These will always contain the default Cloudfront domain,
|
|
22
|
+
// no matter if the user provided a custom domain or not.
|
|
23
|
+
|
|
24
|
+
const distributionDomain = cloudfrontDistribution.output.domainName;
|
|
25
|
+
const distributionUrl = distributionDomain.apply(value => `https://${value}`);
|
|
26
|
+
app.addOutputs({
|
|
27
|
+
[map.distributionDomain]: distributionDomain,
|
|
28
|
+
[map.distributionUrl]: distributionUrl,
|
|
29
|
+
// These will contain a custom domain if provided,
|
|
30
|
+
// otherwise again the default Cloudfront domain.
|
|
31
|
+
[map.usedDomain]: distributionDomain,
|
|
32
|
+
[map.usedUrl]: distributionUrl
|
|
33
|
+
}); // We're adjusting the outputs via the `config.aliases` setter.
|
|
34
|
+
// At the time of implementing this, could not find a better solution.
|
|
35
|
+
|
|
36
|
+
cloudfrontDistribution.config.aliases(aliases => {
|
|
37
|
+
const [firstAlias] = aliases || [];
|
|
38
|
+
|
|
39
|
+
if (firstAlias) {
|
|
40
|
+
app.addOutputs({
|
|
41
|
+
[map.usedDomain]: pulumi.output(firstAlias),
|
|
42
|
+
[map.usedUrl]: pulumi.output(`https://${firstAlias}`)
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return aliases;
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.addDomainsUrlsOutputs = addDomainsUrlsOutputs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["addDomainsUrlsOutputs","params","cloudfrontDistribution","app","map","distributionDomain","output","domainName","distributionUrl","apply","value","addOutputs","usedDomain","usedUrl","config","aliases","firstAlias","pulumi"],"sources":["addDomainsUrlsOutputs.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\nimport * as aws from \"@pulumi/aws\";\nimport { PulumiApp, PulumiAppResource } from \"@webiny/pulumi\";\n\ninterface AddDomainsUrlsOutputsParams {\n cloudfrontDistribution: PulumiAppResource<typeof aws.cloudfront.Distribution>;\n app: PulumiApp;\n map: {\n distributionDomain: string;\n distributionUrl: string;\n usedDomain: string;\n usedUrl: string;\n };\n}\n\n/**\n * Based on the provided Cloudfront distribution and map,\n * adds domain and URL-related values to final stack output.\n */\nexport const addDomainsUrlsOutputs = (params: AddDomainsUrlsOutputsParams) => {\n const { cloudfrontDistribution, app, map } = params;\n\n // These will always contain the default Cloudfront domain,\n // no matter if the user provided a custom domain or not.\n const distributionDomain = cloudfrontDistribution.output.domainName;\n const distributionUrl = distributionDomain.apply(value => `https://${value}`);\n\n app.addOutputs({\n [map.distributionDomain]: distributionDomain,\n [map.distributionUrl]: distributionUrl,\n\n // These will contain a custom domain if provided,\n // otherwise again the default Cloudfront domain.\n [map.usedDomain]: distributionDomain,\n [map.usedUrl]: distributionUrl\n });\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 cloudfrontDistribution.config.aliases(aliases => {\n const [firstAlias] = aliases || [];\n if (firstAlias) {\n app.addOutputs({\n [map.usedDomain]: pulumi.output(firstAlias),\n [map.usedUrl]: pulumi.output(`https://${firstAlias}`)\n });\n }\n\n return aliases;\n });\n};\n"],"mappings":";;;;;;;;;AAAA;;AAeA;AACA;AACA;AACA;AACO,MAAMA,qBAAqB,GAAIC,MAAD,IAAyC;EAC1E,MAAM;IAAEC,sBAAF;IAA0BC,GAA1B;IAA+BC;EAA/B,IAAuCH,MAA7C,CAD0E,CAG1E;EACA;;EACA,MAAMI,kBAAkB,GAAGH,sBAAsB,CAACI,MAAvB,CAA8BC,UAAzD;EACA,MAAMC,eAAe,GAAGH,kBAAkB,CAACI,KAAnB,CAAyBC,KAAK,IAAK,WAAUA,KAAM,EAAnD,CAAxB;EAEAP,GAAG,CAACQ,UAAJ,CAAe;IACX,CAACP,GAAG,CAACC,kBAAL,GAA0BA,kBADf;IAEX,CAACD,GAAG,CAACI,eAAL,GAAuBA,eAFZ;IAIX;IACA;IACA,CAACJ,GAAG,CAACQ,UAAL,GAAkBP,kBANP;IAOX,CAACD,GAAG,CAACS,OAAL,GAAeL;EAPJ,CAAf,EAR0E,CAkB1E;EACA;;EACAN,sBAAsB,CAACY,MAAvB,CAA8BC,OAA9B,CAAsCA,OAAO,IAAI;IAC7C,MAAM,CAACC,UAAD,IAAeD,OAAO,IAAI,EAAhC;;IACA,IAAIC,UAAJ,EAAgB;MACZb,GAAG,CAACQ,UAAJ,CAAe;QACX,CAACP,GAAG,CAACQ,UAAL,GAAkBK,MAAM,CAACX,MAAP,CAAcU,UAAd,CADP;QAEX,CAACZ,GAAG,CAACS,OAAL,GAAeI,MAAM,CAACX,MAAP,CAAe,WAAUU,UAAW,EAApC;MAFJ,CAAf;IAIH;;IAED,OAAOD,OAAP;EACH,CAVD;AAWH,CA/BM"}
|
package/utils/index.d.ts
CHANGED
package/utils/index.js
CHANGED
|
@@ -34,6 +34,20 @@ Object.keys(_tagResources).forEach(function (key) {
|
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
+
var _addDomainsUrlsOutputs = require("./addDomainsUrlsOutputs");
|
|
38
|
+
|
|
39
|
+
Object.keys(_addDomainsUrlsOutputs).forEach(function (key) {
|
|
40
|
+
if (key === "default" || key === "__esModule") return;
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
42
|
+
if (key in exports && exports[key] === _addDomainsUrlsOutputs[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _addDomainsUrlsOutputs[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
37
51
|
var _uploadFolderToS = require("./uploadFolderToS3");
|
|
38
52
|
|
|
39
53
|
Object.keys(_uploadFolderToS).forEach(function (key) {
|
package/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./tagResources\";\nexport * from \"./uploadFolderToS3\";\nexport { withCommonLambdaEnvVariables, getCommonLambdaEnvVariables } from \"./lambdaEnvVariables\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA"}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./tagResources\";\nexport * from \"./addDomainsUrlsOutputs\";\nexport * from \"./uploadFolderToS3\";\nexport { withCommonLambdaEnvVariables, getCommonLambdaEnvVariables } from \"./lambdaEnvVariables\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA"}
|