Skip to content

Commit

Permalink
Merge pull request #11 from aws-samples/app/upgrade/nodejs
Browse files Browse the repository at this point in the history
Fix SDK Javascript V3 for ElastiCache Serverless
  • Loading branch information
snmatus authored Jan 31, 2024
2 parents eb6b248 + d59e115 commit eb84fdf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
37 changes: 22 additions & 15 deletions frontend/src/pages/Sm-clustersElasticache-01.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,21 +345,28 @@ function Login() {
else
authMode = "modeNonAuth";

rdsItems.push({
identifier : item['ServerlessCacheName'],
status : item['Status'] ,
size : (parseFloat(item['CacheUsageLimits']['ECPUPerSecond']['Maximum'])).toLocaleString('en-US', {minimumFractionDigits:0, maximumFractionDigits:0}) + " (ECPUs)",
engine : "elasticache:redis-serverless" ,
shards : "-",
nodes: "-",
mode: "-",
endpoint: item['Endpoint']['Address'],
port : item['Endpoint']['Port'],
multiaz : "true",
ssl : "required",
auth : authMode,
authmode : authMode,
});
if ( item['Engine'] == "redis") {
rdsItems.push({
identifier : item['ServerlessCacheName'],
status : item['Status'] ,
size : (
( parseFloat(item['CacheUsageLimits']?.['ECPUPerSecond']?.['Maximum']) || 0 ) > 0 ?
( parseFloat(item['CacheUsageLimits']?.['ECPUPerSecond']?.['Maximum']) || 0 ).toLocaleString('en-US', {minimumFractionDigits:0, maximumFractionDigits:0}) + " (ECPUs)"
:
""
),
engine : "elasticache:" + item['Engine'] + "-serverless" ,
shards : "-",
nodes: "-",
mode: "-",
endpoint: item['Endpoint']['Address'],
port : item['Endpoint']['Port'],
multiaz : "true",
ssl : "required",
auth : authMode,
authmode : authMode,
});
}


}
Expand Down
4 changes: 2 additions & 2 deletions server/class.aws.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { RDSClient, DescribeDBClustersCommand, DescribeDBInstancesCommand } = req
const { DocDBClient, /*DescribeDBClustersCommand*/ } = require("@aws-sdk/client-docdb");
const { CloudWatchClient, GetMetricDataCommand } = require("@aws-sdk/client-cloudwatch");
const { CloudWatchLogsClient, GetLogEventsCommand } = require("@aws-sdk/client-cloudwatch-logs");
const { DocDBElasticClient, GetClusterCommand } = require("@aws-sdk/client-docdb-elastic");
const { DocDBElasticClient, GetClusterCommand, ListClustersCommand } = require("@aws-sdk/client-docdb-elastic");
const { DynamoDBClient, DescribeTableCommand, ListTablesCommand } = require("@aws-sdk/client-dynamodb");
const { STSClient, GetCallerIdentityCommand } = require("@aws-sdk/client-sts");

Expand Down Expand Up @@ -1446,7 +1446,7 @@ class classAWS {

try {

const command = new GetClusterCommand(parameter);
const command = new ListClustersCommand(parameter);
const data = await docdbelastic.send(command);
return data;

Expand Down

0 comments on commit eb84fdf

Please sign in to comment.