Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database.rdsinstance: add DBSubnetParameterGroupName to late init #576

Merged
merged 1 commit into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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