constructor()

in src/constructs/rds/instance.ts [35:51]


  constructor(scope: GuStack, id: string, props: GuDatabaseInstanceProps) {
    // CDK just wants "t3.micro" format, whereas
    // some CFN yaml might have the older "db.t3.micro" with the "db." prefix
    // This logic ensures the "db." prefix is removed before applying the CFN
    const instanceType = new InstanceType(Fn.join("", Fn.split("db.", props.instanceType)));

    super(scope, id, {
      storageType: StorageType.GP3,
      deletionProtection: true,
      deleteAutomatedBackups: false,
      backupRetention: props.devXBackups.enabled ? undefined : props.devXBackups.backupRetention,
      preferredBackupWindow: props.devXBackups.enabled ? undefined : props.devXBackups.preferredBackupWindow,
      ...props,
      instanceType,
    });
    Tags.of(this).add("devx-backup-enabled", String(props.devXBackups.enabled));
  }