Skip to content

Commit

Permalink
[DBInstance] Use DBParameterGroup in CreateReadReplica for MySql engine
Browse files Browse the repository at this point in the history
  • Loading branch information
moataz-mhmd committed Oct 10, 2023
1 parent c336089 commit 38f1048
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,27 +217,27 @@ private String fetchEngine(final ProxyClient<RdsClient> client,

if (ResourceModelHelper.isDBInstanceReadReplica(model)) {
final String sourceDBInstanceArn = model.getSourceDBInstanceIdentifier();
final String sourceDBInstance = ResourceModelHelper.isValidArn(sourceDBInstanceArn) ?
final String sourceDBInstanceIdOrArn = ResourceModelHelper.isValidArn(sourceDBInstanceArn) ?
ResourceModelHelper.getResourceNameFromArn(sourceDBInstanceArn) : sourceDBInstanceArn;
if (ResourceModelHelper.isCrossRegionDBInstanceReadReplica(model, currentRegion)) {
final String sourceRegion = ResourceModelHelper.getRegionFromArn(sourceDBInstanceArn);
final ProxyClient<RdsClient> sourceRegionClient = new LoggingProxyClient<>(logger,
proxy.newProxy(() -> new RdsClientProvider().getClientForRegion(sourceRegion)));
return fetchDBInstance(sourceRegionClient, sourceDBInstance).engine();
return fetchDBInstance(sourceRegionClient, sourceDBInstanceIdOrArn).engine();
} else {
return fetchDBInstance(client, sourceDBInstance ).engine();
return fetchDBInstance(client, sourceDBInstanceIdOrArn ).engine();
}
}
if (ResourceModelHelper.isDBClusterReadReplica(model)) {
final String sourceDBClusterArn = model.getSourceDBClusterIdentifier();
final String sourceDBCluster = ResourceModelHelper.isValidArn(sourceDBClusterArn) ?
final String sourceDBClusterIdOrArn = ResourceModelHelper.isValidArn(sourceDBClusterArn) ?
ResourceModelHelper.getResourceNameFromArn(sourceDBClusterArn) : sourceDBClusterArn;
if (ResourceModelHelper.isCrossRegionDBClusterReadReplica(model, currentRegion)) {
final String sourceRegion = ResourceModelHelper.getRegionFromArn(sourceDBClusterArn);
final ProxyClient<RdsClient> sourceRegionClient = proxy.newProxy(() -> new RdsClientProvider().getClientForRegion(sourceRegion));
return fetchDBCluster(sourceRegionClient, sourceDBCluster).engine();
return fetchDBCluster(sourceRegionClient, sourceDBClusterIdOrArn).engine();
} else {
return fetchDBCluster(client, sourceDBCluster).engine();
return fetchDBCluster(client, sourceDBClusterIdOrArn).engine();
}
}

Expand Down

0 comments on commit 38f1048

Please sign in to comment.