Skip to content

Commit

Permalink
Merge pull request #576 from muvaf/fix-rds-upt
Browse files Browse the repository at this point in the history
database.rdsinstance: add DBSubnetParameterGroupName to late init
  • Loading branch information
muvaf committed Mar 5, 2021
2 parents c7c185f + 8aa68a2 commit 87cee93
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 1 addition & 2 deletions examples/database/rdsinstance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: example-rds
spec:
forProvider:
region: us-east-1
allocatedStorage: 20
autoMinorVersionUpgrade: true
backupRetentionPeriod: 0
Expand All @@ -20,8 +21,6 @@ spec:
masterUsername: admin
multiAZ: true
port: 3306
preferredBackupWindow: 06:15-06:45
preferredMaintenanceWindow: sat:09:21-sat:09:51
publiclyAccessible: false
storageEncrypted: false
storageType: gp2
Expand Down
8 changes: 8 additions & 0 deletions pkg/clients/rds/rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,14 @@ func LateInitialize(in *v1beta1.RDSInstanceParameters, db *rds.DBInstance) { //
if strings.HasPrefix(aws.StringValue(db.EngineVersion), aws.StringValue(in.EngineVersion)) {
in.EngineVersion = db.EngineVersion
}
if in.DBParameterGroupName == nil {
for i := range db.DBParameterGroups {
if db.DBParameterGroups[i].DBParameterGroupName != nil {
in.DBParameterGroupName = db.DBParameterGroups[i].DBParameterGroupName
break
}
}
}
}

// IsUpToDate checks whether there is a change in any of the modifiable fields.
Expand Down

0 comments on commit 87cee93

Please sign in to comment.