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

New start-session command #28

Open
awick opened this issue Apr 21, 2023 · 0 comments
Open

New start-session command #28

awick opened this issue Apr 21, 2023 · 0 comments

Comments

@awick
Copy link
Contributor

awick commented Apr 21, 2023

Make it easy to start a session to the task given a task arn. Not sure if start-session is the best name. Basically just take the arn and convert to the correct aws command. So
manage-arkime.py --profile foobar start-session --arn arn:aws:ecs:us-east-1:123:task/MyCluster-ViewerNodes-Cluster-XXX/12345

would be translated to aws --profile foobar --region us-east-1 ecs execute-command --cluster MyCluster-ViewerNodes-Cluster-XXX --task 12345 --interactive --command "/bin/bash"

Maybe there an aws command that already does this, but I couldn't find it. :)

Here is a perl implementation that hardcodes the profile, which the real version shouldn't. :)

#!/usr/bin/perl

use strict;

my @parts = split('/', $ARGV[0]);
my @parts2 = split(':', $parts[0]);
system (qq(aws --profile foobar --region $parts2[3] ecs execute-command --cluster $parts[1] --task $parts[2] --interactive --command "/bin/bash"));
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

No branches or pull requests

1 participant