Giter Club home page Giter Club logo

Comments (7)

xen0l avatar xen0l commented on July 22, 2024

Hello @nc-furstenauw,

thanks for the idea. Could you provide some example how you run this via aws cli just to verify we are thinking about the same thing? Do you have exactly this in mind?

My idea for #256 was basically to be able to execute specific commands that would be defined in documents following that. I wanted to provide an interface on top of it in a new subcommand:

aws-gate run host document_alias

where document_alias would be defined in the configuration file. This would provide a user friendly way for user to create much more readable commands than just passing document names, e.g.

aws-gate run backend make_thread_dump

Then in ~/.aws-gate/config if would look at a section (e.g. custom_commands) and get the document name from that.

What do you think about this interface?

from aws-gate.

xen0l avatar xen0l commented on July 22, 2024

However, looking at AWS-StartInteractiveCommand, if I understand correctly, it takes {{command}} as argument and option to run the command as root. For this, I could imagine implementing aws-gate exec host command (with option --elevated to activate root user level permissions). If so, this shouldn't be difficult to implement.

Still waiting for some example uses to understand options though.

from aws-gate.

nc-furstenauw avatar nc-furstenauw commented on July 22, 2024

Yeah, the example you have in the second comment would be perfect. In awscli terms what I'd like would look something like aws ssm start-session --target ${host} --document-name AWS-StartInteractiveCommand --parameters command="bash -l". I'd like to do something like 'sudo su -c "cd; be rails c env" - user', but I currently can't get that to work for the cli & the documentation for this is fairly sparse, and I already have other ideas to get around that with what I do have working.

So something like aws-gate exec host command would be perfect

from aws-gate.

xen0l avatar xen0l commented on July 22, 2024

@nc-furstenauw there is #374 open, let me know your feedback.

from aws-gate.

nc-furstenauw avatar nc-furstenauw commented on July 22, 2024

@xen0l yep it seems to be working exactly as expected! Might want to make a note in the documentation that the command (or commands) should be wrapped in double quotes, at least that's what I needed to do to get it to work for me

from aws-gate.

xen0l avatar xen0l commented on July 22, 2024

Uhm, I am not sure about the double quotes. I tested it today without just like aws-gate exec <hostname> bash -l. What command did you run exactly? Once this is figured out, I will add tests and documentaiton and merge.

from aws-gate.

xen0l avatar xen0l commented on July 22, 2024

@nc-furstenauw merged and released in 0.9.0. if you see any issues, please report them.

from aws-gate.

Related Issues (20)

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.