Skip to content

Commit

Permalink
[DBInstance] Add AllowMajorUpgrade on ModifyAfterCreate
Browse files Browse the repository at this point in the history
  • Loading branch information
dbbh committed Dec 1, 2023
1 parent 2a740f7 commit 9d45d71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ public static ModifyDbInstanceRequest modifyDbInstanceAfterCreateRequestV12(fina

public static ModifyDbInstanceRequest modifyDbInstanceAfterCreateRequest(final ResourceModel model) {
final ModifyDbInstanceRequest.Builder builder = ModifyDbInstanceRequest.builder()
.allowMajorVersionUpgrade(model.getAllowMajorVersionUpgrade())
.applyImmediately(Boolean.TRUE)
.backupRetentionPeriod(model.getBackupRetentionPeriod())
.caCertificateIdentifier(model.getCACertificateIdentifier())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,17 @@ public void test_translateManageMasterUserPassword_fromUnsetToSet_withSpecificKe
assertThat(request.masterUserSecretKmsKeyId()).isEqualTo("myKey");
}

@Test
public void test_createDbInstanceRequest_AllowMajorVersionUpgrade() {
ResourceModel model = ResourceModel.builder()
.allowMajorVersionUpgrade(true)
.build();
final ModifyDbInstanceRequest modifyAfterCreateRequest = Translator.modifyDbInstanceAfterCreateRequest(
model
);
assertThat(modifyAfterCreateRequest.allowMajorVersionUpgrade()).isTrue();
}

@Test
public void test_createDbInstanceRequest_SetPerformanceInsightsKMSKeyIdIfEnabled() {
final String kmsKeyId = "test-kms-key-id";
Expand Down

0 comments on commit 9d45d71

Please sign in to comment.