Skip to content

Commit

Permalink
feat(DocDB): implement restore functionality for docdb
Browse files Browse the repository at this point in the history
Signed-off-by: safboukhari <safae.boukhari@bluestone-tec.com>
(external expert on behalf of DB Netz AG)
  • Loading branch information
safboukhari committed May 25, 2023
1 parent f32b9ed commit 1a14efd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 36 deletions.
19 changes: 5 additions & 14 deletions apis/docdb/v1alpha1/custom_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,26 +176,17 @@ type PointInTimeRestoreDBClusterBackupConfiguration struct {
// Can't be specified if the useLatestRestorableTime parameter is enabled.
// Example: 2011-09-07T23:45:00Z
// +optional
RestoreTime *metav1.Time `json:"restoreTime"`
RestoreTime *metav1.Time `json:"restoreTime,omitempty"`

// UseLatestRestorableTime indicates that the DB instance is restored from the latest backup
// Can't be specified if the restoreTime parameter is provided.
// +optional
UseLatestRestorableTime bool `json:"useLatestRestorableTime"`

// SourceDBInstanceAutomatedBackupsArn specifies the Amazon Resource Name (ARN) of the replicated automated backups
// from which to restore. Example: arn:aws:rds:useast-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE
// +optional
SourceDBInstanceAutomatedBackupsArn *string `json:"sourceDBInstanceAutomatedBackupsArn"`
UseLatestRestorableTime *bool `json:"useLatestRestorableTime,omitempty"`

// SourceDBClusterIdentifier specifies the identifier of the source DB cluster from which to restore. Constraints:
// Must match the identifier of an existing DB instance.
// +optional
SourceDBClusterIdentifier *string `json:"sourceDBClusterIdentifier"`

// SourceDbiResourceID specifies the resource ID of the source DB instance from which to restore.
// +optional
SourceDbiResourceID *string `json:"sourceDbiResourceId"`
SourceDBClusterIdentifier *string `json:"sourceDBClusterIdentifier,omitempty"`

// The type of restore to be performed. You can specify one of the following
// values:
Expand All @@ -215,7 +206,7 @@ type PointInTimeRestoreDBClusterBackupConfiguration struct {
// Valid for: Aurora DB clusters and Multi-AZ DB clusters
// +optional
// +kubebuilder:validation:Enum=full-copy;copy-on-write
RestoreType *string `json:"restoreType"`
RestoreType *string `json:"restoreType,omitempty"`
}

// RestoreDBClusterBackupConfiguration defines the backup to restore a new DBCluster from.
Expand All @@ -231,7 +222,7 @@ type RestoreDBClusterBackupConfiguration struct {
// Source is the type of the backup to restore when creating a new DBCluster or DBInstance.
// Snapshot and PointInTime are supported.
// +kubebuilder:validation:Enum=Snapshot;PointInTime
Source *string `json:"source"`
Source string `json:"source"`
}

// CustomParameter are custom parameters for the Parameter
Expand Down
16 changes: 3 additions & 13 deletions apis/docdb/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions package/crds/docdb.aws.crossplane.io_dbclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -474,15 +474,6 @@ spec:
Constraints: Must match the identifier of an existing
DB instance.'
type: string
sourceDBInstanceAutomatedBackupsArn:
description: 'SourceDBInstanceAutomatedBackupsArn specifies
the Amazon Resource Name (ARN) of the replicated automated
backups from which to restore. Example: arn:aws:rds:useast-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE'
type: string
sourceDbiResourceId:
description: SourceDbiResourceID specifies the resource
ID of the source DB instance from which to restore.
type: string
useLatestRestorableTime:
description: UseLatestRestorableTime indicates that the
DB instance is restored from the latest backup Can't
Expand Down

0 comments on commit 1a14efd

Please sign in to comment.