cdk-nuxt 2.3.0 → 2.4.0
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/README.md +10 -2
- package/index.d.ts +1 -0
- package/index.js +4 -2
- package/lib/functions/access-logs-analysis/group-by-date/build/app/index.js.map +1 -1
- package/lib/functions/access-logs-analysis/group-by-date/package.json +7 -6
- package/lib/functions/access-logs-analysis/group-by-date/yarn.lock +1117 -1067
- package/lib/functions/access-logs-analysis/partitioning/build/app/create-partition.js.map +1 -1
- package/lib/functions/access-logs-analysis/partitioning/build/app/transform-partition.js.map +1 -1
- package/lib/functions/access-logs-analysis/partitioning/build/app/util.js.map +1 -1
- package/lib/functions/access-logs-analysis/partitioning/package.json +7 -6
- package/lib/functions/access-logs-analysis/partitioning/yarn.lock +876 -818
- package/lib/functions/assets-cleanup/build/app/index.js.map +1 -1
- package/lib/functions/assets-cleanup/package.json +7 -6
- package/lib/functions/assets-cleanup/yarn.lock +1156 -870
- package/lib/stack/NuxtAppStackProps.d.ts +1 -1
- package/lib/stack/NuxtAppStackProps.js +1 -1
- package/lib/stack/NuxtAppStackProps.ts +1 -1
- package/lib/stack/access-logs-analysis/AccessLogsAnalysis.d.ts +3 -3
- package/lib/stack/access-logs-analysis/AccessLogsAnalysis.js +1 -1
- package/lib/stack/access-logs-analysis/AccessLogsAnalysis.ts +5 -5
- package/lib/stack/access-logs-analysis/AccessLogsParquetTable.d.ts +1 -1
- package/lib/stack/access-logs-analysis/AccessLogsParquetTable.js +1 -1
- package/lib/stack/access-logs-analysis/AccessLogsParquetTable.ts +1 -1
- package/lib/stack/access-logs-analysis/AccessLogsTableConfig.d.ts +1 -1
- package/lib/stack/access-logs-analysis/AccessLogsTableConfig.js +1 -1
- package/lib/stack/access-logs-analysis/AccessLogsTableConfig.ts +1 -1
- package/lib/stack/access-logs-analysis/CloudFrontAccessLogsAnalysis.d.ts +3 -3
- package/lib/stack/access-logs-analysis/CloudFrontAccessLogsAnalysis.js +1 -1
- package/lib/stack/access-logs-analysis/CloudFrontAccessLogsAnalysis.ts +3 -3
- package/lib/stack/access-logs-analysis/CloudFrontAccessLogsByDateTable.d.ts +1 -1
- package/lib/stack/access-logs-analysis/CloudFrontAccessLogsByDateTable.js +1 -1
- package/lib/stack/access-logs-analysis/CloudFrontAccessLogsByDateTable.ts +1 -1
- package/lib/stack/server/NuxtServerAppStack.d.ts +1 -1
- package/lib/stack/server/NuxtServerAppStack.js +3 -3
- package/lib/stack/server/NuxtServerAppStack.ts +8 -8
- package/lib/stack/server/NuxtServerAppStackProps.d.ts +1 -1
- package/lib/stack/server/NuxtServerAppStackProps.js +1 -1
- package/lib/stack/server/NuxtServerAppStackProps.ts +1 -1
- package/lib/templates/stack-index-server.ts +7 -2
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -19,8 +19,8 @@ Easily deploy Nuxt 3 applications via CDK on AWS including the following feature
|
|
|
19
19
|
|
|
20
20
|
## Prerequisites
|
|
21
21
|
|
|
22
|
-
- This package currently relies on using [Yarn](https://yarnpkg.com/) instead of NPM for deployment. Therefore, make sure to have Yarn available on the deployment system.
|
|
23
22
|
- You need an [AWS account](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/?nc1=h_ls) to create and deploy the required resources for the Nuxt app on AWS.
|
|
23
|
+
- This readme currently relies on using [Yarn](https://yarnpkg.com/) as a package manager. Feel free to use another package manager, but you have to adapt the commands accordingly.
|
|
24
24
|
|
|
25
25
|
## Installation
|
|
26
26
|
|
|
@@ -28,7 +28,7 @@ Install the package and its required dependencies:
|
|
|
28
28
|
```bash
|
|
29
29
|
yarn add cdk-nuxt --dev # The package itself
|
|
30
30
|
yarn add ts-node typescript --dev # To compile the CDK stacks via typescript
|
|
31
|
-
yarn add aws-cdk@2.
|
|
31
|
+
yarn add aws-cdk@2.166.0 --dev # CDK cli with this exact version for the deployment
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
## Setup
|
|
@@ -191,6 +191,14 @@ yarn build
|
|
|
191
191
|
yarn cdk deploy --require-approval never --all --app="yarn ts-node stack/index.ts"
|
|
192
192
|
```
|
|
193
193
|
|
|
194
|
+
For example, to run the commands with `pnpm`, you can run the following commands:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
```bash
|
|
198
|
+
pnpm build
|
|
199
|
+
pnpm cdk deploy --require-approval never --all --app="pnpm ts-node stack/index.ts"
|
|
200
|
+
```
|
|
201
|
+
|
|
194
202
|
## Destroy the Stack
|
|
195
203
|
|
|
196
204
|
If you want to destroy the stack and all its resources (including storage, e.g., access logs), run the following script:
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NuxtServerAppStack = void 0;
|
|
3
|
+
exports.App = exports.NuxtServerAppStack = void 0;
|
|
4
4
|
var NuxtServerAppStack_1 = require("./lib/stack/server/NuxtServerAppStack");
|
|
5
5
|
Object.defineProperty(exports, "NuxtServerAppStack", { enumerable: true, get: function () { return NuxtServerAppStack_1.NuxtServerAppStack; } });
|
|
6
|
-
|
|
6
|
+
var aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
7
|
+
Object.defineProperty(exports, "App", { enumerable: true, get: function () { return aws_cdk_lib_1.App; } });
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw0RUFBd0U7QUFBaEUsd0hBQUEsa0JBQWtCLE9BQUE7QUFFMUIsMkNBQWdDO0FBQXhCLGtHQUFBLEdBQUcsT0FBQSIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7TnV4dFNlcnZlckFwcFN0YWNrfSBmcm9tIFwiLi9saWIvc3RhY2svc2VydmVyL051eHRTZXJ2ZXJBcHBTdGFja1wiXG5leHBvcnQge051eHRTZXJ2ZXJBcHBTdGFja1Byb3BzfSBmcm9tIFwiLi9saWIvc3RhY2svc2VydmVyL051eHRTZXJ2ZXJBcHBTdGFja1Byb3BzXCJcbmV4cG9ydCB7QXBwfSBmcm9tIFwiYXdzLWNkay1saWJcIjsiXX0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,kDAAoF;AAGpF,uCAAuC;AACvC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;AAC/C,IAAI,CAAC,YAAY,EAAE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,kDAAoF;AAGpF,uCAAuC;AACvC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;AAC/C,IAAI,CAAC,YAAY,EAAE,CAAC;IAClB,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;AAC1E,CAAC;AACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,CAAC;IAC7C,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;AACxF,CAAC;AACD,0GAA0G;AAC1G,gDAAgD;AAChD,MAAM,uBAAuB,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;AAEpF,8CAA8C;AAC9C,MAAM,eAAe,GAAG,QAAQ,CAAC;AAEjC,MAAM,QAAQ,GAAG,IAAI,oBAAQ,CAAC,EAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,EAAC,CAAC,CAAC;AAEhE,MAAM,eAAe,GAAG,KAAK,EAAE,KAAc,EAAE,EAAE;IAC/C,IAAI,CAAC;QACH,M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IAC9D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC,CAAC;AAEW,QAAA,OAAO,GAAG,eAAe,CAAC","sourcesContent":["/**\n * This script moves access logs into a target folder hierarchy, structured by year, month, day, and hour (UTC).\n * That way, the logs can easier be processed with Athena.\n * Taken and adjusted from https://github.com/aws-samples/amazon-cloudfront-access-logs-queries.\n * This Lambda supports access logs from both: CloudFront and S3.\n */\nimport {S3Client, CopyObjectCommand, DeleteObjectCommand} from '@aws-sdk/client-s3';\nimport type {S3Event} from 'aws-lambda';\n\n// without leading and trailing slashes\nconst targetFolder = process.env.TARGET_FOLDER;\nif (!targetFolder) {\n throw new Error('Required environment variable TARGET_FOLDER missing!');\n}\nif (!process.env.RAW_ACCESS_LOG_FILE_PATTERN) {\n throw new Error('Required environment variable RAW_ACCESS_LOG_FILE_PATTERN missing!');\n}\n// unfortunately, CloudFront logs and S3 logs are completely different. That's why the pattern to identify\n// unprocessed log files need to be configurable\nconst rawAccessLogFilePattern = new RegExp(process.env.RAW_ACCESS_LOG_FILE_PATTERN);\n\n// matches for everything after the last slash\nconst filenamePattern = /[^/]+$/;\n\nconst s3Client = new S3Client({region: process.env.AWS_REGION});\n\nconst internalHandler = async (event: S3Event) => {\n try {\n const pendingMoves = event.Records.map(async record => {\n const bucket = record.s3.bucket.name;\n const sourceKey = record.s3.object.key;\n const match = rawAccessLogFilePattern.exec(sourceKey);\n\n // skip other files/folder\n if (match?.groups) {\n const {year, month, day, hour} = match.groups;\n const filename = filenamePattern.exec(sourceKey)![0];\n const targetKey = `${targetFolder}/year=${year}/month=${month}/day=${day}/hour=${hour}/${filename}`;\n\n const copyCommand = new CopyObjectCommand({\n Bucket: bucket,\n Key: targetKey,\n CopySource: bucket + '/' + sourceKey,\n });\n\n await s3Client.send(copyCommand);\n\n const deleteSourceCommand = new DeleteObjectCommand({\n Bucket: bucket,\n Key: sourceKey,\n });\n\n await s3Client.send(deleteSourceCommand);\n }\n });\n\n const processed = await Promise.all(pendingMoves);\n console.log(`successfully moved ${processed.length} files`);\n } catch (error) {\n console.error('### unexpected runtime error ###', error);\n }\n};\n\nexport const handler = internalHandler;\n"]}
|
|
@@ -9,12 +9,13 @@
|
|
|
9
9
|
"build": "tsc --project ./tsconfig.json"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@
|
|
13
|
-
"@types/
|
|
14
|
-
"
|
|
15
|
-
"
|
|
12
|
+
"@aws-sdk/client-s3": "^3.689.0",
|
|
13
|
+
"@types/aws-lambda": "^8.10.145",
|
|
14
|
+
"@types/node": "^20.10",
|
|
15
|
+
"ts-node": "^10.9.2",
|
|
16
|
+
"typescript": "^5.6.3"
|
|
16
17
|
},
|
|
17
|
-
"
|
|
18
|
-
"@aws-sdk/client-s3": "^3
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@aws-sdk/client-s3": "^3"
|
|
19
20
|
}
|
|
20
21
|
}
|