From 82a653bd5e88eea7039d10721f8c7362e1893f4f Mon Sep 17 00:00:00 2001 From: Angelika Schneider Date: Tue, 25 Jul 2023 13:49:39 +0200 Subject: [PATCH] update resource naming --- src/lib/util.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/util.ts b/src/lib/util.ts index 58b2c6b..b5f4753 100644 --- a/src/lib/util.ts +++ b/src/lib/util.ts @@ -9,8 +9,13 @@ export function trim(s: string, maxLength = 200): string { } export function short(resourceID: string) { - // Split resource by / and take the last index - const rr = resourceID.split('/'); + // For Azure split resource by / and take the last index + var rr = resourceID.split('/'); + + // For AWS split resources by : and take the last index + if (rr.length <= 1) { + rr = resourceID.split(':'); + } return rr[rr.length - 1]; }