link2aws / link2aws.github.io

Get AWS console link from ARN
https://link2aws.github.io/
34 stars 20 forks source link

New resource type: AWS::Logs::LogGroup #29

Closed kpeters-cbsi closed 2 years ago

kpeters-cbsi commented 2 years ago

Info:

fxkr commented 2 years ago

Thank you very much!

Implemented & released as version 1.0.9.

For the record, there were three things of note:

  1. The log group ARN's have an extra :* at the end. We're not the first ones to trip over it (https://github.com/aws/aws-cdk/issues/18253). I think just stripping that away works for our purposes.
  2. The log group name supports a wider character set than some other resource types, like lambdas for example. I tested all possible special chars (based on the error message the console shows when trying to create a log group with an unsupported char); two chars need escaping in a particular way. I think this is a log group specific one off escaping mechanism so I handled it inline with search/replace. Of course I wrote a test that uses all possible special chars (based on a real ARN & URL from the AWS console).
  3. I learned that .replaceAll() is supported by the Nodejs v16 on my laptop, but not the older v14/v12 the tests in our Github actions use. So I went with .replace(/.../g, ...) which works anywhere as far as I know.