Skip to content

Commit d64a4d3

Browse files
fix: backups were always enabled in L3 construct "AtlasEncryptionAtRestExpress" (#169)
1 parent 847ff99 commit d64a4d3

File tree

2 files changed

+4
-1
lines changed
  • src/l3-resources/encryption-at-rest-express
  • test/l3-resources/encryption-at-rest-express

2 files changed

+4
-1
lines changed

src/l3-resources/encryption-at-rest-express/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function getClusterProps(
5454
inputClusterProps.name || "atlas-cluster-".concat(String(randomNumber())),
5555
mongoDbMajorVersion:
5656
inputClusterProps.mongoDbMajorVersion || MONGODB_VERSION,
57-
backupEnabled: inputClusterProps.backupEnabled || BACKUP_ENABLED,
57+
backupEnabled: inputClusterProps.backupEnabled ?? BACKUP_ENABLED,
5858
diskSizeGb: inputClusterProps.diskSizeGb,
5959
clusterType: inputClusterProps.clusterType || CLUSTER_TYPE,
6060
biConnector: inputClusterProps.biConnector,

test/l3-resources/encryption-at-rest-express/index.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import * as l3 from "../../../src";
1818

1919
const PROJECT_ID = "PROJ_ID";
2020
const PROJECT_NAME = "TEST";
21+
const BACKUP_ENABLED = false;
2122
const ROLE_ID = "ROLE_ID";
2223
const CUSTOMER_MASTER_KEY = "MASTER_KEY";
2324
const DATABASE_NAME = "DATABASE_NAME";
@@ -41,6 +42,7 @@ test("Encryption at rest express construct should contain default properties", (
4142
new l3.AtlasEncryptionAtRestExpress(stack, "testing-stack", {
4243
cluster: {
4344
name: PROJECT_NAME,
45+
backupEnabled: BACKUP_ENABLED,
4446
},
4547

4648
accessList: {
@@ -70,6 +72,7 @@ test("Encryption at rest express construct should contain default properties", (
7072
template.hasResourceProperties(RESOURCE_NAME_CLUSTER, {
7173
ClusterType: "REPLICASET",
7274
Name: PROJECT_NAME,
75+
BackupEnabled: BACKUP_ENABLED,
7376
ReplicationSpecs: [
7477
{
7578
NumShards: 1,

0 commit comments

Comments
 (0)