Skip to content

Commit

Permalink
[DBInstance] Add AllowMajorUpgrade on ModifyAfterCreate (#488)
Browse files Browse the repository at this point in the history
Co-authored-by: dbbh <[email protected]>
  • Loading branch information
dbbh and dbbh authored Jan 2, 2024
1 parent 199b7b8 commit 59fabfb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion aws-rds-dbinstance/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@
<version>1.18.22</version>
<scope>provided</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/software.amazon.awssdk/aws-query-protocol -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-query-protocol</artifactId>
<version>2.20.138</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.assertj/assertj-core -->
<dependency>
<groupId>org.assertj</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,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 59fabfb

Please sign in to comment.