From 38f104834b96be1e38711c02ea0e94c4449cb381 Mon Sep 17 00:00:00 2001 From: Moataz Mohamed Date: Tue, 10 Oct 2023 16:18:33 +0100 Subject: [PATCH] [DBInstance] Use DBParameterGroup in CreateReadReplica for MySql engine --- .../amazon/rds/dbinstance/CreateHandler.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aws-rds-dbinstance/src/main/java/software/amazon/rds/dbinstance/CreateHandler.java b/aws-rds-dbinstance/src/main/java/software/amazon/rds/dbinstance/CreateHandler.java index 6b8076316..2b892c18c 100644 --- a/aws-rds-dbinstance/src/main/java/software/amazon/rds/dbinstance/CreateHandler.java +++ b/aws-rds-dbinstance/src/main/java/software/amazon/rds/dbinstance/CreateHandler.java @@ -217,27 +217,27 @@ private String fetchEngine(final ProxyClient 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 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 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(); } }