Files
prowler/ui/lib/aws-utils.ts
Andoni Alonso d84099e87a feat(aws): add external resource link to AWS Console (#9172)
Co-authored-by: Hugo P.Brito <hugopbrit@gmail.com>
Co-authored-by: Hugo Pereira Brito <101209179+HugoPBrito@users.noreply.github.com>
2026-05-13 10:16:28 +01:00

10 lines
405 B
TypeScript

// Uses the AWS Console's universal `/go/view` redirect so we don't have to
// special-case each service — the console resolves the ARN to the right page.
export const buildAwsConsoleUrl = (resourceArn: string): string | null => {
if (!resourceArn || !resourceArn.startsWith("arn:")) {
return null;
}
return `https://console.aws.amazon.com/go/view?arn=${encodeURIComponent(resourceArn)}`;
};