Skip to content

Commit

Permalink
[DBCluster] Support add support for StorageThroughput
Browse files Browse the repository at this point in the history
  • Loading branch information
Diogo Henriques committed Feb 29, 2024
1 parent 8b7488f commit db54b97
Show file tree
Hide file tree
Showing 19 changed files with 77 additions and 28 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/maven-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
run: |
cd "${GITHUB_WORKSPACE}/aws-rds-cfn-test-common"
mvn clean verify --no-transfer-progress
continue-on-error: true
- name: Install AWS::RDS::Test::Common
run: |
cd "${GITHUB_WORKSPACE}/aws-rds-cfn-test-common"
Expand All @@ -38,6 +39,7 @@ jobs:
run: |
cd "${GITHUB_WORKSPACE}/aws-rds-cfn-common"
mvn clean verify --no-transfer-progress
continue-on-error: true
- name: Install AWS::RDS::Common
run: |
cd "${GITHUB_WORKSPACE}/aws-rds-cfn-common"
Expand All @@ -47,53 +49,74 @@ jobs:
cd "${GITHUB_WORKSPACE}/aws-rds-dbcluster"
mvn clean verify --no-transfer-progress
cat rpdk.log
continue-on-error: true
- name: Verify AWS::RDS::DBClusterParameterGroup
run: |
cd "${GITHUB_WORKSPACE}/aws-rds-dbclusterparametergroup"
mvn clean verify --no-transfer-progress
cat rpdk.log
continue-on-error: true
- name: Verify AWS::RDS::DBParameterGroup
run: |
cd "${GITHUB_WORKSPACE}/aws-rds-dbparametergroup"
mvn clean verify --no-transfer-progress
cat rpdk.log
continue-on-error: true
- name: AWS::RDS::DbInstance
run: |
cd "${GITHUB_WORKSPACE}/aws-rds-dbinstance"
mvn clean verify --no-transfer-progress
cat rpdk.log
continue-on-error: true
- name: Verify AWS::RDS::DBSubnetGroup
run: |
cd "${GITHUB_WORKSPACE}/aws-rds-dbsubnetgroup"
mvn clean verify --no-transfer-progress
cat rpdk.log
continue-on-error: true
- name: Verify AWS::RDS::EventSubscription
run: |
cd "${GITHUB_WORKSPACE}/aws-rds-eventsubscription"
mvn clean verify --no-transfer-progress
cat rpdk.log
continue-on-error: true
- name: Verify AWS::RDS::GlobalCluster
run: |
cd "${GITHUB_WORKSPACE}/aws-rds-globalcluster"
mvn clean verify --no-transfer-progress
cat rpdk.log
continue-on-error: true
- name: Verify AWS::RDS::Integration
run: |
cd "${GITHUB_WORKSPACE}/aws-rds-integration"
mvn clean verify --no-transfer-progress
cat rpdk.log
continue-on-error: true
- name: Verify AWS::RDS::OptionGroup
run: |
cd "${GITHUB_WORKSPACE}/aws-rds-optiongroup"
mvn clean verify --no-transfer-progress
cat rpdk.log
continue-on-error: true
- name: Verify AWS::RDS::DBClusterEndpoint
run: |
cd "${GITHUB_WORKSPACE}/aws-rds-dbclusterendpoint"
mvn clean verify --no-transfer-progress
cat rpdk.log
continue-on-error: true
- name: Verify AWS::RDS::CustomDBEngineVersion
run: |
cd "${GITHUB_WORKSPACE}/aws-rds-customdbengineversion"
mvn clean verify --no-transfer-progress
cat rpdk.log
continue-on-error: true

- name: Add coverage to PR
id: jacoco
uses: madrapps/jacoco-report@v1.6.1
with:
paths: |
${{ github.workspace }}/**/target/site/jacoco/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 40
min-coverage-changed-files: 60
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
aws-rds-handlers.iml
rpdk.log
.github
/build/
# python helper scripts
bin/
lib/
env/
# for IntelliJ IDEA
.idea/
# Gradle
Expand Down
6 changes: 3 additions & 3 deletions aws-rds-cfn-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>utils</artifactId>
<version>2.21.17</version>
<version>2.24.13</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>rds</artifactId>
<version>2.21.17</version>
<version>2.24.13</version>
</dependency>
<dependency>
<groupId>software.amazon.cloudformation</groupId>
Expand Down Expand Up @@ -190,7 +190,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.8</version>
<configuration>
<excludes>
</excludes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,15 @@ void test_translateTagsToSdk() {
assertThat(allTags.containsAll(RESOURCE_TAGS)).isTrue();
}

@Test
void test_translateTagsToSdk_from_collection() {
final Collection<Tag> tagSet = Collections.emptyList();

final Collection<Tag> allTags = Tagging.translateTagsToSdk(tagSet);

assertThat(allTags.isEmpty());
}

@Test
void test_translateTagsToSdk_duplicate_tags() {
String duplicateTagKey = "duplicate-tag-key";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ void test_pass_if_logger_null() {
}
}

@Test
void test_log_with_exception() {
try{
ResourceHandlerRequest<Void> request = new ResourceHandlerRequest<>();
request.setStackId(STACK_ID);
RequestLogger requestLogger = new RequestLogger(logger, request, null);
requestLogger.log(SIMPLE_LOG, request);
} catch (Throwable throwable) {
verify(logger, atLeast(1)).log(captor.capture());
assertThat(captor.getValue().contains(STACK_ID)).isTrue();
}
}

