leapp
leapp copied to clipboard
CLI: Filter session by integrationName
Is your feature request related to a problem? Please describe.
I'd like to create a chained session for a session made via SSO. The pain point occurs when setting the parentSessionId
, as filters do not appear to work when filtering by type (Aws SSO) and Name (Bug as multiple filters do not appear to work).
The main thing that would help with this goal of filtering for a parent session id is for sessions to have the Ids of their SSO integration that created them.
Describe the solution you'd like
# this next command would be the nice to have feature
id=$(leapp session list -x --filter="integrationName=aws-sso-acme" | jq -r '.[] | .id')
# example of how to use it in a script
leapp session add --providerType aws --sessionType awsIamRoleChained --sessionName ... --region ... --profileId ... --roleArn ... --parentSessionId ${id} --roleSessionName ...
Describe alternatives you've considered
leapp session list -x --filter="role=foo" --filter="Type=AWS Single Sign-On" --filter="Session Name=bar"
This does not appear to provide an accurate list.
Additional context Alternatively, if there is a way to create profiles I'm all ears :).
Thanks for the suggestions @Benbentwo, it's a nice addition to make the CLI more usable, so we're going further to look into it. However, multiple filters do work (tested on latest version of the CLI); you need to use multiple instance of the --filter flag like this (probably need to clarify in the docs):
leapp session list --filter="Type=AWS Single Sign-On" --filter="Session Name=Foo"
Also it would definitely help to document all the available keys on what to be able to filter.