Skip to content

Commit fd3e357

Browse files
authored
Merge pull request crossplane-contrib#2263 from wotolom/rds-dbcluster-add-DeleteAutomatedBackups-parameter
feat(rds/dbcluster): add missing toggle deleteAutomatedBackups
2 parents 2bd3cf0 + 61c0e64 commit fd3e357

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

apis/rds/v1alpha1/custom_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,14 @@ type CustomDBClusterParameters struct {
355355
// RestoreFrom specifies the details of the backup to restore when creating a new DBCluster.
356356
// +optional
357357
RestoreFrom *RestoreDBClusterBackupConfiguration `json:"restoreFrom,omitempty"`
358+
359+
// DeleteAutomatedBackups indicates whether to remove automated backups
360+
// immediately after the DB cluster is deleted. The default is to
361+
// remove automated backups immediately after the DB cluster is
362+
// deleted, unless the Amazon Web Services Backup policy specifies
363+
// a point-in-time restore rule.
364+
// +optional
365+
DeleteAutomatedBackups *bool `json:"deleteAutomatedBackups,omitempty"`
358366
}
359367

360368
// CustomDBClusterObservation includes the custom status fields of DBCluster.

apis/rds/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package/crds/rds.aws.crossplane.io_dbclusters.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,14 @@ spec:
394394
dbSystemID:
395395
description: Reserved for future use.
396396
type: string
397+
deleteAutomatedBackups:
398+
description: |-
399+
DeleteAutomatedBackups indicates whether to remove automated backups
400+
immediately after the DB cluster is deleted. The default is to
401+
remove automated backups immediately after the DB cluster is
402+
deleted, unless the Amazon Web Services Backup policy specifies
403+
a point-in-time restore rule.
404+
type: boolean
397405
deletionProtection:
398406
description: |-
399407
Specifies whether the DB cluster has deletion protection enabled. The database

pkg/controller/rds/dbcluster/setup.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,7 @@ func (e *custom) postUpdate(ctx context.Context, cr *svcapitypes.DBCluster, obj
868868
func preDelete(_ context.Context, cr *svcapitypes.DBCluster, obj *svcsdk.DeleteDBClusterInput) (bool, error) {
869869
obj.DBClusterIdentifier = pointer.ToOrNilIfZeroValue(meta.GetExternalName(cr))
870870
obj.SkipFinalSnapshot = pointer.ToOrNilIfZeroValue(cr.Spec.ForProvider.SkipFinalSnapshot)
871+
obj.DeleteAutomatedBackups = cr.Spec.ForProvider.DeleteAutomatedBackups
871872

872873
if !cr.Spec.ForProvider.SkipFinalSnapshot {
873874
obj.FinalDBSnapshotIdentifier = pointer.ToOrNilIfZeroValue(cr.Spec.ForProvider.FinalDBSnapshotIdentifier)

0 commit comments

Comments
 (0)