toolbox icon indicating copy to clipboard operation
toolbox copied to clipboard

Adding sample for dynamic AWS inventory

Open wieshka opened this issue 5 years ago • 4 comments

Adding sample script for discovering EC2 instances with boto3, grouping them by speciifed Tag based on its Value + connecting via EC2 Instance Connect rather regular SSH. More info on EC2 Instance Connect can be found here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect.html.

wieshka avatar Sep 01 '20 19:09 wieshka

This sample will:

  • List all instances in the desired region;
  • Group them by selected Tag, in the particular example - by aws:cloudformation:stack-name - Tag automatically added for resources which are part of AWS CloudFormation stack, so, effectively, will group instances by Stack.
  • All instances without matching Tag will be added in separate group NotTagged
  • For connection to instance, support for EC2 Instance Connect is implemented based on mssh

Potentially to be added but not needed in my scenario:

  • CustomProperties for region, tag_name and perhaps for NotTagged toggle - to enable/disable grouping none-matching items;
  • Potentially getting rid of boto3 dependency, but then, I would prefer to see in Royal support for venv. Would be so awesome.
  • Some cleanup.

wieshka avatar Sep 01 '20 19:09 wieshka

Hi @wieshka,

many thx for your contribution, sounds like a very useful addition!

Could you please take a look at the other samples in this repository? All of them are published as .rdfe files (Royal Dynamic Folder Export files) which contain the scripts as well as metadata like a description, notes for getting the script running and, if required, custom properties. This way other users can also discover the scripts through our dynamic folder importer from within the app (File - Import - Dynamic Folder).

You can export dynamic folders as .rdfe files by control-clicking/right-clicking a dynamic folder in Royal TSX' navigation panel and selecting "Export…".

thx, felix

lemonmojo avatar Sep 03 '20 07:09 lemonmojo

@wieshka Any news on this?

lemonmojo avatar Feb 24 '21 08:02 lemonmojo