Skip to content

Commit e424d16

Browse files
authored
Merge pull request #2289 from crossplane-contrib/backport-2288-to-release-0.57
[Backport release-0.57] feat(dbcluster.rds): add pit restore from cluster resource id
2 parents d7a272d + c5f91ff commit e424d16

4 files changed

Lines changed: 25 additions & 3 deletions

File tree

apis/rds/v1alpha1/custom_types.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ type PointInTimeRestoreDBClusterBackupConfiguration struct {
438438
// +optional
439439
UseLatestRestorableTime bool `json:"useLatestRestorableTime"`
440440

441+
// Deprecated: Use SourceDBClusterResourceID instead. This field never had any effect.
441442
// SourceDBInstanceAutomatedBackupsArn specifies the Amazon Resource Name (ARN) of the replicated automated backups
442443
// from which to restore. Example: arn:aws:rds:useast-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE
443444
// +optional
@@ -448,7 +449,13 @@ type PointInTimeRestoreDBClusterBackupConfiguration struct {
448449
// +optional
449450
SourceDBClusterIdentifier *string `json:"sourceDBClusterIdentifier,omitempty"`
450451

451-
// SourceDbiResourceID specifies the resource ID of the source DB instance from which to restore.
452+
// The resource ID of the source DB cluster from which to restore.
453+
// e.g. "cluster-EXAMPLE1234567890"
454+
// +optional
455+
SourceDBClusterResourceID *string `json:"sourceDBClusterResourceId,omitempty"`
456+
457+
// Deprecated: Use SourceDBClusterResourceID instead. This field never had any effect.
458+
// The resource ID of the source DB instance from which to restore.
452459
// +optional
453460
SourceDbiResourceID *string `json:"sourceDbiResourceId,omitempty"`
454461

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: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,14 +1187,21 @@ spec:
11871187
SourceDBClusterIdentifier specifies the identifier of the source DB cluster from which to restore. Constraints:
11881188
Must match the identifier of an existing DB instance.
11891189
type: string
1190+
sourceDBClusterResourceId:
1191+
description: |-
1192+
The resource ID of the source DB cluster from which to restore.
1193+
e.g. "cluster-EXAMPLE1234567890"
1194+
type: string
11901195
sourceDBInstanceAutomatedBackupsArn:
11911196
description: |-
1197+
Deprecated: Use SourceDBClusterResourceID instead. This field never had any effect.
11921198
SourceDBInstanceAutomatedBackupsArn specifies the Amazon Resource Name (ARN) of the replicated automated backups
11931199
from which to restore. Example: arn:aws:rds:useast-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE
11941200
type: string
11951201
sourceDbiResourceId:
1196-
description: SourceDbiResourceID specifies the resource
1197-
ID of the source DB instance from which to restore.
1202+
description: |-
1203+
Deprecated: Use SourceDBClusterResourceID instead. This field never had any effect.
1204+
The resource ID of the source DB instance from which to restore.
11981205
type: string
11991206
useLatestRestorableTime:
12001207
description: |-

pkg/controller/rds/dbcluster/setup.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,9 @@ func generateRestoreDBClusterToPointInTimeInput(cr *svcapitypes.DBCluster) *svcs
508508
if p.RestoreFrom.PointInTime != nil && p.RestoreFrom.PointInTime.SourceDBClusterIdentifier != nil {
509509
res.SourceDBClusterIdentifier = p.RestoreFrom.PointInTime.SourceDBClusterIdentifier
510510
}
511+
if p.RestoreFrom.PointInTime != nil && p.RestoreFrom.PointInTime.SourceDBClusterResourceID != nil {
512+
res.SourceDbClusterResourceId = p.RestoreFrom.PointInTime.SourceDBClusterResourceID
513+
}
511514
if cr.Spec.ForProvider.Tags != nil {
512515
var tags []*svcsdk.Tag
513516
for _, tag := range cr.Spec.ForProvider.Tags {

0 commit comments

Comments
 (0)