Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding sample for dynamic AWS inventory #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wieshka
Copy link

@wieshka wieshka commented Sep 1, 2020

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.

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
Copy link
Author

wieshka commented Sep 1, 2020

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.

@lemonmojo
Copy link
Member

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
Copy link
Member

@wieshka Any news on this?

@eiabea
Copy link
Contributor

eiabea commented Dec 13, 2024

@wieshka thank you for your contribution. We would love to get this sample merged, unfortunately the format of your script does not meet our formats. Please consider:

  • Exporting it like @lemonmojo already mentioned in a previous comment
  • Add some variables for e.g. region, tag, custom command in order to keep the script flexible

A good starting point may be the Bitwarden (Python).rdfx example

Looking forward to hear from you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants