Giter Club home page Giter Club logo

link2aws.github.io's Introduction

link2aws

Copy/paste ARN, get direct link to AWS console

Screenshot of link2aws.github.io

Copyright (c) 2020, Felix Kaiser. License: ISC

Node.js CI

How to...

Use as website

Go to link2aws.github.io (privacy notice: it runs in the browser and does not send your input anywhere)

Or run directly from source:

# git clone https://github.com/link2aws/link2aws.github.io
# firefox link2aws.github.io/index.html

You can make links that auto-redirect to the AWS console by appending #arn... like this:

https://link2aws.github.io/#arn:aws:ec2:us-west-1:136693071363:image/ami-0851c4af3ebd71c35

Use as command line tool

Via NPM:

# npm install -g link2aws
# link2aws arn:aws:s3:::abcdefgh1234
https://s3.console.aws.amazon.com/s3/buckets/abcdefgh1234

Or clone the repo and run the file (no setup required):

# git clone https://github.com/link2aws/link2aws.github.io
# node link2aws.github.io/link2aws.js arn:aws:s3:::abcdefgh1234
https://s3.console.aws.amazon.com/s3/buckets/abcdefgh1234

Use as JavaScript library

var link2aws = require('link2aws');
new link2aws.ARN('arn:aws:s3:::abcdefgh1234').consoleLink
// https://s3.console.aws.amazon.com/s3/buckets/abcdefgh1234

Or:

import { ARN } from 'link2aws';
new ARN('arn:aws:s3:::abcdefgh1234').consoleLink;
// https://s3.console.aws.amazon.com/s3/buckets/abcdefgh1234

If the ARN is invalid, or valid but we have no link for it, an exception is thrown.

Add support for resource types

It's super easy - see this example.

Pull requests welcome!

Add code

  • Support for new resource types: see large dict at the end of link2aws.js
  • Testcases...
    • ...where we should take a valid ARN and return a URL: testcases/aws.json
    • ...where we should take a string (e.g. bad or unsupported ARN) and throw an exception: testcases/aws-negative.json
    • ...for corner cases not specific to AWS, such as whitespace handling: testcases/string.json

Run tests and check test coverage

npm install
node_modules/nyc/bin/nyc.js --reporter=text node_modules/mocha/bin/mocha test/test.js

link2aws.github.io's People

Contributors

fxkr avatar twinsnes avatar ayeletcohen avatar vboufleur avatar khou2020 avatar allanhortle avatar diemkay avatar dleavitt avatar darbybrown avatar jeff-searchpilot avatar nickcaballero avatar scottlamb avatar wenyichen avatar johnsilva-okta avatar

Stargazers

rowan avatar  avatar Donal Tuohy avatar Darryl Yeo avatar  avatar  avatar Robin Schlegel avatar Liam Farrelly avatar Muath Alsowadi avatar Colin O'Dell avatar Pete Richardson avatar Philip Tzou avatar Wojciech Grzebieniowski avatar Gustavo Martim avatar Ryan Malloy avatar  avatar  avatar Kamil Albrycht avatar Eduardo Rabelo avatar Tobi avatar Stephen Lizcano avatar  avatar Heph Adams avatar  avatar Pat Myron avatar Lalit avatar Jared Short avatar Julius Blank avatar Florian Kaiser avatar Steven Montalbano avatar Roberto Luna Rojas avatar Gergan Penkov avatar

Watchers

 avatar James Cloos avatar

link2aws.github.io's Issues

Add command line interface

The library is already easy to install via npm install. There's no reason why I couldnt also expose the one function via CLI.

I'm unable to push a branch to request a PR

Hi!

I just worked on a couple of service ARNs additions to this great repo. After I finished I tried pushing my feature branch to request a PR, but I got permission denied from Git, couldn't push the branch.

What do you think about protecting the master branch so that only the maintainers can push to it, but allowing people from the web to push their custom branches? I think this would make the process of contributing to this project a bit faster and better for everyone.

If that's not a good idea, can I be added as a developer just so that I can push my branch and open the PR for your code review?

Can not parse the class fields

Hello,
If I use it in a CRA app without shebang-loader(loader which removes #!/usr/bin/env node) I will get the following error when importing it:
image
If I use shebang-loader, I will get the following error:
image

This is because babel does not know how to transpile class fields. Even if I add ["@babel/plugin-proposal-class-properties"], to babel config, it still does not work. Do you know how I could import and transpile it properly?

Investigate search bar integration

Firefox (& Chrome as well?) support custom search providers.

What's needed to make this project work with that? I think it'd increase usability quite a bit.

FEATURE REQUEST: Typescript typings

I'd like to use this inside of a Typescript project, but I need typings for same. I tried making my own with dts-gen, but I don't think I did it right, because I'm getting the error:

TypeError: (new link2aws__WEBPACK_IMPORTED_MODULE_1__.ARN(...)).consoleLink is not a function

Here's what I have so far:

// Type definitions for link2aws
// Project: https://github.com/link2aws/link2aws.github.io#readme
// Definitions by: Christopher Peters <https://github.com/kpeters-cbsi/>
/** Declaration file generated by dts-gen */

declare module 'link2aws' {
  class ARN {
    constructor(text: string);
    string(): string;
    console(): string;
    qualifiers(): string[];
    pathLast(): string;
    consoleLink(): string;
  }
}

New resource type: codeconnections, codestar-connections

Info:

There's also a sort of equivalent resource (old version of the same thing, I think) that lives under the codestar-connections resource type. The ARN/URL formula is the same as the above, with codeconnections replaced with codestar-connections:

Notes:

  • Console URLs for these are especially useful, as they can't be fully created programmatically - there's a step that needs to be done via the console.
  • Create one from here: https://us-west-2.console.aws.amazon.com/codesuite/settings/connections
  • I'm not sure the codestar ones can be created via the console anymore? Can still be created via API or Cloudformation though.
  • Happy to open a PR!

Cloudformation Entities:

Some code:

const [prefix, id] = arn.split("/");
const [, , ns, region, account] = prefix.split(":");
const url = `https://${region}.console.aws.amazon.com/codesuite/settings/${account}/${region}/${ns}/connections/${id}`;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.