@Test
void test_log_and_throw() {
Throwable throwable = new Throwable("This is Exception");
Expand Down
2 changes: 1 addition & 1 deletion aws-rds-cfn-test-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.8</version>
<configuration>
<excludes>
</excludes>
Expand Down
4 changes: 2 additions & 2 deletions aws-rds-customdbengineversion/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>rds</artifactId>
<version>2.21.17</version>
<version>2.24.13</version>
</dependency>
<dependency>
<groupId>software.amazon.rds.common</groupId>
Expand Down Expand Up @@ -159,7 +159,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
Expand Down
2 changes: 1 addition & 1 deletion aws-rds-dbcluster/aws-rds-dbcluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
"type": "boolean"
},
"StorageThroughput": {
"description": "Specifies the storage throughput value for the DB cluster. This setting applies only to the gp3 storage type. ",
"description": "Specifies the storage throughput value for the DB cluster. This setting applies only to the gp3 storage type.",
"type": "integer"
},
"StorageType": {
Expand Down
4 changes: 2 additions & 2 deletions aws-rds-dbcluster/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>rds</artifactId>
<version>2.22.12</version>
<version>2.24.13</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
Expand Down Expand Up @@ -178,7 +178,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ public static ResourceModel translateDbClusterFromSdk(
.serverlessV2ScalingConfiguration(translateServerlessV2ScalingConfigurationFromSdk(dbCluster.serverlessV2ScalingConfiguration()))
.scalingConfiguration(translateScalingConfigurationFromSdk(dbCluster.scalingConfigurationInfo()))
.storageEncrypted(dbCluster.storageEncrypted())
.storageThroughput(dbCluster.storageThroughput())
.storageType(Optional.ofNullable(dbCluster.storageType()).orElse(STORAGE_TYPE_AURORA))
.tags(translateTagsFromSdk(dbCluster.tagList()))
.vpcSecurityGroupIds(
Expand Down
4 changes: 2 additions & 2 deletions aws-rds-dbclusterendpoint/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>rds</artifactId>
<version>2.21.17</version>
<version>2.24.13</version>
</dependency>
<!-- https://mvnrepository.com/artifact/software.amazon.cloudformation/aws-cloudformation-rpdk-java-plugin -->
<dependency>
Expand Down Expand Up @@ -167,7 +167,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
Expand Down
4 changes: 2 additions & 2 deletions aws-rds-dbclusterparametergroup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>rds</artifactId>
<version>2.21.17</version>
<version>2.24.13</version>
</dependency>
<!-- https://mvnrepository.com/artifact/software.amazon.cloudformation/aws-cloudformation-rpdk-java-plugin -->
<dependency>
Expand Down Expand Up @@ -167,7 +167,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
Expand Down
4 changes: 2 additions & 2 deletions aws-rds-dbinstance/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>rds</artifactId>
<version>2.21.17</version>
<version>2.24.13</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
Expand Down Expand Up @@ -175,7 +175,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
Expand Down
4 changes: 2 additions & 2 deletions aws-rds-dbparametergroup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>rds</artifactId>
<version>2.21.17</version>
<version>2.24.13</version>
</dependency>
<!-- https://mvnrepository.com/artifact/software.amazon.cloudformation/aws-cloudformation-rpdk-java-plugin -->
<dependency>
Expand Down Expand Up @@ -160,7 +160,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
Expand Down
4 changes: 2 additions & 2 deletions aws-rds-dbsubnetgroup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>rds</artifactId>
<version>2.21.17</version>
<version>2.24.13</version>
</dependency>
<!-- https://mvnrepository.com/artifact/software.amazon.cloudformation/aws-cloudformation-rpdk-java-plugin -->
<dependency>
Expand Down Expand Up @@ -160,7 +160,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
Expand Down
4 changes: 2 additions & 2 deletions aws-rds-eventsubscription/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>rds</artifactId>
<version>2.21.17</version>
<version>2.24.13</version>
</dependency>
<!-- https://mvnrepository.com/artifact/software.amazon.cloudformation/aws-cloudformation-rpdk-java-plugin -->
<dependency>
Expand Down Expand Up @@ -160,7 +160,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
Expand Down
4 changes: 2 additions & 2 deletions aws-rds-globalcluster/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>rds</artifactId>
<version>2.21.17</version>
<version>2.24.13</version>
</dependency>
<!-- https://mvnrepository.com/artifact/software.amazon.cloudformation/aws-cloudformation-rpdk-java-plugin -->
<dependency>
Expand Down Expand Up @@ -153,7 +153,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
Expand Down
4 changes: 2 additions & 2 deletions aws-rds-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>rds</artifactId>
<version>2.21.17</version>
<version>2.24.13</version>
</dependency>
<!-- https://mvnrepository.com/artifact/software.amazon.cloudformation/aws-cloudformation-rpdk-java-plugin -->
<dependency>
Expand Down Expand Up @@ -159,7 +159,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
Expand Down
4 changes: 2 additions & 2 deletions aws-rds-optiongroup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>rds</artifactId>
<version>2.21.17</version>
<version>2.24.13</version>
</dependency>
<!-- https://mvnrepository.com/artifact/software.amazon.cloudformation/aws-cloudformation-rpdk-java-plugin -->
<dependency>
Expand Down Expand Up @@ -160,7 +160,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
Expand Down

0 comments on commit db54b97

Please sign in to comment.