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

Support for interactive Start-SSMSession #283

Open
2 tasks
iancward opened this issue Aug 16, 2022 · 4 comments
Open
2 tasks

Support for interactive Start-SSMSession #283

iancward opened this issue Aug 16, 2022 · 4 comments
Labels
feature-request A feature should be added or improved. module/powershell-cmdlets p2 This is a standard priority issue queued

Comments

@iancward
Copy link

Describe the feature

I would like to be able to use Start-SSMSession from PowerShell, just like I can with the AWS CLI

Use Case

Since I'm on a Windows machine, I'd prefer to use the native tools instead of having to install (and keep updated) the AWS CLI. I also like that AWS Tools for PowerShell is modular, so I can install only the modules I need in order to get done what I need.

Proposed Solution

AWS Tools for PowerShell would need to call the session-manager-plugin with the appropriate arguments.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Tools for PowerShell version used

AWS.Tools.SimpleSystemsManagement 4.1.13

PowerShell version used

7.2.6

Operating System and version

Windows 10

@iancward iancward added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 16, 2022
@ghost
Copy link

ghost commented Sep 9, 2022

Hi,

I'm looking to execute the following for RDP:

Start-SSMSession `
    -DocumentName AWS-StartPortForwardingSession `
    -Parameter @{ "portNumber" = "3389"; "localPortNumber" = "56789" } `
    -Target "i-xxxxxxxxx"

Is this something that would be covered by this request or is it supposed to be possible already? I wonder if I can use this thread to ask what the use of the current PS implementation is?

Thanks in advance,

Adam

@ashishdhingra
Copy link
Contributor

@iancward Thanks for submitting feature request. All PowerShell CmdLets execute the AWS service command and return the results to the end user, in this case Start-SSMSession returns session StartSessionResponse. Also, having dependency on external program is not feasible (It has to assume that AWS CLI is installed with the session manager plugin configured). Session manager plugin is exclusive to AWS CLI and aws ssm start-session could have been implemented with custom implementation to interface with the plugin.

@ashishdhingra ashishdhingra added needs-review and removed needs-triage This issue or PR still needs to be triaged. labels Sep 14, 2022
@ashishdhingra ashishdhingra added the p2 This is a standard priority issue label Mar 8, 2023
@partdavid
Copy link

The documentation for this cmdlet says:

Initiates a connection to a target (for example, a managed node) for a Session Manager session. Returns a URL and token that can be used to open a WebSocket connection for sending input and receiving outputs. Amazon Web Services CLI usage: start-session is an interactive command that requires the Session Manager plugin to be installed on the client machine making the call. For information, see Install the Session Manager plugin for the Amazon Web Services CLI in the Amazon Web Services Systems Manager User Guide. Amazon Web Services Tools for PowerShell usage: Start-SSMSession isn't currently supported by Amazon Web Services Tools for PowerShell on Windows local machines.

What are you supposed to do with the StartSessionResponse? I'm not on Windows and I have the session manager plugin installed--the documentation is a little confused and seems lifted from the AWS CLI, but it kind of implies to me that if I'm not on Windows and I do have the plugin installed I should be able to enter my session this way. If that's not the intention, could it indicate what you're supposed to do with the StartSessionResponse to actually connect to it?

@trevorstr
Copy link

trevorstr commented Mar 29, 2024

I'm trying to use ESC exec to get an interactive shell into a container running on AWS Fargate. It works fine with the AWS CLI, but I would rather use the AWS Tools for PowerShell to get an interactive shell into my remote container.

# Launch an interactive process in Fargate container
$Params = @{
  Cluster = 'trevor-fargate'
  Container = 'easyproxy'
  Command = '/opt/microsoft/powershell/7/pwsh'
  Interactive = $true
  Task = '4529facf1b9d4aefb6c3f228ffc81baa'
}}
$s = Invoke-ECSCommand @Params

# Try to get interactive session
Resume-SSMSession -SessionId $s.Session.SessionId

The Resume-SSMSession command seems like it should launch me into an interactive shell, but all it does is return the websocket URL and SSM session ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. module/powershell-cmdlets p2 This is a standard priority issue queued
Projects
None yet
Development

No branches or pull requests

4 participants