What is @aws-sdk/util-arn-parser?
The @aws-sdk/util-arn-parser package is a utility library for parsing Amazon Resource Names (ARNs) in JavaScript/TypeScript applications. It is part of the AWS SDK for JavaScript (v3) and is used to extract information from ARNs, which are standardized identifiers for AWS resources.
Parsing ARNs
This feature allows you to parse an ARN string and extract its components, such as the service, region, account ID, and resource details. The parseArn function returns an object with the ARN components.
const { parseArn } = require('@aws-sdk/util-arn-parser');
const arn = 'arn:aws:iam::123456789012:user/Development/product_1234/*';
const parsedArn = parseArn(arn);
console.log(parsedArn);