Skip to content

Commit

Permalink
Merge pull request #664 from perfectsense/bugfix/master-user-secret-k…
Browse files Browse the repository at this point in the history
…ms-key-throws-null-pointer

Add null pointer checks for improved error handling
  • Loading branch information
harjain99 authored Oct 1, 2024
2 parents 4a75c38 + 8e17ceb commit 5187cab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* .. code-block:: gyro
*
* cluster-parameter-groups: $(external-query aws::db-cluster-parameter-group { name: 'cluster-parameter-group-example'})
* db-cluster-parameter-group: $(external-query aws::db-cluster-parameter-group { name: 'cluster-parameter-group-example'})
*/
@Type("db-cluster-parameter-group")
public class DbClusterParameterGroupFinder extends AwsFinder<RdsClient, DBClusterParameterGroup, DbClusterParameterGroupResource> {
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/gyro/aws/rds/DbClusterResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,8 @@ protected void doCreate(GyroUI ui, State state) {
.map(SecurityGroupResource::getId)
.collect(Collectors.toList()) : null)
.manageMasterUserPassword(getManageMasterUserPassword())
.masterUserSecretKmsKeyId(getMasterUserSecretKmsKey().getId())
.masterUserSecretKmsKeyId(
getMasterUserSecretKmsKey() == null ? null : getMasterUserSecretKmsKey().getId())
.serverlessV2ScalingConfiguration(getServerlessV2ScalingConfiguration() != null ?
getServerlessV2ScalingConfiguration().toServerlessV2ScalingConfiguration() : null)
.storageType(getStorageType())
Expand Down Expand Up @@ -967,7 +968,8 @@ protected void doCreate(GyroUI ui, State state) {
.dbClusterInstanceClass(getDbClusterInstanceClass())
.iops(getIops())
.manageMasterUserPassword(getManageMasterUserPassword())
.masterUserSecretKmsKeyId(getMasterUserSecretKmsKey().getId())
.masterUserSecretKmsKeyId(
getMasterUserSecretKmsKey() == null ? null : getMasterUserSecretKmsKey().getId())
.serverlessV2ScalingConfiguration(getServerlessV2ScalingConfiguration() != null ?
getServerlessV2ScalingConfiguration().toServerlessV2ScalingConfiguration() : null)
.storageType(getStorageType())
Expand Down Expand Up @@ -1063,7 +1065,8 @@ protected void doUpdate(Resource config, Set<String> changedProperties) {
.dbClusterInstanceClass(getDbClusterInstanceClass())
.iops(getIops())
.manageMasterUserPassword(getManageMasterUserPassword())
.masterUserSecretKmsKeyId(getMasterUserSecretKmsKey().getId())
.masterUserSecretKmsKeyId(
getMasterUserSecretKmsKey() == null ? null : getMasterUserSecretKmsKey().getId())
.serverlessV2ScalingConfiguration(getServerlessV2ScalingConfiguration() != null ?
getServerlessV2ScalingConfiguration().toServerlessV2ScalingConfiguration() : null)
.storageType(getStorageType())
Expand Down

0 comments on commit 5187cab

Please sign in to comment.