Skip to content

Commit

Permalink
fix(elasticache): update console URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
echeung-amzn committed May 30, 2024
1 parent d1fda6f commit a45f286
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/common/url/AwsConsoleUrlFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ export class AwsConsoleUrlFactory {
const region = this.awsAccountRegion;
switch (clusterType) {
case ElastiCacheClusterType.MEMCACHED:
const destinationUrlMemcached = `https://${region}.console.aws.amazon.com/elasticache/home?region=${region}#memcached-nodes:id=${clusterId};nodes`;
const destinationUrlMemcached = `https://${region}.console.aws.amazon.com/elasticache/home?region=${region}#/memcached/${clusterId}`;
return this.getAwsConsoleUrl(destinationUrlMemcached);
case ElastiCacheClusterType.REDIS:
const destinationUrlRedis = `https://${region}.console.aws.amazon.com/elasticache/home?region=${region}#redis-shards:redis-id=${clusterId}`;
const destinationUrlRedis = `https://${region}.console.aws.amazon.com/elasticache/home?region=${region}#/redis/${clusterId}`;
return this.getAwsConsoleUrl(destinationUrlRedis);
default:
throw new Error(`Invalid cache type: ${clusterType}`);
Expand Down
4 changes: 2 additions & 2 deletions test/common/url/AwsConsoleUrlFactory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ test("getElastiCacheClusterUrl (memcached)", () => {
const factory = new AwsConsoleUrlFactory({ awsAccountId, awsAccountRegion });

const expected =
"https://eu-west-1.console.aws.amazon.com/elasticache/home?region=eu-west-1#memcached-nodes:id=DummyDomainName;nodes";
"https://eu-west-1.console.aws.amazon.com/elasticache/home?region=eu-west-1#/memcached/DummyDomainName";

expect(
stack.resolve(
Expand All @@ -303,7 +303,7 @@ test("getElastiCacheClusterUrl (redis)", () => {
const factory = new AwsConsoleUrlFactory({ awsAccountId, awsAccountRegion });

const expected =
"https://eu-west-1.console.aws.amazon.com/elasticache/home?region=eu-west-1#redis-shards:redis-id=DummyDomainName";
"https://eu-west-1.console.aws.amazon.com/elasticache/home?region=eu-west-1#/redis/DummyDomainName";

expect(
stack.resolve(
Expand Down

0 comments on commit a45f286

Please sign in to comment.