From 6720f28b7efd76964a216f40caa0d6f0d857b2eb Mon Sep 17 00:00:00 2001 From: Caden Marofke <132690522+marofke@users.noreply.github.com> Date: Fri, 29 Nov 2024 23:05:24 +0000 Subject: [PATCH] feat!: Update MongoDB version to 8.0 Remove support for MongoDB 3.6 and adds support for 8.0. Signed-off-by: Caden Marofke <132690522+marofke@users.noreply.github.com> --- bump.sh | 2 +- clean.sh | 4 +++ .../python/package/config.py | 4 +-- .../ts/bin/config.ts | 4 +-- .../ts/lib/storage-tier.ts | 2 +- .../python/package/config.py | 4 +-- .../ts/bin/config.ts | 4 +-- .../Local-Zone/python/package/lib/config.py | 8 ++--- examples/deadline/Local-Zone/ts/bin/config.ts | 8 ++--- .../bin/deadline_01_repository.ts | 4 +-- .../lib/repository-testing-tier.ts | 2 +- .../bastion/testing/DL-read-docdb-response.sh | 4 +-- integ/lib/storage-struct.ts | 4 +-- integ/scripts/bash/cleanup.sh | 2 +- lambda-layers/lib/get-regions.ts | 1 + .../lib/core/lib/mongodb-installer.ts | 6 ++-- .../aws-rfdk/lib/core/lib/mongodb-instance.ts | 2 +- .../mongodb/{3.6 => 8.0}/createAdminUser.js | 0 .../mongodb/{3.6 => 8.0}/installMongoDb.sh | 15 ++++---- .../mongodb/{3.6 => 8.0}/secretsFunction.sh | 0 .../{3.6 => 8.0}/serverCertFromSecrets.sh | 0 .../{3.6 => 8.0}/setAdminCredentials.sh | 2 +- .../{3.6 => 8.0}/setLiveConfiguration.sh | 0 .../mongodb/{3.6 => 8.0}/setMongoLimits.sh | 0 .../mongodb/{3.6 => 8.0}/setMongoNoAuth.sh | 0 .../mongodb/{3.6 => 8.0}/setStoragePath.sh | 0 .../{3.6 => 8.0}/setupMongodLiveConfig.py | 0 .../mongodb/{3.6 => 8.0}/setupMongodNoAuth.py | 0 .../{3.6 => 8.0}/setupMongodStorage.py | 0 .../aws-rfdk/lib/core/test/asset-constants.ts | 8 ++--- .../lib/core/test/mongodb-installer.test.ts | 34 +++++++++---------- .../lib/core/test/mongodb-instance.test.ts | 20 +++++------ .../core/test/mongodb-post-install.test.ts | 2 +- .../lib/deadline/lib/database-connection.ts | 10 +++--- .../aws-rfdk/lib/deadline/lib/repository.ts | 2 +- .../deadline/test/database-connection.test.ts | 8 ++--- .../lib/lambdas/nodejs/mongodb/handler.ts | 5 +-- .../nodejs/mongodb/test/handler.test.ts | 2 +- 38 files changed, 87 insertions(+), 86 deletions(-) rename packages/aws-rfdk/lib/core/scripts/mongodb/{3.6 => 8.0}/createAdminUser.js (100%) rename packages/aws-rfdk/lib/core/scripts/mongodb/{3.6 => 8.0}/installMongoDb.sh (66%) rename packages/aws-rfdk/lib/core/scripts/mongodb/{3.6 => 8.0}/secretsFunction.sh (100%) rename packages/aws-rfdk/lib/core/scripts/mongodb/{3.6 => 8.0}/serverCertFromSecrets.sh (100%) rename packages/aws-rfdk/lib/core/scripts/mongodb/{3.6 => 8.0}/setAdminCredentials.sh (93%) rename packages/aws-rfdk/lib/core/scripts/mongodb/{3.6 => 8.0}/setLiveConfiguration.sh (100%) rename packages/aws-rfdk/lib/core/scripts/mongodb/{3.6 => 8.0}/setMongoLimits.sh (100%) rename packages/aws-rfdk/lib/core/scripts/mongodb/{3.6 => 8.0}/setMongoNoAuth.sh (100%) rename packages/aws-rfdk/lib/core/scripts/mongodb/{3.6 => 8.0}/setStoragePath.sh (100%) rename packages/aws-rfdk/lib/core/scripts/mongodb/{3.6 => 8.0}/setupMongodLiveConfig.py (100%) rename packages/aws-rfdk/lib/core/scripts/mongodb/{3.6 => 8.0}/setupMongodNoAuth.py (100%) rename packages/aws-rfdk/lib/core/scripts/mongodb/{3.6 => 8.0}/setupMongodStorage.py (100%) diff --git a/bump.sh b/bump.sh index 03dbf8738..022e9f241 100755 --- a/bump.sh +++ b/bump.sh @@ -64,7 +64,7 @@ fi version_header="# \[$new_version](.*) (.*)" # Add a section to the changelog that states the supported Deadline versions -DEADLINE_RELEASE_NOTE_URL="https://docs.thinkboxsoftware.com/products/deadline/10.3/1_User%20Manual/manual/release-notes.html" +DEADLINE_RELEASE_NOTE_URL="https://docs.thinkboxsoftware.com/products/deadline/10.4/1_User%20Manual/manual/release-notes.html" DEADLINE_SUPPORTED_VERSIONS=$(node ./scripts/getSupportedDeadlineVersions.ts) MIN_DEADLINE_VERSION=$(echo "$DEADLINE_SUPPORTED_VERSIONS" | grep 'Min' | cut -f 2 -d ' ') MAX_DEADLINE_VERSION=$(echo "$DEADLINE_SUPPORTED_VERSIONS" | grep 'Max' | cut -f 2 -d ' ') diff --git a/clean.sh b/clean.sh index 5d70c7074..9fcc9aee5 100755 --- a/clean.sh +++ b/clean.sh @@ -15,4 +15,8 @@ fi # Packaging directory rm -rf ./dist +# Integ test directory +rm -rf "./integ/stage" +rm -rf "./integ/.e2etemp" + echo "Done" diff --git a/examples/deadline/All-In-AWS-Infrastructure-Basic/python/package/config.py b/examples/deadline/All-In-AWS-Infrastructure-Basic/python/package/config.py index 4c6267c6a..39006f6ff 100644 --- a/examples/deadline/All-In-AWS-Infrastructure-Basic/python/package/config.py +++ b/examples/deadline/All-In-AWS-Infrastructure-Basic/python/package/config.py @@ -39,10 +39,10 @@ def __init__(self): # to pin to. Some examples of pinned version values are "10", "10.1", or "10.1.12" self.deadline_version: Optional[str] = None - # A map of regions to Deadline Client Linux AMIs. As an example, the base Linux Deadline 10.3.2.1 AMI ID + # A map of regions to Deadline Client Linux AMIs. As an example, the base Linux Deadline 10.4.0.10 AMI ID # from us-west-2 is filled in. It can be used as-is, added to, or replaced. Ideally the version here should match the version of # Deadline used in any connected Deadline constructs. - self.deadline_client_linux_ami_map: Mapping[str, str] = {'us-west-2': 'ami-0b2bbe30ea8642cdd'} + self.deadline_client_linux_ami_map: Mapping[str, str] = {'us-west-2': 'ami-0927eddb98f8160b3'} # A secret (in binary form) in SecretsManager that stores the UBL certificates in a .zip file. # This must be in the format `arn::secretsmanager:::secret:-<6RandomCharacters` diff --git a/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/bin/config.ts b/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/bin/config.ts index 8ed965c11..2a6d0e5eb 100644 --- a/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/bin/config.ts +++ b/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/bin/config.ts @@ -40,11 +40,11 @@ class AppConfig { public readonly deadlineVersion?: string; /** - * A map of regions to Deadline Client Linux AMIs. As an example, the base Linux Deadline 10.3.2.1 AMI ID from us-west-2 + * A map of regions to Deadline Client Linux AMIs. As an example, the base Linux Deadline 10.4.0.10 AMI ID from us-west-2 * is filled in. It can be used as-is, added to, or replaced. Ideally the version here should match the version of * Deadline used in any connected Deadline constructs. */ - public readonly deadlineClientLinuxAmiMap: Record = {['us-west-2']: 'ami-0b2bbe30ea8642cdd'}; + public readonly deadlineClientLinuxAmiMap: Record = {['us-west-2']: 'ami-0927eddb98f8160b3'}; /** * (Optional) A secret (in binary form) in SecretsManager that stores the UBL certificates in a .zip file. diff --git a/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/lib/storage-tier.ts b/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/lib/storage-tier.ts index 1db3d6cb0..6a411226e 100644 --- a/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/lib/storage-tier.ts +++ b/examples/deadline/All-In-AWS-Infrastructure-Basic/ts/lib/storage-tier.ts @@ -428,7 +428,7 @@ export class StorageTierMongoDB extends StorageTier { instanceType: props.databaseInstanceType, mongoDb: { userSsplAcceptance: props.acceptSsplLicense, - version: MongoDbVersion.COMMUNITY_3_6, + version: MongoDbVersion.COMMUNITY_8_0, hostname: 'mongo', dnsZone: props.dnsZone, serverCertificate: serverCert, diff --git a/examples/deadline/All-In-AWS-Infrastructure-SEP/python/package/config.py b/examples/deadline/All-In-AWS-Infrastructure-SEP/python/package/config.py index 026a40a29..4302d381f 100644 --- a/examples/deadline/All-In-AWS-Infrastructure-SEP/python/package/config.py +++ b/examples/deadline/All-In-AWS-Infrastructure-SEP/python/package/config.py @@ -12,10 +12,10 @@ class AppConfig: TODO: Fill these in with your own values. """ def __init__(self): - # A map of regions to Deadline Client Linux AMIs. As an example, the base Linux Deadline 10.3.2.1 AMI ID + # A map of regions to Deadline Client Linux AMIs. As an example, the base Linux Deadline 10.4.0.10 AMI ID # from us-west-2 is filled in. It can be used as-is, added to, or replaced. Ideally the version here # should match the one used for staging the render queue and usage based licensing recipes. - self.deadline_client_linux_ami_map: Mapping[str, str] = {'us-west-2': 'ami-0b2bbe30ea8642cdd'} + self.deadline_client_linux_ami_map: Mapping[str, str] = {'us-west-2': 'ami-0927eddb98f8160b3'} # Whether the DeadlineResourceTrackerAccessRole IAM role required by Deadline's Resource Tracker should be created in this CDK app. # diff --git a/examples/deadline/All-In-AWS-Infrastructure-SEP/ts/bin/config.ts b/examples/deadline/All-In-AWS-Infrastructure-SEP/ts/bin/config.ts index bb5579853..84e6361a9 100644 --- a/examples/deadline/All-In-AWS-Infrastructure-SEP/ts/bin/config.ts +++ b/examples/deadline/All-In-AWS-Infrastructure-SEP/ts/bin/config.ts @@ -12,10 +12,10 @@ import 'source-map-support/register'; */ class AppConfig { /** - * A map of regions to Deadline Client Linux AMIs. As an example, the base Linux Deadline 10.3.2.1 AMI ID from us-west-2 + * A map of regions to Deadline Client Linux AMIs. As an example, the base Linux Deadline 10.4.0.10 AMI ID from us-west-2 * is filled in. It can be used as-is, added to, or replaced. */ - public readonly deadlineClientLinuxAmiMap: Record = {['us-west-2']: 'ami-0b2bbe30ea8642cdd'}; + public readonly deadlineClientLinuxAmiMap: Record = {['us-west-2']: 'ami-0927eddb98f8160b3'}; /** * Whether the DeadlineResourceTrackerAccessRole IAM role required by Deadline's Resource Tracker should be created in this CDK app. diff --git a/examples/deadline/Local-Zone/python/package/lib/config.py b/examples/deadline/Local-Zone/python/package/lib/config.py index 64eda6ca4..22cfab1d3 100644 --- a/examples/deadline/Local-Zone/python/package/lib/config.py +++ b/examples/deadline/Local-Zone/python/package/lib/config.py @@ -36,13 +36,13 @@ def __init__(self): # The version of Deadline to use on the render farm. Leave as None for the latest release or specify a version # to pin to. Some examples of pinned version values are "10", "10.1", or "10.1.16" - # The default value of 10.3.2 is used, to match the worker AMI ID provided below - self.deadline_version: Optional[str] = '10.3.2' + # The default value of 10.4.0 is used, to match the worker AMI ID provided below + self.deadline_version: Optional[str] = '10.4.0' - # A map of regions to Deadline Client Linux AMIs. As an example, the base Linux Deadline 10.3.2.1 AMI ID + # A map of regions to Deadline Client Linux AMIs. As an example, the base Linux Deadline 10.4.0.10 AMI ID # from us-west-2 is filled in. It can be used as-is, added to, or replaced. Ideally the version here # should match the one used for staging the render queue and usage based licensing recipes. - self.deadline_client_linux_ami_map: Mapping[str, str] = {'us-west-2': 'ami-0b2bbe30ea8642cdd'} + self.deadline_client_linux_ami_map: Mapping[str, str] = {'us-west-2': 'ami-0927eddb98f8160b3'} # (Optional) The name of the EC2 keypair to associate with the instances. self.key_pair_name: Optional[str] = None diff --git a/examples/deadline/Local-Zone/ts/bin/config.ts b/examples/deadline/Local-Zone/ts/bin/config.ts index 37dc9983a..841645010 100644 --- a/examples/deadline/Local-Zone/ts/bin/config.ts +++ b/examples/deadline/Local-Zone/ts/bin/config.ts @@ -36,16 +36,16 @@ class AppConfig { /** * The version of Deadline to use on the render farm. Some examples of pinned version values are "10", "10.1", or * "10.1.16" - * @default 10.3.2 is used, to match the worker AMI ID provided below + * @default 10.4.0 is used, to match the worker AMI ID provided below */ - public readonly deadlineVersion: string = '10.3.2'; + public readonly deadlineVersion: string = '10.4.0'; /** - * A map of regions to Deadline Client Linux AMIs. As an example, the Linux Deadline 10.3.2.1 AMI ID from us-west-2 + * A map of regions to Deadline Client Linux AMIs. As an example, the Linux Deadline 10.4.0.10 AMI ID from us-west-2 * is filled in. It can be used as-is, added to, or replaced. Ideally the version here should match the one in * package.json used for staging the render queue and usage based licensing recipes. */ - public readonly deadlineClientLinuxAmiMap: Record = {['us-west-2']: 'ami-0b2bbe30ea8642cdd'}; + public readonly deadlineClientLinuxAmiMap: Record = {['us-west-2']: 'ami-0927eddb98f8160b3'}; /** * (Optional) The name of the EC2 keypair to associate with instances. diff --git a/integ/components/deadline/deadline_01_repository/bin/deadline_01_repository.ts b/integ/components/deadline/deadline_01_repository/bin/deadline_01_repository.ts index 71f25984c..244bc378e 100644 --- a/integ/components/deadline/deadline_01_repository/bin/deadline_01_repository.ts +++ b/integ/components/deadline/deadline_01_repository/bin/deadline_01_repository.ts @@ -57,9 +57,7 @@ new RepositoryTestingTier(app, 'RFDKInteg-DL-TestingTier' + integStackTag, { env, integStackTag, structs, - // Currently we test using MongoDB 3.6, which doesn't run on the - // Amazon Linux 2023 image that we use to test Deadline 10.4.0. - bastionMachineImageOverride: MachineImage.latestAmazonLinux2(), + bastionMachineImageOverride: MachineImage.latestAmazonLinux2023(), }); // Adds IAM Policy to Instance and ASG Roles diff --git a/integ/components/deadline/deadline_01_repository/lib/repository-testing-tier.ts b/integ/components/deadline/deadline_01_repository/lib/repository-testing-tier.ts index c926ca1b7..0a37d852e 100644 --- a/integ/components/deadline/deadline_01_repository/lib/repository-testing-tier.ts +++ b/integ/components/deadline/deadline_01_repository/lib/repository-testing-tier.ts @@ -100,7 +100,7 @@ export class RepositoryTestingTier extends TestingTier { const userSsplAcceptance = userAcceptsSSPL.toString() === 'true' ? MongoDbSsplLicenseAcceptance.USER_ACCEPTS_SSPL : MongoDbSsplLicenseAcceptance.USER_REJECTS_SSPL; const mongodbInstaller = new MongoDbInstaller(this, { - version: MongoDbVersion.COMMUNITY_3_6, + version: MongoDbVersion.COMMUNITY_8_0, userSsplAcceptance, }); mongodbInstaller.installOnLinuxInstance(this.testInstance.instance); diff --git a/integ/components/deadline/deadline_01_repository/scripts/bastion/testing/DL-read-docdb-response.sh b/integ/components/deadline/deadline_01_repository/scripts/bastion/testing/DL-read-docdb-response.sh index c446d9166..fb2108d74 100644 --- a/integ/components/deadline/deadline_01_repository/scripts/bastion/testing/DL-read-docdb-response.sh +++ b/integ/components/deadline/deadline_01_repository/scripts/bastion/testing/DL-read-docdb-response.sh @@ -39,7 +39,5 @@ else fi # Mongo command to query for "deadline10db" database. -# We delete Timestamp fields from the EJSON result to avoid errors when parsing -# them in Python. -mongo --quiet --ssl --host="$DB_ADDRESS" --sslCAFile="$CERT_CA" --username="$DB_USERNAME" --password="$DB_PASS" --eval='(function(){var output=db.adminCommand({ listDatabases: 1, nameOnly: true, filter: { "name": "deadline10db" } } );delete output.onTime;delete output.operationTime;printjson(output)})()' +mongosh --quiet --tls --host="$DB_ADDRESS" --tlsCAFile="$CERT_CA" --username="$DB_USERNAME" --password="$DB_PASS" --eval='EJSON.stringify( db.adminCommand({ listDatabases: 1, nameOnly: true, filter: { "name": "deadline10db" } }) );' exit 0 diff --git a/integ/lib/storage-struct.ts b/integ/lib/storage-struct.ts index ddfeb27b2..b8e2adc47 100644 --- a/integ/lib/storage-struct.ts +++ b/integ/lib/storage-struct.ts @@ -125,7 +125,7 @@ export class StorageStruct extends Construct { masterUser: { username: 'DocDBUser', }, - engineVersion: '3.6.0', + engineVersion: '5.0.0', backup: { retention: Duration.days(15), }, @@ -182,7 +182,7 @@ export class StorageStruct extends Construct { }, mongoDb: { userSsplAcceptance, - version: MongoDbVersion.COMMUNITY_3_6, + version: MongoDbVersion.COMMUNITY_8_0, dnsZone: new PrivateHostedZone(this, 'Zone', { zoneName: 'renderfarm.local', vpc, diff --git a/integ/scripts/bash/cleanup.sh b/integ/scripts/bash/cleanup.sh index 0d47177e8..4c3aab6ef 100755 --- a/integ/scripts/bash/cleanup.sh +++ b/integ/scripts/bash/cleanup.sh @@ -18,4 +18,4 @@ for COMPONENT in **/test_marker; do rm -rf "${COMPONENT_ROOT}/cdk.out" done -rm -rf "$INTEG_ROOT/node_modules" +rm -rf "$INTEG_ROOT/node_modules" \ No newline at end of file diff --git a/lambda-layers/lib/get-regions.ts b/lambda-layers/lib/get-regions.ts index 3d094da04..73661ed41 100644 --- a/lambda-layers/lib/get-regions.ts +++ b/lambda-layers/lib/get-regions.ts @@ -18,6 +18,7 @@ const REGION_DENY_LIST = [ 'ap-south-2', 'ap-southeast-3', 'ap-southeast-4', + 'ap-southeast-5', 'ca-west-1', 'eu-south-1', 'eu-south-2', diff --git a/packages/aws-rfdk/lib/core/lib/mongodb-installer.ts b/packages/aws-rfdk/lib/core/lib/mongodb-installer.ts index c9889e906..c5cf10e12 100644 --- a/packages/aws-rfdk/lib/core/lib/mongodb-installer.ts +++ b/packages/aws-rfdk/lib/core/lib/mongodb-installer.ts @@ -26,10 +26,10 @@ import { */ export enum MongoDbVersion { /** - * MongoDB 3.6 Community Edition. - * See: https://docs.mongodb.com/v3.6/introduction/ + * MongoDB 8.0 Community Edition. + * See: https://www.mongodb.com/docs/v8.0/introduction/ */ - COMMUNITY_3_6 = '3.6', + COMMUNITY_8_0 = '8.0', } /** diff --git a/packages/aws-rfdk/lib/core/lib/mongodb-instance.ts b/packages/aws-rfdk/lib/core/lib/mongodb-instance.ts index 03d19a366..368e53b00 100644 --- a/packages/aws-rfdk/lib/core/lib/mongodb-instance.ts +++ b/packages/aws-rfdk/lib/core/lib/mongodb-instance.ts @@ -420,7 +420,7 @@ export class MongoDbInstance extends Construct implements IMongoDb, IGrantable { vpc: props.vpc, vpcSubnets: { subnets: [ subnet ] }, instanceType: props.instanceType ?? new InstanceType('r5.large'), - machineImage: MachineImage.latestAmazonLinux2(), + machineImage: MachineImage.latestAmazonLinux2023(), blockDevices: [ { deviceName: '/dev/xvda', // Root volume diff --git a/packages/aws-rfdk/lib/core/scripts/mongodb/3.6/createAdminUser.js b/packages/aws-rfdk/lib/core/scripts/mongodb/8.0/createAdminUser.js similarity index 100% rename from packages/aws-rfdk/lib/core/scripts/mongodb/3.6/createAdminUser.js rename to packages/aws-rfdk/lib/core/scripts/mongodb/8.0/createAdminUser.js diff --git a/packages/aws-rfdk/lib/core/scripts/mongodb/3.6/installMongoDb.sh b/packages/aws-rfdk/lib/core/scripts/mongodb/8.0/installMongoDb.sh similarity index 66% rename from packages/aws-rfdk/lib/core/scripts/mongodb/3.6/installMongoDb.sh rename to packages/aws-rfdk/lib/core/scripts/mongodb/8.0/installMongoDb.sh index a2046f91b..cf82ae16c 100644 --- a/packages/aws-rfdk/lib/core/scripts/mongodb/3.6/installMongoDb.sh +++ b/packages/aws-rfdk/lib/core/scripts/mongodb/8.0/installMongoDb.sh @@ -3,7 +3,7 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -# Script to install MongoDB Community Edition v3.6 from the Mongo.org yum repository. +# Script to install MongoDB Community Edition v8.0 from the Mongo.org yum repository. # # Developer note: For legal reasons we absolutely cannot distribute MongoDB in any way. # This includes distributing the installers, or images with MongoDB pre-installed. @@ -12,19 +12,17 @@ set -xefuo pipefail -# Installation instructions: https://docs.mongodb.com/v3.6/tutorial/install-mongodb-on-red-hat/ -# Note: There are no instructions for Amazon Linux 2, but the RedHat 7 binaries are compatible. - -REPO_FILENAME=mongodb-org-3.6.repo +# Installation instructions: https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-amazon/ +REPO_FILENAME=mongodb-org-8.0.repo YUM_REPOS_DIR=/etc/yum.repos.d cat > "/tmp/${REPO_FILENAME}" << EOF -[mongodb-org-3.6] +[mongodb-org-8.0] name=MongoDB Repository -baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.6/x86_64 +baseurl=https://repo.mongodb.org/yum/amazon/2023/mongodb-org/8.0/x86_64/ gpgcheck=1 enabled=1 -gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc +gpgkey=https://pgp.mongodb.com/server-8.0.asc EOF sudo mv "/tmp/${REPO_FILENAME}" "${YUM_REPOS_DIR}" @@ -33,4 +31,5 @@ sudo chown root.root "${YUM_REPOS_DIR}/${REPO_FILENAME}" sudo chmod 600 "${YUM_REPOS_DIR}/${REPO_FILENAME}" # Do the install +sudo yum install -y mongodb-mongosh-shared-openssl3 sudo yum install -y mongodb-org diff --git a/packages/aws-rfdk/lib/core/scripts/mongodb/3.6/secretsFunction.sh b/packages/aws-rfdk/lib/core/scripts/mongodb/8.0/secretsFunction.sh similarity index 100% rename from packages/aws-rfdk/lib/core/scripts/mongodb/3.6/secretsFunction.sh rename to packages/aws-rfdk/lib/core/scripts/mongodb/8.0/secretsFunction.sh diff --git a/packages/aws-rfdk/lib/core/scripts/mongodb/3.6/serverCertFromSecrets.sh b/packages/aws-rfdk/lib/core/scripts/mongodb/8.0/serverCertFromSecrets.sh similarity index 100% rename from packages/aws-rfdk/lib/core/scripts/mongodb/3.6/serverCertFromSecrets.sh rename to packages/aws-rfdk/lib/core/scripts/mongodb/8.0/serverCertFromSecrets.sh diff --git a/packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setAdminCredentials.sh b/packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setAdminCredentials.sh similarity index 93% rename from packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setAdminCredentials.sh rename to packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setAdminCredentials.sh index 908a26a49..440be2288 100644 --- a/packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setAdminCredentials.sh +++ b/packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setAdminCredentials.sh @@ -38,5 +38,5 @@ echo '");' >> ./temp.js cat temp.js | tr -d '\n' > ./adminCredentials.js rm -f ./temp.js -mongo --port 27017 --host localhost ./createAdminUser.js --quiet +mongosh --port 27017 --host localhost ./createAdminUser.js --quiet rm -f ./adminCredentials.js diff --git a/packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setLiveConfiguration.sh b/packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setLiveConfiguration.sh similarity index 100% rename from packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setLiveConfiguration.sh rename to packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setLiveConfiguration.sh diff --git a/packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setMongoLimits.sh b/packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setMongoLimits.sh similarity index 100% rename from packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setMongoLimits.sh rename to packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setMongoLimits.sh diff --git a/packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setMongoNoAuth.sh b/packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setMongoNoAuth.sh similarity index 100% rename from packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setMongoNoAuth.sh rename to packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setMongoNoAuth.sh diff --git a/packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setStoragePath.sh b/packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setStoragePath.sh similarity index 100% rename from packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setStoragePath.sh rename to packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setStoragePath.sh diff --git a/packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setupMongodLiveConfig.py b/packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setupMongodLiveConfig.py similarity index 100% rename from packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setupMongodLiveConfig.py rename to packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setupMongodLiveConfig.py diff --git a/packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setupMongodNoAuth.py b/packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setupMongodNoAuth.py similarity index 100% rename from packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setupMongodNoAuth.py rename to packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setupMongodNoAuth.py diff --git a/packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setupMongodStorage.py b/packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setupMongodStorage.py similarity index 100% rename from packages/aws-rfdk/lib/core/scripts/mongodb/3.6/setupMongodStorage.py rename to packages/aws-rfdk/lib/core/scripts/mongodb/8.0/setupMongodStorage.py diff --git a/packages/aws-rfdk/lib/core/test/asset-constants.ts b/packages/aws-rfdk/lib/core/test/asset-constants.ts index d32fd8d57..92d22451e 100644 --- a/packages/aws-rfdk/lib/core/test/asset-constants.ts +++ b/packages/aws-rfdk/lib/core/test/asset-constants.ts @@ -31,12 +31,12 @@ export const MOUNT_FSX_SCRIPT_LINUX = { Key: '9afc7cd192aacbc562e018fb8f9c3848df6a247d43d2486ee91c0ded179e2774', }; -export const INSTALL_MONGODB_3_6_SCRIPT_LINUX = { +export const INSTALL_MONGODB_8_0_SCRIPT_LINUX = { Bucket: 'cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}', - Key: '80faba664ebb899d63d89c8fcea1d867475d1ddd28159f418b42af81197849e1', + Key: '9a874a982214b9def58319059eb1f977840b7d0178a9563121c03b122e4d2acd', }; -export const MONGODB_3_6_CONFIGURATION_SCRIPTS = { +export const MONGODB_8_0_CONFIGURATION_SCRIPTS = { Bucket: 'cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}', - Key: '3b571d3659f9f47af6005ca9619c6aec2a576cea5a53b8707544df0a80e368c8', + Key: 'c1c40e6ac96769539de343b85ef12d12399dfedfdc4cb3129af6205d76953dfb', }; diff --git a/packages/aws-rfdk/lib/core/test/mongodb-installer.test.ts b/packages/aws-rfdk/lib/core/test/mongodb-installer.test.ts index 113158f29..23ad15e7f 100644 --- a/packages/aws-rfdk/lib/core/test/mongodb-installer.test.ts +++ b/packages/aws-rfdk/lib/core/test/mongodb-installer.test.ts @@ -24,7 +24,7 @@ import { MongoDbVersion, } from '../lib'; import { - INSTALL_MONGODB_3_6_SCRIPT_LINUX, + INSTALL_MONGODB_8_0_SCRIPT_LINUX, } from './asset-constants'; @@ -54,13 +54,13 @@ Please set the userSsplAcceptance property to USER_ACCEPTS_SSPL to signify your // Must throw when providing no SSPL option. expect(() => { new MongoDbInstaller(stack, { - version: MongoDbVersion.COMMUNITY_3_6, + version: MongoDbVersion.COMMUNITY_8_0, }); }).toThrow(errorString); // Must throw when explicitly rejecting the SSPL. expect(() => { new MongoDbInstaller(stack, { - version: MongoDbVersion.COMMUNITY_3_6, + version: MongoDbVersion.COMMUNITY_8_0, userSsplAcceptance: MongoDbSsplLicenseAcceptance.USER_REJECTS_SSPL, }); }).toThrow(errorString); @@ -75,7 +75,7 @@ Please set the userSsplAcceptance property to USER_ACCEPTS_SSPL to signify your machineImage: MachineImage.latestAmazonLinux2023(), }); const installer = new MongoDbInstaller(stack, { - version: MongoDbVersion.COMMUNITY_3_6, + version: MongoDbVersion.COMMUNITY_8_0, userSsplAcceptance: MongoDbSsplLicenseAcceptance.USER_ACCEPTS_SSPL, }); @@ -104,7 +104,7 @@ Please set the userSsplAcceptance property to USER_ACCEPTS_SSPL to signify your }, ':s3:::', { - 'Fn::Sub': INSTALL_MONGODB_3_6_SCRIPT_LINUX.Bucket, + 'Fn::Sub': INSTALL_MONGODB_8_0_SCRIPT_LINUX.Bucket, }, ], ], @@ -119,7 +119,7 @@ Please set the userSsplAcceptance property to USER_ACCEPTS_SSPL to signify your }, ':s3:::', { - 'Fn::Sub': INSTALL_MONGODB_3_6_SCRIPT_LINUX.Bucket, + 'Fn::Sub': INSTALL_MONGODB_8_0_SCRIPT_LINUX.Bucket, }, '/*', ], @@ -137,11 +137,11 @@ Please set the userSsplAcceptance property to USER_ACCEPTS_SSPL to signify your 'Fn::Join': [ '', [ - `#!/bin/bash\nmkdir -p $(dirname '/tmp/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh')\naws s3 cp 's3://`, + `#!/bin/bash\nmkdir -p $(dirname '/tmp/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh')\naws s3 cp 's3://`, { - 'Fn::Sub': INSTALL_MONGODB_3_6_SCRIPT_LINUX.Bucket, + 'Fn::Sub': INSTALL_MONGODB_8_0_SCRIPT_LINUX.Bucket, }, - `/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh' '/tmp/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh'\nbash /tmp/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh`, + `/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh' '/tmp/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh'\nbash /tmp/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh`, ], ], }, @@ -157,7 +157,7 @@ Please set the userSsplAcceptance property to USER_ACCEPTS_SSPL to signify your machineImage: MachineImage.latestWindows(WindowsVersion.WINDOWS_SERVER_2019_ENGLISH_FULL_SQL_2017_STANDARD), }); const installer = new MongoDbInstaller(stack, { - version: MongoDbVersion.COMMUNITY_3_6, + version: MongoDbVersion.COMMUNITY_8_0, userSsplAcceptance: MongoDbSsplLicenseAcceptance.USER_ACCEPTS_SSPL, }); @@ -175,11 +175,11 @@ Please set the userSsplAcceptance property to USER_ACCEPTS_SSPL to signify your machineImage: MachineImage.latestAmazonLinux2023(), }); const installer1 = new MongoDbInstaller(stack, { - version: MongoDbVersion.COMMUNITY_3_6, + version: MongoDbVersion.COMMUNITY_8_0, userSsplAcceptance: MongoDbSsplLicenseAcceptance.USER_ACCEPTS_SSPL, }); const installer2 = new MongoDbInstaller(stack, { - version: MongoDbVersion.COMMUNITY_3_6, + version: MongoDbVersion.COMMUNITY_8_0, userSsplAcceptance: MongoDbSsplLicenseAcceptance.USER_ACCEPTS_SSPL, }); @@ -195,15 +195,15 @@ Please set the userSsplAcceptance property to USER_ACCEPTS_SSPL to signify your 'Fn::Join': [ '', Match.arrayWith([ - `#!/bin/bash\nmkdir -p $(dirname '/tmp/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh')\naws s3 cp 's3://`, + `#!/bin/bash\nmkdir -p $(dirname '/tmp/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh')\naws s3 cp 's3://`, { - 'Fn::Sub': INSTALL_MONGODB_3_6_SCRIPT_LINUX.Bucket, + 'Fn::Sub': INSTALL_MONGODB_8_0_SCRIPT_LINUX.Bucket, }, - `/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh' '/tmp/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh'\nbash /tmp/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh\nmkdir -p $(dirname '/tmp/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh')\naws s3 cp 's3://`, + `/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh' '/tmp/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh'\nbash /tmp/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh\nmkdir -p $(dirname '/tmp/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh')\naws s3 cp 's3://`, { - 'Fn::Sub': INSTALL_MONGODB_3_6_SCRIPT_LINUX.Bucket, + 'Fn::Sub': INSTALL_MONGODB_8_0_SCRIPT_LINUX.Bucket, }, - `/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh' '/tmp/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh'\nbash /tmp/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh`, + `/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh' '/tmp/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh'\nbash /tmp/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh`, ]), ], }, diff --git a/packages/aws-rfdk/lib/core/test/mongodb-instance.test.ts b/packages/aws-rfdk/lib/core/test/mongodb-instance.test.ts index 134334c75..cb90e9682 100644 --- a/packages/aws-rfdk/lib/core/test/mongodb-instance.test.ts +++ b/packages/aws-rfdk/lib/core/test/mongodb-instance.test.ts @@ -45,7 +45,7 @@ import { X509CertificatePem, } from '../lib'; import { - CWA_ASSET_LINUX, INSTALL_MONGODB_3_6_SCRIPT_LINUX, MONGODB_3_6_CONFIGURATION_SCRIPTS, MOUNT_EBS_SCRIPT_LINUX, + CWA_ASSET_LINUX, INSTALL_MONGODB_8_0_SCRIPT_LINUX, MONGODB_8_0_CONFIGURATION_SCRIPTS, MOUNT_EBS_SCRIPT_LINUX, } from './asset-constants'; import { testConstructTags, @@ -61,7 +61,7 @@ describe('Test MongoDbInstance', () => { const hostname = 'hostname'; const zoneName = 'testZone'; - const version = MongoDbVersion.COMMUNITY_3_6; + const version = MongoDbVersion.COMMUNITY_8_0; const userSsplAcceptance = MongoDbSsplLicenseAcceptance.USER_ACCEPTS_SSPL; beforeEach(() => { @@ -397,20 +397,20 @@ describe('Test MongoDbInstance', () => { 'popd\n' + `rm -f /tmp/${MOUNT_EBS_SCRIPT_LINUX.Key}.zip\n` + // Install MongoDB - `mkdir -p $(dirname '/tmp/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh')\n` + + `mkdir -p $(dirname '/tmp/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh')\n` + 'aws s3 cp \'s3://', { - 'Fn::Sub': INSTALL_MONGODB_3_6_SCRIPT_LINUX.Bucket, + 'Fn::Sub': INSTALL_MONGODB_8_0_SCRIPT_LINUX.Bucket, }, - `/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh' '/tmp/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh'\n` + - `bash /tmp/${INSTALL_MONGODB_3_6_SCRIPT_LINUX.Key}.sh\n` + + `/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh' '/tmp/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh'\n` + + `bash /tmp/${INSTALL_MONGODB_8_0_SCRIPT_LINUX.Key}.sh\n` + // Fetching the MongoDB configuration scripts - `mkdir -p $(dirname '/tmp/${MONGODB_3_6_CONFIGURATION_SCRIPTS.Key}.zip')\n` + + `mkdir -p $(dirname '/tmp/${MONGODB_8_0_CONFIGURATION_SCRIPTS.Key}.zip')\n` + 'aws s3 cp \'s3://', { - 'Fn::Sub': MONGODB_3_6_CONFIGURATION_SCRIPTS.Bucket, + 'Fn::Sub': MONGODB_8_0_CONFIGURATION_SCRIPTS.Bucket, }, - `/${MONGODB_3_6_CONFIGURATION_SCRIPTS.Key}.zip' '/tmp/${MONGODB_3_6_CONFIGURATION_SCRIPTS.Key}.zip'\n` + + `/${MONGODB_8_0_CONFIGURATION_SCRIPTS.Key}.zip' '/tmp/${MONGODB_8_0_CONFIGURATION_SCRIPTS.Key}.zip'\n` + // Configure MongoDB 'which mongod && test -f /etc/mongod.conf\n' + 'sudo service mongod stop\n' + @@ -418,7 +418,7 @@ describe('Test MongoDbInstance', () => { 'mkdir -p "${MONGO_SETUP_DIR}"\n' + 'sudo mount -t tmpfs -o size=50M tmpfs "${MONGO_SETUP_DIR}"\n' + 'pushd "${MONGO_SETUP_DIR}"\n' + - `unzip /tmp/${MONGODB_3_6_CONFIGURATION_SCRIPTS.Key}.zip\n` + + `unzip /tmp/${MONGODB_8_0_CONFIGURATION_SCRIPTS.Key}.zip\n` + 'cp /etc/mongod.conf .\n' + // Getting the server certificate 'bash serverCertFromSecrets.sh \"', diff --git a/packages/aws-rfdk/lib/core/test/mongodb-post-install.test.ts b/packages/aws-rfdk/lib/core/test/mongodb-post-install.test.ts index 7dbe92358..383ae4488 100644 --- a/packages/aws-rfdk/lib/core/test/mongodb-post-install.test.ts +++ b/packages/aws-rfdk/lib/core/test/mongodb-post-install.test.ts @@ -47,7 +47,7 @@ describe('MongoDbPostInstall', () => { beforeEach(() => { const hostname = 'mongodb'; const zoneName = 'testZone.internal'; - const version = MongoDbVersion.COMMUNITY_3_6; + const version = MongoDbVersion.COMMUNITY_8_0; const userSsplAcceptance = MongoDbSsplLicenseAcceptance.USER_ACCEPTS_SSPL; stack = new Stack(); diff --git a/packages/aws-rfdk/lib/deadline/lib/database-connection.ts b/packages/aws-rfdk/lib/deadline/lib/database-connection.ts index 9c61e904f..199d23502 100644 --- a/packages/aws-rfdk/lib/deadline/lib/database-connection.ts +++ b/packages/aws-rfdk/lib/deadline/lib/database-connection.ts @@ -46,7 +46,7 @@ export interface DocDBConnectionOptions { /** * The Document DB Cluster this connection is for. - * Note: Deadline officially supports only databases that are compatible with MongoDB 3.6, 4.0, 5.0. + * Note: Deadline officially supports only databases that are compatible with MongoDB 5.0 and greater. */ readonly database: IDatabaseCluster; @@ -63,7 +63,7 @@ export interface DocDBConnectionOptions { export interface MongoDbInstanceConnectionOptions { /** * The MongoDB database to connect to. - * Note: Deadline officially supports only databases that are compatible with MongoDB 3.6, 4.0, 5.0. + * Note: Deadline officially supports only databases that are compatible with MongoDB 5.0 and higher. */ readonly database: IMongoDb; @@ -85,7 +85,7 @@ export interface MongoDbInstanceConnectionOptions { export abstract class DatabaseConnection { /** * Creates a DatabaseConnection which allows Deadline to connect to Amazon DocumentDB. - * Note: Deadline officially supports only databases that are compatible with MongoDB 3.6, 4.0, 5.0. + * Note: Deadline officially supports only databases that are compatible with MongoDB 5.0 and higher. * * Resources Deployed * ------------------------ @@ -97,7 +97,7 @@ export abstract class DatabaseConnection { /** * Creates a DatabaseConnection which allows Deadline to connect to MongoDB. - * Note: Deadline officially supports only databases that are compatible with MongoDB 3.6, 4.0, 5.0. + * Note: Deadline officially supports only databases that are compatible with MongoDB 5.0 and higher. * * Resources Deployed * ------------------------ @@ -326,7 +326,7 @@ class DocDBDatabaseConnection extends DatabaseConnection { } /** - * Deadline is compatible with MongoDB 3.6, 4.0 and 5.0. This function attempts to determine whether + * Deadline is compatible with MongoDB 5.0 and greater. This function attempts to determine whether * the given DocDB version is compatible. */ protected isCompatibleDocDBVersion(): boolean { diff --git a/packages/aws-rfdk/lib/deadline/lib/repository.ts b/packages/aws-rfdk/lib/deadline/lib/repository.ts index 14337a99f..b7ba4ed85 100644 --- a/packages/aws-rfdk/lib/deadline/lib/repository.ts +++ b/packages/aws-rfdk/lib/deadline/lib/repository.ts @@ -372,7 +372,7 @@ export interface RepositoryProps { /** * Specify the database where the deadline schema needs to be initialized. - * Note that Deadline supports only databases that are compatible with MongoDB 3.6. + * Note that Deadline supports only databases that are compatible with MongoDB 5.0 and greater. * * @default A Document DB Cluster will be created with a single db.r5.large instance. */ diff --git a/packages/aws-rfdk/lib/deadline/test/database-connection.test.ts b/packages/aws-rfdk/lib/deadline/test/database-connection.test.ts index 42af84ef6..84c602b2f 100644 --- a/packages/aws-rfdk/lib/deadline/test/database-connection.test.ts +++ b/packages/aws-rfdk/lib/deadline/test/database-connection.test.ts @@ -90,7 +90,7 @@ describe('DocumentDB', () => { backup: { retention: Duration.days(15), }, - engineVersion: '3.6.0', + engineVersion: '5.0.0', }); if (!database.secret) { @@ -371,7 +371,7 @@ describe('DocumentDB Version Checks', () => { backup: { retention: Duration.days(15), }, - engineVersion: '3.6.0', + engineVersion: '5.0.0', }); // WHEN @@ -480,7 +480,7 @@ describe('MongoDB', () => { vpc, mongoDb: { userSsplAcceptance: MongoDbSsplLicenseAcceptance.USER_ACCEPTS_SSPL, - version: MongoDbVersion.COMMUNITY_3_6, + version: MongoDbVersion.COMMUNITY_8_0, hostname, dnsZone, serverCertificate: serverCert, @@ -692,7 +692,7 @@ describe('MongoDB', () => { vpc, mongoDb: { userSsplAcceptance: MongoDbSsplLicenseAcceptance.USER_ACCEPTS_SSPL, - version: MongoDbVersion.COMMUNITY_3_6, + version: MongoDbVersion.COMMUNITY_8_0, hostname: 'mongo', dnsZone, serverCertificate: serverCert, diff --git a/packages/aws-rfdk/lib/lambdas/nodejs/mongodb/handler.ts b/packages/aws-rfdk/lib/lambdas/nodejs/mongodb/handler.ts index bf680d224..0c6db29eb 100644 --- a/packages/aws-rfdk/lib/lambdas/nodejs/mongodb/handler.ts +++ b/packages/aws-rfdk/lib/lambdas/nodejs/mongodb/handler.ts @@ -95,7 +95,8 @@ export class MongoDbConfigure extends SimpleCustomResource { protected installMongoDbDriver(): any { console.log('Installing latest MongoDB Driver for NodeJS from npmjs.org'); // Both HOME and --prefix are needed here because /tmp is the only writable location - execSync('HOME=/tmp npm install mongodb@3 --production --no-package-lock --no-save --prefix /tmp'); + // Note: driver version compatibility can be found here https://www.mongodb.com/docs/drivers/node/current/compatibility/ + execSync('HOME=/tmp npm install mongodb@6 --production --no-package-lock --no-save --prefix /tmp'); // eslint-disable-next-line @typescript-eslint/no-require-imports return require('/tmp/node_modules/mongodb'); } @@ -122,7 +123,7 @@ export class MongoDbConfigure extends SimpleCustomResource { tlsInsecure: false, // Require server identity validation tlsCAFile: '/tmp/ca.crt', auth: { - user: credentials.username, + username: credentials.username, password: credentials.password, }, useUnifiedTopology: true, // We error on connect if not passing this. diff --git a/packages/aws-rfdk/lib/lambdas/nodejs/mongodb/test/handler.test.ts b/packages/aws-rfdk/lib/lambdas/nodejs/mongodb/test/handler.test.ts index 5a586e848..26aa71e51 100644 --- a/packages/aws-rfdk/lib/lambdas/nodejs/mongodb/test/handler.test.ts +++ b/packages/aws-rfdk/lib/lambdas/nodejs/mongodb/test/handler.test.ts @@ -169,7 +169,7 @@ describe('mongoLogin', () => { tlsInsecure: false, tlsCAFile: '/tmp/ca.crt', auth: { - user: 'test', + username: 'test', password: 'pass', }, useUnifiedTopology: true,