From aa0675123de6f482d094178a22a71a4b6ac4da1e Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 23 Apr 2023 00:12:52 +0000 Subject: [PATCH 1/3] chore(deps): upgrade dependencies Upgrades project dependencies. See details in [workflow run]. [Workflow Run]: https://github.com/raykrueger/cdk-game-server/actions/runs/4775401304 ------ *Automatically created by projen via the "upgrade-main" workflow* Signed-off-by: github-actions --- package.json | 8 +- yarn.lock | 263 ++++++++++++++++++++++++++------------------------- 2 files changed, 136 insertions(+), 135 deletions(-) diff --git a/package.json b/package.json index 0e8e080..4736a95 100644 --- a/package.json +++ b/package.json @@ -48,10 +48,10 @@ "jest-junit": "^15", "jsii": "1.x", "jsii-diff": "^1.80.0", - "jsii-docgen": "^7.1.46", + "jsii-docgen": "^7.2.1", "jsii-pacmak": "^1.80.0", "npm-check-updates": "^16", - "projen": "^0.71.12", + "projen": "^0.71.21", "standard-version": "^9", "ts-jest": "^27", "typescript": "^5.0.4" @@ -62,8 +62,8 @@ }, "dependencies": { "@aws-solutions-constructs/aws-apigateway-lambda": "^2.38.0", - "@matthewbonig/state-machine": "0.0.21", - "@raykrueger/cdk-fargate-public-dns": "0.0.17" + "@matthewbonig/state-machine": "0.0.26", + "@raykrueger/cdk-fargate-public-dns": "0.0.18" }, "bundledDependencies": [ "@matthewbonig/state-machine" diff --git a/yarn.lock b/yarn.lock index bf7501d..474f4b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11,9 +11,9 @@ "@jridgewell/trace-mapping" "^0.3.9" "@aws-cdk/asset-awscli-v1@^2.2.97": - version "2.2.142" - resolved "https://registry.yarnpkg.com/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.142.tgz#dbc8f542199358484a494ee4556b062d2eb30773" - integrity sha512-KrOSMBFXJM3NTgh4N0a4SGm2cgXAOZMXFTColIgf7jiB3ljTUIL7G1xVCD3wrSV3rT7XpbishJuSHh0ME6FYFg== + version "2.2.147" + resolved "https://registry.yarnpkg.com/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.147.tgz#b946a32aba00d1a26a43423a8e0a575024fb7b23" + integrity sha512-WhCVJREtIoUiq9Otq1NXW/Eha6GxEJnR9qs6pmHtDH6w0O78+M+wfTa+jMv1mqEZwF8C5zSWOROzMinOpM2BFA== "@aws-cdk/asset-kubectl-v20@^2.1.1": version "2.1.1" @@ -21,9 +21,9 @@ integrity sha512-U1ntiX8XiMRRRH5J1IdC+1t5CE89015cwyt5U63Cpk0GnMlN5+h9WsWMlKlPXZR4rdq/m806JRlBMRpBUB2Dhw== "@aws-cdk/asset-node-proxy-agent-v5@^2.0.77": - version "2.0.118" - resolved "https://registry.yarnpkg.com/@aws-cdk/asset-node-proxy-agent-v5/-/asset-node-proxy-agent-v5-2.0.118.tgz#9cd7cf7bbd4f28ba073e2dbb6c24600468dc2b3b" - integrity sha512-BvLXKsAykxnmW7A+pXdND0lsJCJDK52JXVD+BfO8XAsWV5nSO3MAooxgbWCT8vyTXU8G2Zm+H6F5fikQhi3T9Q== + version "2.0.124" + resolved "https://registry.yarnpkg.com/@aws-cdk/asset-node-proxy-agent-v5/-/asset-node-proxy-agent-v5-2.0.124.tgz#8824818070b1628ebe31d3d018537cc9549b3913" + integrity sha512-9OoP1AXzQceQHwuX0xqIAupoRnMpaoc854HK5XGJu4JczwwuOEDwsGKTMCqdGaTdyUfjJgH3rQWtgd7MC18FYA== "@aws-solutions-constructs/aws-apigateway-lambda@^2.38.0": version "2.38.0" @@ -360,10 +360,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.38.0": - version "8.38.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.38.0.tgz#73a8a0d8aa8a8e6fe270431c5e72ae91b5337892" - integrity sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g== +"@eslint/js@8.39.0": + version "8.39.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.39.0.tgz#58b536bcc843f4cd1e02a7e6171da5c040f4d44b" + integrity sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng== "@gar/promisify@^1.1.3": version "1.1.3" @@ -636,12 +636,13 @@ dependencies: ajv "^8.12.0" -"@matthewbonig/state-machine@0.0.21": - version "0.0.21" - resolved "https://registry.yarnpkg.com/@matthewbonig/state-machine/-/state-machine-0.0.21.tgz#05c0531a848d94643f7a1d230905664e860af20f" - integrity sha512-i3SV9t88Dfjs8kSg0Q+YVCEBxIQicbuMjOYlKKQ4LHrSznwHGBOUW/sHIlUDc9ENX7R8m/Fki6xZJZ98AQaU7w== +"@matthewbonig/state-machine@0.0.26": + version "0.0.26" + resolved "https://registry.yarnpkg.com/@matthewbonig/state-machine/-/state-machine-0.0.26.tgz#a39af40ec050a00488402d8563b0970a852b283c" + integrity sha512-JYNcGFIXAa+PLVnQ1BP6BFvJKO5PjBD0xmR3QkryOKm0KtyoSt8dlIxEryStECd/LO3cKng73DDJG8C28EtwQA== dependencies: case "^1.6.3" + js-yaml "^4.1.0" lodash.merge "^4.6.2" projen "^0.65.74" @@ -796,10 +797,10 @@ "@pnpm/network.ca-file" "^1.0.1" config-chain "^1.1.11" -"@raykrueger/cdk-fargate-public-dns@0.0.17": - version "0.0.17" - resolved "https://registry.yarnpkg.com/@raykrueger/cdk-fargate-public-dns/-/cdk-fargate-public-dns-0.0.17.tgz#f877010f13f22187e7b5e610fa58a7cc4fb8885c" - integrity sha512-C5wmaro6DisXPL73FF2ZA16Q7nRmvxaMhhM++Rgcxi30gEqaJTwkc1KVnoanLSQaszHwIXRtFeQt+8vYl1K8tw== +"@raykrueger/cdk-fargate-public-dns@0.0.18": + version "0.0.18" + resolved "https://registry.yarnpkg.com/@raykrueger/cdk-fargate-public-dns/-/cdk-fargate-public-dns-0.0.18.tgz#c09454c6733de9f6e64bdaa60b43d8f7d56f12e6" + integrity sha512-UnyxqZteqwaq28X/IOgkUYwpRJqy41tlgJi+L4GpnyGAmBXPkNcTug0AnTK92/kMyyXYq7GypeZGw4oG+WAbQg== "@sigstore/protobuf-specs@^0.1.0": version "0.1.0" @@ -847,13 +848,13 @@ resolved "https://registry.yarnpkg.com/@tufjs/canonical-json/-/canonical-json-1.0.0.tgz#eade9fd1f537993bc1f0949f3aea276ecc4fab31" integrity sha512-QTnf++uxunWvG2z3UFNzAoQPHxnSXOwtaI3iJ+AohhV+5vONuArPjJE7aPXPVXfXJsqrVbZBu9b81AJoSd09IQ== -"@tufjs/models@1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@tufjs/models/-/models-1.0.2.tgz#6c1e99210ada62c057b1742b5528d85acbfe0a47" - integrity sha512-uxarDtxTIK3f8hJS4yFhW/lvTa3tsiQU5iDCRut+NCnOXvNtEul0Ct58NIIcIx9Rkt7OFEK31Ndpqsd663nsew== +"@tufjs/models@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tufjs/models/-/models-1.0.3.tgz#e6cb8a86834da7459a7c836cd892dee56b4bab44" + integrity sha512-mkFEqqRisi13DmR5pX4x+Zk97EiU8djTtpNW1GeuX410y/raAsq/T3ZCjwoRIZ8/cIBfW0olK/sywlAiWevDVw== dependencies: "@tufjs/canonical-json" "1.0.0" - minimatch "^8.0.3" + minimatch "^7.4.6" "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": version "7.20.0" @@ -956,14 +957,14 @@ integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== "@types/node@*": - version "18.15.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f" - integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== + version "18.15.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" + integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== "@types/node@^16": - version "16.18.23" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.23.tgz#b6e934fe427eb7081d0015aad070acb3373c3c90" - integrity sha512-XAMpaw1s1+6zM+jn2tmw8MyaRDIJfXxqmIQIS0HfoGYPuf7dUWeiUKopwq13KFX9lEp1+THGtlaaYx39Nxr58g== + version "16.18.24" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.24.tgz#f21925dd56cd3467b4e1e0c5071d0f2af5e9a316" + integrity sha512-zvSN2Esek1aeLdKDYuntKAYjti9Z2oT4I8bfkLLhIxHlv3dwZ5vvATxOc31820iYm4hQRCwjUgDpwSMFjfTUnw== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -998,14 +999,14 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^5": - version "5.58.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.58.0.tgz#b1d4b0ad20243269d020ef9bbb036a40b0849829" - integrity sha512-vxHvLhH0qgBd3/tW6/VccptSfc8FxPQIkmNTVLWcCOVqSBvqpnKkBTYrhcGlXfSnd78azwe+PsjYFj0X34/njA== + version "5.59.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.0.tgz#c0e10eeb936debe5d1c3433cf36206a95befefd0" + integrity sha512-p0QgrEyrxAWBecR56gyn3wkG15TJdI//eetInP3zYRewDh0XS+DhB3VUAd3QqvziFsfaQIoIuZMxZRB7vXYaYw== dependencies: "@eslint-community/regexpp" "^4.4.0" - "@typescript-eslint/scope-manager" "5.58.0" - "@typescript-eslint/type-utils" "5.58.0" - "@typescript-eslint/utils" "5.58.0" + "@typescript-eslint/scope-manager" "5.59.0" + "@typescript-eslint/type-utils" "5.59.0" + "@typescript-eslint/utils" "5.59.0" debug "^4.3.4" grapheme-splitter "^1.0.4" ignore "^5.2.0" @@ -1014,71 +1015,71 @@ tsutils "^3.21.0" "@typescript-eslint/parser@^5": - version "5.58.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.58.0.tgz#2ac4464cf48bef2e3234cb178ede5af352dddbc6" - integrity sha512-ixaM3gRtlfrKzP8N6lRhBbjTow1t6ztfBvQNGuRM8qH1bjFFXIJ35XY+FC0RRBKn3C6cT+7VW1y8tNm7DwPHDQ== + version "5.59.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.0.tgz#0ad7cd019346cc5d150363f64869eca10ca9977c" + integrity sha512-qK9TZ70eJtjojSUMrrEwA9ZDQ4N0e/AuoOIgXuNBorXYcBDk397D2r5MIe1B3cok/oCtdNC5j+lUUpVB+Dpb+w== dependencies: - "@typescript-eslint/scope-manager" "5.58.0" - "@typescript-eslint/types" "5.58.0" - "@typescript-eslint/typescript-estree" "5.58.0" + "@typescript-eslint/scope-manager" "5.59.0" + "@typescript-eslint/types" "5.59.0" + "@typescript-eslint/typescript-estree" "5.59.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.58.0": - version "5.58.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.58.0.tgz#5e023a48352afc6a87be6ce3c8e763bc9e2f0bc8" - integrity sha512-b+w8ypN5CFvrXWQb9Ow9T4/6LC2MikNf1viLkYTiTbkQl46CnR69w7lajz1icW0TBsYmlpg+mRzFJ4LEJ8X9NA== +"@typescript-eslint/scope-manager@5.59.0": + version "5.59.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.0.tgz#86501d7a17885710b6716a23be2e93fc54a4fe8c" + integrity sha512-tsoldKaMh7izN6BvkK6zRMINj4Z2d6gGhO2UsI8zGZY3XhLq1DndP3Ycjhi1JwdwPRwtLMW4EFPgpuKhbCGOvQ== dependencies: - "@typescript-eslint/types" "5.58.0" - "@typescript-eslint/visitor-keys" "5.58.0" + "@typescript-eslint/types" "5.59.0" + "@typescript-eslint/visitor-keys" "5.59.0" -"@typescript-eslint/type-utils@5.58.0": - version "5.58.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.58.0.tgz#f7d5b3971483d4015a470d8a9e5b8a7d10066e52" - integrity sha512-FF5vP/SKAFJ+LmR9PENql7fQVVgGDOS+dq3j+cKl9iW/9VuZC/8CFmzIP0DLKXfWKpRHawJiG70rVH+xZZbp8w== +"@typescript-eslint/type-utils@5.59.0": + version "5.59.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.0.tgz#8e8d1420fc2265989fa3a0d897bde37f3851e8c9" + integrity sha512-d/B6VSWnZwu70kcKQSCqjcXpVH+7ABKH8P1KNn4K7j5PXXuycZTPXF44Nui0TEm6rbWGi8kc78xRgOC4n7xFgA== dependencies: - "@typescript-eslint/typescript-estree" "5.58.0" - "@typescript-eslint/utils" "5.58.0" + "@typescript-eslint/typescript-estree" "5.59.0" + "@typescript-eslint/utils" "5.59.0" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.58.0": - version "5.58.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.58.0.tgz#54c490b8522c18986004df7674c644ffe2ed77d8" - integrity sha512-JYV4eITHPzVQMnHZcYJXl2ZloC7thuUHrcUmxtzvItyKPvQ50kb9QXBkgNAt90OYMqwaodQh2kHutWZl1fc+1g== +"@typescript-eslint/types@5.59.0": + version "5.59.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.0.tgz#3fcdac7dbf923ec5251545acdd9f1d42d7c4fe32" + integrity sha512-yR2h1NotF23xFFYKHZs17QJnB51J/s+ud4PYU4MqdZbzeNxpgUr05+dNeCN/bb6raslHvGdd6BFCkVhpPk/ZeA== -"@typescript-eslint/typescript-estree@5.58.0": - version "5.58.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.58.0.tgz#4966e6ff57eaf6e0fce2586497edc097e2ab3e61" - integrity sha512-cRACvGTodA+UxnYM2uwA2KCwRL7VAzo45syNysqlMyNyjw0Z35Icc9ihPJZjIYuA5bXJYiJ2YGUB59BqlOZT1Q== +"@typescript-eslint/typescript-estree@5.59.0": + version "5.59.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.0.tgz#8869156ee1dcfc5a95be3ed0e2809969ea28e965" + integrity sha512-sUNnktjmI8DyGzPdZ8dRwW741zopGxltGs/SAPgGL/AAgDpiLsCFLcMNSpbfXfmnNeHmK9h3wGmCkGRGAoUZAg== dependencies: - "@typescript-eslint/types" "5.58.0" - "@typescript-eslint/visitor-keys" "5.58.0" + "@typescript-eslint/types" "5.59.0" + "@typescript-eslint/visitor-keys" "5.59.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.58.0": - version "5.58.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.58.0.tgz#430d7c95f23ec457b05be5520c1700a0dfd559d5" - integrity sha512-gAmLOTFXMXOC+zP1fsqm3VceKSBQJNzV385Ok3+yzlavNHZoedajjS4UyS21gabJYcobuigQPs/z71A9MdJFqQ== +"@typescript-eslint/utils@5.59.0": + version "5.59.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.0.tgz#063d066b3bc4850c18872649ed0da9ee72d833d5" + integrity sha512-GGLFd+86drlHSvPgN/el6dRQNYYGOvRSDVydsUaQluwIW3HvbXuxyuD5JETvBt/9qGYe+lOrDk6gRrWOHb/FvA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.58.0" - "@typescript-eslint/types" "5.58.0" - "@typescript-eslint/typescript-estree" "5.58.0" + "@typescript-eslint/scope-manager" "5.59.0" + "@typescript-eslint/types" "5.59.0" + "@typescript-eslint/typescript-estree" "5.59.0" eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.58.0": - version "5.58.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.58.0.tgz#eb9de3a61d2331829e6761ce7fd13061781168b4" - integrity sha512-/fBraTlPj0jwdyTwLyrRTxv/3lnU2H96pNTVM6z3esTWLtA5MZ9ghSMJ7Rb+TtUAdtEw9EyJzJ0EydIMKxQ9gA== +"@typescript-eslint/visitor-keys@5.59.0": + version "5.59.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.0.tgz#a59913f2bf0baeb61b5cfcb6135d3926c3854365" + integrity sha512-qZ3iXxQhanchCeaExlKPV3gDQFxMUmU35xfd5eCXB6+kUw1TUAbIy2n7QIrwz9s98DQLzNWyHp61fY0da4ZcbA== dependencies: - "@typescript-eslint/types" "5.58.0" + "@typescript-eslint/types" "5.59.0" eslint-visitor-keys "^3.3.0" "@xmldom/xmldom@^0.8.6": @@ -1620,9 +1621,9 @@ camelcase@^7.0.0: integrity sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw== caniuse-lite@^1.0.30001449: - version "1.0.30001480" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001480.tgz#9bbd35ee44c2480a1e3a3b9f4496f5066817164a" - integrity sha512-q7cpoPPvZYgtyC4VaBSN0Bt+PJ4c4EYRf0DrduInOz2SkFpHD5p3LnvEpqBp7UnJn+8x1Ogl1s38saUxe+ihQQ== + version "1.0.30001481" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001481.tgz#f58a717afe92f9e69d0e35ff64df596bfad93912" + integrity sha512-KCqHwRnaa1InZBtqXzP98LPg0ajCVujMKjqKDhZEthIpAsJl/YEIa3YvXjGXPVqzZVguccuu7ga9KOE1J9rKPQ== case@1.6.3, case@^1.6.3: version "1.6.3" @@ -2151,7 +2152,7 @@ define-lazy-prop@^2.0.0: resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== -define-properties@^1.1.3, define-properties@^1.1.4: +define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== @@ -2255,9 +2256,9 @@ eastasianwidth@^0.2.0: integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== electron-to-chromium@^1.4.284: - version "1.4.365" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.365.tgz#ccd9e352d4493aa288d87e6ea36f3edf350c045e" - integrity sha512-FRHZO+1tUNO4TOPXmlxetkoaIY8uwHzd1kKopK/Gx2SKn1L47wJXWD44wxP5CGRyyP98z/c8e1eBzJrgPeiBOg== + version "1.4.369" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.369.tgz#a98d838cdd79be4471cd04e9b4dffe891d037874" + integrity sha512-LfxbHXdA/S+qyoTEA4EbhxGjrxx7WK2h6yb5K2v0UCOufUKX+VZaHbl3svlzZfv9sGseym/g3Ne4DpsgRULmqg== emittery@^0.8.1: version "0.8.1" @@ -2282,9 +2283,9 @@ encoding@^0.1.13: iconv-lite "^0.6.2" enhanced-resolve@^5.12.0: - version "5.12.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz#300e1c90228f5b570c4d35babf263f6da7155634" - integrity sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ== + version "5.13.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz#26d1ecc448c02de997133217b5c1053f34a0a275" + integrity sha512-eyV8f0y1+bzyfh8xAwW/WTSZpLbjhqc4ne9eGSH4Zo2ejdyiNG9pU6mf9DG8a7+Auk6MFTlNOT4Y2y/9k8GKVg== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -2472,7 +2473,7 @@ eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-scope@^7.1.1: +eslint-scope@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.0.tgz#f21ebdafda02352f103634b96dd47d9f81ca117b" integrity sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw== @@ -2486,14 +2487,14 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.0: integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== eslint@^8: - version "8.38.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.38.0.tgz#a62c6f36e548a5574dd35728ac3c6209bd1e2f1a" - integrity sha512-pIdsD2jwlUGf/U38Jv97t8lq6HpaU/G9NKbYmpWpZGw3LdTNhZLbJePqxOXGB5+JEKfOPU/XLxYxFh03nr1KTg== + version "8.39.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.39.0.tgz#7fd20a295ef92d43809e914b70c39fd5a23cf3f1" + integrity sha512-mwiok6cy7KTW7rBpo05k6+p4YVZByLNjAZ/ACB9DRCu4YDRwjXI01tWHp6KAUWelsBetTxKK/2sHB0vdS8Z2Og== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" "@eslint/eslintrc" "^2.0.2" - "@eslint/js" "8.38.0" + "@eslint/js" "8.39.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -2503,7 +2504,7 @@ eslint@^8: debug "^4.3.2" doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.1.1" + eslint-scope "^7.2.0" eslint-visitor-keys "^3.4.0" espree "^9.5.1" esquery "^1.4.2" @@ -2811,7 +2812,7 @@ function.prototype.name@^1.1.5: es-abstract "^1.19.0" functions-have-names "^1.2.2" -functions-have-names@^1.2.2: +functions-have-names@^1.2.2, functions-have-names@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== @@ -3404,7 +3405,7 @@ is-ci@^3.0.1: dependencies: ci-info "^3.2.0" -is-core-module@^2.11.0, is-core-module@^2.12.0, is-core-module@^2.5.0, is-core-module@^2.8.1: +is-core-module@^2.11.0, is-core-module@^2.5.0, is-core-module@^2.8.1: version "2.12.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.0.tgz#36ad62f6f73c8253fd6472517a12483cf03e7ec4" integrity sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ== @@ -4138,10 +4139,10 @@ jsii-diff@^1.80.0: log4js "^6.9.1" yargs "^16.2.0" -jsii-docgen@^7.1.46: - version "7.1.46" - resolved "https://registry.yarnpkg.com/jsii-docgen/-/jsii-docgen-7.1.46.tgz#e14e043da7e2cb8144c0d67fe3c14ad3e7e79b82" - integrity sha512-w0BsxuoBe55oEWNMzQoH7Xv27PvBST/LBqTk7H4fp6dlY3zgep4UbG2KB++vc8EzbbG8L9atfw6XwXYJMv7C1A== +jsii-docgen@^7.2.1: + version "7.2.1" + resolved "https://registry.yarnpkg.com/jsii-docgen/-/jsii-docgen-7.2.1.tgz#b315a749bb8f918f7c9595df1f0490bdaef00b5f" + integrity sha512-xMkiL3Ciy/ZqVOEOIOQat+CFy8OTMXiZJG1LxHiNxtl3n1wNKFJ6MOvtGusVPieah+ctyDgUfTe37w9AeckoQg== dependencies: "@jsii/spec" "^1.79.0" case "^1.6.3" @@ -4467,9 +4468,9 @@ lru-cache@^7.4.4, lru-cache@^7.5.1, lru-cache@^7.7.1: integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== lru-cache@^9.0.0: - version "9.0.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.0.3.tgz#8a04f282df5320227bb7215c55df2660d3e4e25b" - integrity sha512-cyjNRew29d4kbgnz1sjDqxg7qg8NW4s+HQzCGjeon7DV5T2yDije16W9HaUFV1dhVEMh+SjrOcK0TomBmf3Egg== + version "9.1.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.1.0.tgz#19efafa9d08d1c08eb8efd78876075f0b8b1b07b" + integrity sha512-qFXQEwchrZcMVen2uIDceR8Tii6kCJak5rzDStfEM0qA3YLMswaxIEZO0DhIbJ3aqaJiDjt+3crlplOb0tDtKQ== make-dir@^3.0.0: version "3.1.0" @@ -4629,7 +4630,7 @@ minimatch@^5.0.1: dependencies: brace-expansion "^2.0.1" -minimatch@^7.4.2: +minimatch@^7.4.2, minimatch@^7.4.6: version "7.4.6" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.6.tgz#845d6f254d8f4a5e4fd6baf44d5f10c8448365fb" integrity sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw== @@ -4861,9 +4862,9 @@ npm-bundled@^3.0.0: npm-normalize-package-bin "^3.0.0" npm-check-updates@^16: - version "16.10.8" - resolved "https://registry.yarnpkg.com/npm-check-updates/-/npm-check-updates-16.10.8.tgz#a8b9cb3a7bfecad4d95e2b5a51ed2431d162478e" - integrity sha512-e+p3rUCvaU0iKOvi+/Xiyx+mLe9/aRTu9Zrc7+TR6H2q+uFgmXEwqbXYN9Ngqsta8gdTjpn751UD5MEOogO5cA== + version "16.10.9" + resolved "https://registry.yarnpkg.com/npm-check-updates/-/npm-check-updates-16.10.9.tgz#7f32a484a55673dd0e757df9ae0c1eb9a882d255" + integrity sha512-J3ggasYJIFB+XqAT9qQcAAOKehpCXGRoZWlK4/u5YAOZB6hmM4CxdrxCA7A34hBK5zaPIEBnMqWBSV7mU6nixg== dependencies: chalk "^5.2.0" cli-table3 "^0.6.3" @@ -5343,10 +5344,10 @@ projen@^0.65.74: yargs "^16.2.0" zlib "^1.0.5" -projen@^0.71.12: - version "0.71.12" - resolved "https://registry.yarnpkg.com/projen/-/projen-0.71.12.tgz#c58aa8bf0b6436794337351b7d62838f29c2556b" - integrity sha512-6gH6ussxlE4Q8KG8Y+SFSLk9OOM32ozdX95xu20UwsxDpAKijpVSqWinWQqavjUxQ0TK4Vx1T02v0rH9T0AFYg== +projen@^0.71.21: + version "0.71.21" + resolved "https://registry.yarnpkg.com/projen/-/projen-0.71.21.tgz#730a2e5cde370e17b21f83b642e083acf4edf159" + integrity sha512-tmVZT2iOix1p5e83dR0jzHUyR5BvUBkmJ9ys1ujJ6RTcuTIuofYr5bIdYDOgIeTfRolLg36gce0d4CEw91XjJg== dependencies: "@iarna/toml" "^2.2.5" case "^1.6.3" @@ -5356,7 +5357,7 @@ projen@^0.71.12: fast-json-patch "^3.1.1" glob "^8" ini "^2.0.0" - semver "^7.4.0" + semver "^7.5.0" shx "^0.3.4" xmlbuilder2 "^2.4.1" yaml "2.0.0" @@ -5555,13 +5556,13 @@ redent@^3.0.0: strip-indent "^3.0.0" regexp.prototype.flags@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" - integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== + version "1.5.0" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb" + integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - functions-have-names "^1.2.2" + define-properties "^1.2.0" + functions-have-names "^1.2.3" registry-auth-token@^5.0.1: version "5.0.2" @@ -5630,11 +5631,11 @@ resolve.exports@^1.1.0: integrity sha512-/NtpHNDN7jWhAaQ9BvBUYZ6YTXsRBgfqWFWP7BZBaoMJO/I3G5OFzvTuWNlZC3aPjins1F+TNrLKsGbH4rfsRQ== resolve@^1.1.6, resolve@^1.10.0, resolve@^1.20.0, resolve@^1.22.1: - version "1.22.3" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.3.tgz#4b4055349ffb962600972da1fdc33c46a4eb3283" - integrity sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw== + version "1.22.2" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" + integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== dependencies: - is-core-module "^2.12.0" + is-core-module "^2.11.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -5736,10 +5737,10 @@ semver-utils@^1.1.4: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.4.0: - version "7.4.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.4.0.tgz#8481c92feffc531ab1e012a8ffc15bdd3a0f4318" - integrity sha512-RgOxM8Mw+7Zus0+zcLEUn8+JfoLpj/huFTItQy2hsM4khuC1HYRDp0cU482Ewn/Fcy6bCjufD8vAj7voC66KQw== +semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.0: + version "7.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.0.tgz#ed8c5dc8efb6c629c88b23d41dc9bf40c1d96cd0" + integrity sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA== dependencies: lru-cache "^6.0.0" @@ -5797,13 +5798,13 @@ signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== sigstore@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/sigstore/-/sigstore-1.2.0.tgz#ae5b31dac75c2d31e7873897e2862f0d0b205bce" - integrity sha512-Fr9+W1nkBSIZCkJQR7jDn/zI0UXNsVpp+7mDQkCnZOIxG9p6yNXBx9xntHsfUyYHE55XDkkVV3+rYbrkzAeesA== + version "1.3.2" + resolved "https://registry.yarnpkg.com/sigstore/-/sigstore-1.3.2.tgz#2f70ec3e1192911484d9d148ecd9c98345cd172d" + integrity sha512-0KT1DjpVB11FK15ep7BIsZQV6j1jBm4SnXIInbBCRvql6II39IKONOMO+j036sGsArU/+2xqa1NDJwJkic0neA== dependencies: "@sigstore/protobuf-specs" "^0.1.0" make-fetch-happen "^11.0.1" - tuf-js "^1.0.0" + tuf-js "^1.1.3" sisteransi@^1.0.5: version "1.0.5" @@ -6356,12 +6357,12 @@ tsutils@^3.21.0: dependencies: tslib "^1.8.1" -tuf-js@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/tuf-js/-/tuf-js-1.1.3.tgz#db3aada70fbf91fd9def9ad255645eaf81309f69" - integrity sha512-jGYi5nG/kqgfTFQSdoN6PW9eIn+XRZqdXku+fSwNk6UpWIsWaV7pzAqPgFr85edOPhoyJDyBqCS+DCnHroMvrw== +tuf-js@^1.1.3: + version "1.1.4" + resolved "https://registry.yarnpkg.com/tuf-js/-/tuf-js-1.1.4.tgz#e85a936b16859c7fae23e5f040bc0f7b559b3192" + integrity sha512-Lw2JRM3HTYhEtQJM2Th3aNCPbnXirtWMl065BawwmM2pX6XStH/ZO9e8T2hh0zk/HUa+1i6j+Lv6eDitKTau6A== dependencies: - "@tufjs/models" "1.0.2" + "@tufjs/models" "1.0.3" make-fetch-happen "^11.0.1" type-check@^0.4.0, type-check@~0.4.0: From 28a33c29c32d74c0fb16e2b9c5973135105b55ba Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 23 Apr 2023 00:14:41 +0000 Subject: [PATCH 2/3] chore: self mutation Signed-off-by: github-actions --- API.md | 340 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 340 insertions(+) diff --git a/API.md b/API.md index 84a6ad9..a780e09 100644 --- a/API.md +++ b/API.md @@ -1,3 +1,343 @@ +# cdk-game-server + +This AWS CDK Construct Library is designed to run dedicated game servers on +Amazon Elastic Container Service (Amazon ECS) and AWS Fargate as cheaply as +possible. However, it **will not** be free. + +The simple description is we run a single instance of a game server container on +AWS Fargate. We scale the desired tasks to 0 if the CPU utilization drops below +5% for 30 minutes. We use a Discord /slash command to start the server when you +want to play. We deploy no Load Balancers, we rely on public IP addresses. + +A slightly deeper description... We keep costs down by making a few +architectural decisions. Firstly, we are going to use a VPC with only public +subnets (similar to the default VPC in a new account). This eliminates the use +of NAT Gateways in a _proper_ VPC. Secondly, we do not deploy any load balancers +and simply expose the Fargate task with a public IP Address. The +[cdk-fargate-public-dns](https://github.com/raykrueger/cdk-fargate-public-dns) +library is used to add optional DNS updates for the Fargate public IP address. +Thirdly, we deploy a Cloudwatch Alarm that triggers if CPU Utilization falls +below 5% (configurable). The action for that alarm is an AWS Lambda function +(via an Amazon SNS Topic) that sets the desired tasks on the ECS Service to 0. +Game servers will have an EFS Filesystem created that is mounted game save data. +**Note** that game server files should be stored __in__ the container, and not +on EFS. Files inside the container are basically free as far as Fargate is +concerned. Storing files on EFS is not free, so we only mount the save game +paths. Finally, and optionally, a Discord slash command bot is deployed via AWS +Step Functions and AWS Lambda. The Discord _bot_ is entirely serverless and is +used to start the server if it is stopped, or check if the server is up. + +We will publish instructions for a few game servers we have tested, namely +Valheim, Satisfactory, and Factorio. + +## Prerequisites + +This library requires working knowledge of the AWS Cloud. You will have to +create IAM Users, and navigate the AWS web console at times. If these are not +subjects you are comfortable with, this likely isn't the library for you. + +This software is released without warranty. There is no commitment that the +costs of running this will be acceptable to your individual budget. + +This software is released in a 0.0.x version state. Which means there +are no guarantees of backwards compatibility with future changes. It also means +there will be bugs. + +You will be deploying this at your own risk. + +Ok, let's go! + +## Getting Started + +You will need an AWS account, and an IAM User with [API +Access](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html). +Optionally, you may want the [AWS +CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html) +installed. + +You will need NodeJS installed, anything greater than 16.x should be fine. Now +make a directory, initialize a new cdk app, and install this library. + +``` bash +mkdir cdk-my-server +cd cdk-my-server +npx cdk init app --language=typescript +npm install --save @raykrueger/cdk-game-server +``` + +Currently, we are only releasing the Typescript version of the library, in the +future, we may release Python support. The Typescript version _should_ work with a +Javascript-based application, but we'll use Typescript for this doc. + +Next, we'll edit `bin/cdk-my-server.ts` and remove all the boilerplate. Replace +that with the following sample. We'll use Satisfactory as an example. + +``` typescript +#!/usr/bin/env node +import * as cdk from 'aws-cdk-lib'; +import { Stack, Tags } from 'aws-cdk-lib'; +import { Vpc } from 'aws-cdk-lib/aws-ec2'; +import { AwsLogDriver, ContainerImage, Protocol } from 'aws-cdk-lib/aws-ecs'; +import { RetentionDays } from 'aws-cdk-lib/aws-logs'; +import 'source-map-support/register'; +import { GameServer } from '../../cdk-game-server/src'; + +class GameStack extends Stack { + constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { + super(scope, id, props) + + new GameServer(this, 'Satisfactory', { + cpu: 2048, // 2 vcpu + memoryLimitMiB: 8192, // 8 gb + image: ContainerImage.fromRegistry("raykrueger/satisfactory-dedicated-server"), + gamePorts: [ + { portNumber: 7777, protocol: Protocol.UDP }, + { portNumber: 15000, protocol: Protocol.UDP }, + { portNumber: 15777, protocol: Protocol.UDP } + ], + mountTarget: "/home/steam/.config/Epic/FactoryGame/Saved/SaveGames" + }); + } +} + +const app = new cdk.App(); +new GameStack(app, "Satisfactory", { env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: 'us-east-2' } }); +``` + +This will deploy Satisfactory using the +[raykrueger/satisfactory-dedicated-server](https://github.com/raykrueger/satisfactory-dedicated-server) +container. We will initially give it 2 vCPUs and 4gb of memory (which will be +fine to start with for Satisfactory). We expose the necessary ports for the +server, which all use UDP. We then specify the _mountTarget_, which is where the +container stores the game save files. + +Now let's deploy the application. + +``` bash +npx cdk deploy +``` + +You will be prompted to accept the security changes that occur, including +creating IAM roles and Security Groups. If you accept that prompt, the +deployment will commence and it will take a while. + +Once that deployment is complete, you can open the AWS Console and look at your +[Amazon ECS Clusters](https://console.aws.amazon.com/ecs/v2/clusters). You +should see a long _Satisfactory-something-something_ name. All of the names are +randomly generated from prefixes. Most aren't pretty. + +1. Click into the Cluster, it will have one Service. +1. Click into the Service, and click on the "Configuration +and tasks" tab +1. There will be one running Task. Click on the task, it will +have an ID like 98adc2c0d39d428e81868e8e35bdf9ab. +1. In the "Configuration" table, on the right you will see the Public IP. Copy that IP Address. + +Use that IP Address to connect to your server! + +### Autoshutdown Support + +Note that the server will shutdown in 30 minutes if it is idle. If it does, the _desired tasks_ count will be changed to 0 when that happens. To start the server again just update that _desired_ count to 1. + +## Adding DNS Support + +Copying the public IP address every time we start the server is annoying, so +let's add DNS Support. + +If you have a Hosted Zone configured in Amazon Route 53, the +[cdk-fargate-public-dns](https://github.com/raykrueger/cdk-fargate-public-dns) +library support can update a DNS record for you. In your Hosted Zone, create a new +_A Record_ and set the value to the Public IP from above (or 1.1.1.1 if the +server isn't running). Be sure to set the TTL to 300 seconds (5 minutes), this +ensures you don't have to wait forever, but is also reasonable. + +You'll add to the configuration above, after the `mountTarget`. The domainName is +your fully qualified A Record you created previously. The hostedZone is the ID +from Route 53, it usually starts with a _Z_. + +``` typescript +//previous code cut for brevity +mountTarget: "/home/steam/.config/Epic/FactoryGame/Saved/SaveGames", +dnsConfig: { + domainName: 'satisfactory.example.com', + hostzedZone: 'ZXXXXXXXXXXXXXXXXXXXX', + //optional: Delete this if using Route 53 the same account + //assumedRole: 'arn:aws:iam::111111111111:role/cross-account-r53-update' +}, +``` + +Optionally, we can update Route 53 in a different account, see +[cdk-fargate-public-dns](https://github.com/raykrueger/cdk-fargate-public-dns) +docs for more details. + +## Setting up Discord + +### Create a Discord Bot + +Logging into the AWS console and updating the desired tasks count, or doing it +from the AWS CLI, works, but we can do better. The `cdk-game-sever` construct +library can support deploying a Discord slash command bot that can start the +server for us. You'll need a Discord Server and permission to add bots to do +this. + +You need to create a bot in Discord first. Log into the [Discord Developer +Portal](https://discord.com/developers/applications) and Create an application. +After accepting the agreement, you'll be presented with the _General +Information_ page for your Application. + +Continuing with Satisfactory as our example, fill in the _Name_ as Satisfactory. +You'll want to start a set of notes at this point to gather a few values. +Collect the Application Id and Public Key for your application. + +Now, click on the _Bot_ navigation link on the left. Click the _Add Bot_ button. +Once you have completed the _Add Bot_ request, click on the _Copy_ button for +the Token. Add the Bot Token to your notes. + +Now, invite the bot to your server. Expand the _Oauth2_ dropdown in the left +navigation and click on _URL Generator_. We are only clicking two checkboxes here, the _bot_ and _applications.commands_ scope. At the bottom of +the page, next to the Generated URL field, click the _Copy_ button. Open a new +tab in your browser, paste that url, and hit enter. Invite your new bot to your +server and accept the permissions. + +The last thing you need is the Guild Id for your server (Guild is what Discord +calls their servers). To get the server ID for the first parameter, open +Discord, go to Settings > Advanced, and enable developer mode. Then, right-click +on the server title and select "_Copy ID_" to get the guild ID. Add that to your +notes. + +### Create an AWS Secret + +Now we'll create a secret in AWS Secrets manager. Open the [AWS Secrets +Manager](console.aws.amazon.com/secretsmanager/listsecrets) console. Be sure to +select the region where you are deploying your game server. Click _Store a new secret_ and choose _Other Type of Secret_. This will present us with the option to create a Key/value type secret. + +You're going to create a secret with the following Keys. Note that the **key +names have to be exact**, so copy them from here. + +| Key | Value | +|-----|-------| +| PublicKey | The Public key from your Application | +| AppId | Your Application ID | +| GuildId | Your Guild ID, copied from the server | +| BotToken | The _Token_ we copied from the Bot page in Discord | + +For the Encryption key you can choose the default, unless you know you want +something else. + +Click Next. + +For Secret Name enter "SatisfactoryBotSecret", or whatever you want, and +remember that name for later. + +Click Next. + +You're not doing anything with this screen, so click Next again. + +Now you're on the Review page, just click _Store_. + +Your new secret may not show up on the list page right away, just refresh and it +will show up. + +### Deploy the Discord Bot + +``` typescript +//previous code cut for brevity +mountTarget: "/home/steam/.config/Epic/FactoryGame/Saved/SaveGames", +discord: { + commandName: 'satisfactory', + secretName: 'SatisfactoryBotSecret' +}, +``` + +Where commandName is the command as it will appear in Discord, so +"/satisfactory" in the example above. For secretName, that is going to be the +name of the secret created in the previous step. + +That's it. Let's deploy our server. + +``` bash +npx cdk deploy +``` + +If you accept the security changes the Bot will be deployed to your account. +This will create an API Gateway, a few AWS Lambda Functions, and a state machine +in AWS Step Functions. Additionally, some Lambda functions are deployed that act +as Custom Resources in Cloudformation to register your slash commands with +Discord. + +When the deployment completes, you'll see some _Outputs_ mentioned. We need the API Gateway output, it will have a somewhat nonsensical name like Satisfactory.SatisfactoryDiscordBot..... + +For example: + +``` +Outputs: +Satisfactory.SatisfactoryDiscordBotDiscordBotListenerLambdaRestApiEndpointCF7F987E = https://randomnumbers.execute-api.us-east-2.amazonaws.com/prod/ +``` + +Copy that URL and go back to your Application in the Discord Developer Portal. +On the _General Information_ page, paste that url into the _INTERACTIONS +ENDPOINT URL_ field. + +Click _Save Changes_. Discord will hit your API and make sure +everything is deployed correctly. If you get an error, go back and check your +secret names. + +Congratulations, your discord bot should be active now. + +There are only two bot commands `/{commandName} start` and `/{commandName} status` +and they aren't customizable at this time. The `start` command will start the +server (by setting the Desired Task count to 1), or tell you if the server is +already running. The `status` command will simply tell you whether the server is up or +down. + +## Adding Logging + +If your chosen game server container is giving you trouble, you can add logging + +``` typescript +//previous code cut for brevity +mountTarget: "/home/steam/.config/Epic/FactoryGame/Saved/SaveGames", +logging: new AwsLogDriver({ + streamPrefix: 'SatisfactoryLogs', + logRetention: RetentionDays.THREE_DAYS, +}), +``` + +This will generate a default log group in CloudWatch, and keep those logs for 3 +days. A shorter retention time will keep costs down. You can set your own log +group name by adding a `logGroup: "MyGameServerLogs"` if you want. + +## Tweaking Autoshutdown + +If you want to raise or lower the CPU Utilization target for the autoshutdown, or increase the evaluation period you can add the following. + +``` typescript +//previous code cut for brevity +mountTarget: "/home/steam/.config/Epic/FactoryGame/Saved/SaveGames", +autoShutdownConfig: { + cpuUtilizationMin: 5, + evaluationPeriods: 6 +} +``` + +If CPU Utilization of your container falls below `cpuUtilizationMin` for +`evaluationPeriods` the server will be shutdown by setting the Desired Tasks to +0. The `evaluationPeriods` is 5-minute periods. So in the defaults, Six 5-minute periods is 30 minutes. + +So if your CPU Utilization is below 5% for 30 minutes, the server is stopped. + +## Troubleshooting + +We will add to this section over time. + +### Game Server Not Starting + +The best thing you can do for troubleshooting your game is to enable [Logging](#adding-logging) + +### Everything Else + +[Open a github issue](https://github.com/raykrueger/cdk-game-server/issues) :) + # API Reference ## Constructs From 06fa7f5314a7d04607ea4b3cb8da4cbfbffd500c Mon Sep 17 00:00:00 2001 From: Ray Krueger Date: Sun, 23 Apr 2023 19:34:49 +0000 Subject: [PATCH 3/3] Upgrade dependencies --- .projen/deps.json | 8 ++++---- .projenrc.js | 2 +- package.json | 5 +++-- yarn.lock | 50 +++++++++++++++++++++++------------------------ 4 files changed, 33 insertions(+), 32 deletions(-) diff --git a/.projen/deps.json b/.projen/deps.json index 41dc43b..9a79dc6 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -97,6 +97,10 @@ "name": "typescript", "type": "build" }, + { + "name": "@aws-solutions-constructs/aws-apigateway-lambda", + "type": "bundled" + }, { "name": "@matthewbonig/state-machine", "type": "bundled" @@ -121,10 +125,6 @@ "version": "^10.0.5", "type": "peer" }, - { - "name": "@aws-solutions-constructs/aws-apigateway-lambda", - "type": "runtime" - }, { "name": "@raykrueger/cdk-fargate-public-dns", "type": "runtime" diff --git a/.projenrc.js b/.projenrc.js index 2a0038e..d5b91af 100644 --- a/.projenrc.js +++ b/.projenrc.js @@ -16,10 +16,10 @@ const project = new awscdk.AwsCdkConstructLibrary({ }, deps: [ - '@aws-solutions-constructs/aws-apigateway-lambda', '@raykrueger/cdk-fargate-public-dns', ], bundledDeps: [ + '@aws-solutions-constructs/aws-apigateway-lambda', '@matthewbonig/state-machine', ], devDeps: [ diff --git a/package.json b/package.json index 4736a95..08e2057 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "jsii-docgen": "^7.2.1", "jsii-pacmak": "^1.80.0", "npm-check-updates": "^16", - "projen": "^0.71.21", + "projen": "^0.71.22", "standard-version": "^9", "ts-jest": "^27", "typescript": "^5.0.4" @@ -61,11 +61,12 @@ "constructs": "^10.0.5" }, "dependencies": { - "@aws-solutions-constructs/aws-apigateway-lambda": "^2.38.0", + "@aws-solutions-constructs/aws-apigateway-lambda": "^2.39.0", "@matthewbonig/state-machine": "0.0.26", "@raykrueger/cdk-fargate-public-dns": "0.0.18" }, "bundledDependencies": [ + "@aws-solutions-constructs/aws-apigateway-lambda", "@matthewbonig/state-machine" ], "resolutions": { diff --git a/yarn.lock b/yarn.lock index 474f4b4..af4a4f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11,9 +11,9 @@ "@jridgewell/trace-mapping" "^0.3.9" "@aws-cdk/asset-awscli-v1@^2.2.97": - version "2.2.147" - resolved "https://registry.yarnpkg.com/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.147.tgz#b946a32aba00d1a26a43423a8e0a575024fb7b23" - integrity sha512-WhCVJREtIoUiq9Otq1NXW/Eha6GxEJnR9qs6pmHtDH6w0O78+M+wfTa+jMv1mqEZwF8C5zSWOROzMinOpM2BFA== + version "2.2.148" + resolved "https://registry.yarnpkg.com/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.148.tgz#3a7ad684fb543ca599a4a8c91de3df8e43d9a86c" + integrity sha512-LoMGTyxsDSFmaXErgymZdaaMegrGwn5ilXXvTkXFuwGn1ilqSOyBIVhT5wIDGkw4hbElcUJFiEtptFwb+UFgFw== "@aws-cdk/asset-kubectl-v20@^2.1.1": version "2.1.1" @@ -21,21 +21,21 @@ integrity sha512-U1ntiX8XiMRRRH5J1IdC+1t5CE89015cwyt5U63Cpk0GnMlN5+h9WsWMlKlPXZR4rdq/m806JRlBMRpBUB2Dhw== "@aws-cdk/asset-node-proxy-agent-v5@^2.0.77": - version "2.0.124" - resolved "https://registry.yarnpkg.com/@aws-cdk/asset-node-proxy-agent-v5/-/asset-node-proxy-agent-v5-2.0.124.tgz#8824818070b1628ebe31d3d018537cc9549b3913" - integrity sha512-9OoP1AXzQceQHwuX0xqIAupoRnMpaoc854HK5XGJu4JczwwuOEDwsGKTMCqdGaTdyUfjJgH3rQWtgd7MC18FYA== + version "2.0.125" + resolved "https://registry.yarnpkg.com/@aws-cdk/asset-node-proxy-agent-v5/-/asset-node-proxy-agent-v5-2.0.125.tgz#ba1aa45fe15ca0a2a319dee3a8aafc5e67ee9748" + integrity sha512-uze9vHHeh/qjpwhgZ/f8ssUKqFJ/P6xzsbEKEIkSyhNFje79vXg8Nu60BlpqWcU9Z36DjXb0+0+vrTaFcmSUIA== -"@aws-solutions-constructs/aws-apigateway-lambda@^2.38.0": - version "2.38.0" - resolved "https://registry.yarnpkg.com/@aws-solutions-constructs/aws-apigateway-lambda/-/aws-apigateway-lambda-2.38.0.tgz#05cb83510d70b4784f48f8908a3687a439b21e34" - integrity sha512-gZnj+uageaUVV4gcCAZ01Lm050SowZ8S6neWZSdvxLwKDpcZgTHu/k5UjNc0acjHMHtD/hOqA7oYQRtJEPEXCg== +"@aws-solutions-constructs/aws-apigateway-lambda@^2.39.0": + version "2.39.0" + resolved "https://registry.yarnpkg.com/@aws-solutions-constructs/aws-apigateway-lambda/-/aws-apigateway-lambda-2.39.0.tgz#f7c787fde5c4b81b5608536969506173d363df0b" + integrity sha512-MpHc29p6bE+SYc0WhQ1hXhjWDgzoL5QLTBYA+9wq8sKRyZgkz+4dl62G8qjR+FL78boC53RdLIO5/XDa6YL90w== dependencies: - "@aws-solutions-constructs/core" "2.38.0" + "@aws-solutions-constructs/core" "2.39.0" -"@aws-solutions-constructs/core@2.38.0": - version "2.38.0" - resolved "https://registry.yarnpkg.com/@aws-solutions-constructs/core/-/core-2.38.0.tgz#a96581b41e71bfa96372f5eac796576408df4061" - integrity sha512-wliL0AMUvKLejRNtD5ByLF+56fCRj2CJaLFLuccdMouzsMOJv5wYdzBGczZqmwWTx2arB9Jj0yjWOsQpAkTZXA== +"@aws-solutions-constructs/core@2.39.0": + version "2.39.0" + resolved "https://registry.yarnpkg.com/@aws-solutions-constructs/core/-/core-2.39.0.tgz#6c55c4524c45fa3591ccc2d272f3b5590a6feb7a" + integrity sha512-BhWgUUNeikOOdoRyOfMEMJOH69QR4XG3cKNQbkYebtKW/3Ius2NAgqOvWHSYUbK5CbNilDs7zqKiiml6vqmeDw== dependencies: deep-diff "^1.0.2" deepmerge "^4.0.0" @@ -957,9 +957,9 @@ integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== "@types/node@*": - version "18.15.13" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" - integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== + version "18.16.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.0.tgz#4668bc392bb6938637b47e98b1f2ed5426f33316" + integrity sha512-BsAaKhB+7X+H4GnSjGhJG9Qi8Tw+inU9nJDwmD5CgOmBLEI6ArdhikpLX7DjbjDRDTbqZzU2LSQNZg8WGPiSZQ== "@types/node@^16": version "16.18.24" @@ -4468,9 +4468,9 @@ lru-cache@^7.4.4, lru-cache@^7.5.1, lru-cache@^7.7.1: integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== lru-cache@^9.0.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.1.0.tgz#19efafa9d08d1c08eb8efd78876075f0b8b1b07b" - integrity sha512-qFXQEwchrZcMVen2uIDceR8Tii6kCJak5rzDStfEM0qA3YLMswaxIEZO0DhIbJ3aqaJiDjt+3crlplOb0tDtKQ== + version "9.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.1.1.tgz#c58a93de58630b688de39ad04ef02ef26f1902f1" + integrity sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A== make-dir@^3.0.0: version "3.1.0" @@ -5344,10 +5344,10 @@ projen@^0.65.74: yargs "^16.2.0" zlib "^1.0.5" -projen@^0.71.21: - version "0.71.21" - resolved "https://registry.yarnpkg.com/projen/-/projen-0.71.21.tgz#730a2e5cde370e17b21f83b642e083acf4edf159" - integrity sha512-tmVZT2iOix1p5e83dR0jzHUyR5BvUBkmJ9ys1ujJ6RTcuTIuofYr5bIdYDOgIeTfRolLg36gce0d4CEw91XjJg== +projen@^0.71.22: + version "0.71.22" + resolved "https://registry.yarnpkg.com/projen/-/projen-0.71.22.tgz#c9ec594275b3cf24e46fba7245b68740cd236b21" + integrity sha512-3+gZv/AaqE+2rO/4m1nMPEIyyyGf9BAmOweAzfsZXOlCvVYA/ZZa8Bqk9Db0ol6xJL80cQI+IuMyJ8KVLs+7cw== dependencies: "@iarna/toml" "^2.2.5" case "^1.6.3"