link2aws is both an executable binary that can be run, and a library that can be used in Rust programs.
Installing the command-line executable
Assuming you have Rust/Cargo installed , run this command in a terminal:
cargo install link2aws
It will make the link2aws command available in your PATH if you've allowed the PATH to be modified when installing Rust . cargo uninstall link2aws uninstalls.
Adding link2aws library as a dependency
Run this command in a terminal, in your project's directory:
cargo add link2aws
To add it manually, edit your project's Cargo.toml file and add to the [dependencies] section:
link2aws = "0.1.1"
The link2aws library will be automatically available globally.
Read the link2aws library documentation .
Back to the crate overview .
Readme
link2aws
Converts ARNs to direct links to the AWS console.
Amazon Resource Names (ARNs) are strings like arn: aws: s3:: : abc123
that uniquely identify resources in Amazon Web Services (AWS).
How to use
$ cargo install link2aws
$ link2aws arn:aws:s3:::abc123
https://s3.console.aws.amazon.com/s3/buckets/abc123
As a library
use link2aws:: arn_to_link;
// https://s3.console.aws.amazon.com/s3/buckets/abc123
println! ( " {} " , arn_to_link ( " arn:aws:s3:::abc123" ) . unwrap ( ) ) ;
Advanced usage
The library consists of an ARN parser, and a console link generator.
These two parts may be used separately.
See Arn for an example of how to just parse an ARN.
See ArnParts for an example of how to generate a link,
or build an ARN, from your own struct.
Compatibility note
We will try to keep this library up-to-date as AWS changes.
We will continuously add support for new services and resource types.
The returned link will always be our most up-to-date best guess.
This means that there is no guarantee that the returned link will stay
the same if AWS changes a service, or that we will still be able to
return a link for an ARN if AWS discontinues a service.
Contributing
Found a bug? Missing a resource type? Open a ticket or send a pull request!
Adding a resource type is usually an easy 1-line change (plus 1-line test).
Other languages
Also see our JavaScript library
and the web version at link2aws.github.io !