Skip to content

Commit b49da34

Browse files
authored
RDS: Add support for create DBInstanceReadReplica (#92)
Fixes aws-controllers-k8s/community#893 **Description of changes:** It's from a old pr. #84 This pr is adding ability to allow create DBInstanceReadReplica, api call: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstanceReadReplica.html Some small bug fix: 1. copy over newCreateDBInstanceReadReplicaInput instead asking template generate it, so we can set `PerformanceInsightsEnabled` directly instead of using `EnablePerformanceInsights` 2. add extra nil check here https://github.com/aws-controllers-k8s/rds-controller/blob/d72e06ba7e1fc24eed5f02a36b367fc4c4bf9354/pkg/resource/db_instance/hooks.go#L207 3. update status to spec for cluster's allocated storage . https://github.com/aws-controllers-k8s/rds-controller/blob/d72e06ba7e1fc24eed5f02a36b367fc4c4bf9354/pkg/resource/db_cluster/custom_update.go#L108 **Testing part:** Tested with successful creation of - same region + encrypted source instance - same region + unencrypted source instance - cross region + encrypted source instance - cross region + unencrypted source instance **Notes:** I don't have e2e test for this case yet which is because I'm blocked on this issue. aws-controllers-k8s/community#1325 Will add e2e tests after 1325 issue is resolved. Also this pr has a dependency pr: aws-controllers-k8s/code-generator#339 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent d72e06b commit b49da34

File tree

14 files changed

+1311
-55
lines changed

14 files changed

+1311
-55
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2022-06-20T19:21:08Z"
2+
build_date: "2022-06-21T21:15:15Z"
33
build_hash: a45f3b900849ec03c5e16ed2778c0b8e2923ffee
44
go_version: go1.18.2
55
version: v0.19.1
6-
api_directory_checksum: 7567208aa7463aaa3c937e45107f520e6fc2946f
6+
api_directory_checksum: 891cddd4b051d5b865abddeb1a19760b9fbdcd37
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.27
99
generator_config_info:
10-
file_checksum: c9c7e5d1decf6b529a8b451570ccc4fdfe1e6f79
10+
file_checksum: 25009e8400a5efd62efed790fd4b5015466a2dc9
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/db_cluster.go

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

apis/v1alpha1/db_instance.go

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

apis/v1alpha1/generator.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ resources:
175175
resource: Key
176176
service_name: kms
177177
path: Status.ACKResourceMetadata.ARN
178+
# Used by restore db instance from db snapshot
178179
DBSnapshotIdentifier:
179180
from:
180181
operation: RestoreDBInstanceFromDBSnapshot
@@ -183,6 +184,27 @@ resources:
183184
from:
184185
operation: RestoreDBInstanceFromDBSnapshot
185186
path: UseDefaultProcessorFeatures
187+
# Used by create db instance read replica
188+
SourceDBInstanceIdentifier:
189+
from:
190+
operation: CreateDBInstanceReadReplica
191+
path: SourceDBInstanceIdentifier
192+
DestinationRegion:
193+
from:
194+
operation: CreateDBInstanceReadReplica
195+
path: DestinationRegion
196+
ReplicaMode:
197+
from:
198+
operation: CreateDBInstanceReadReplica
199+
path: ReplicaMode
200+
SourceRegion:
201+
from:
202+
operation: CreateDBInstanceReadReplica
203+
path: SourceRegion
204+
PreSignedURL:
205+
from:
206+
operation: CreateDBInstanceReadReplica
207+
path: PreSignedUrl
186208
renames:
187209
operations:
188210
CreateDBInstance:

apis/v1alpha1/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)