aws / session-manager-plugin

This plugin helps you to use the AWS Command Line Interface (AWS CLI) to start and end sessions to your managed instances
Apache License 2.0
257 stars 69 forks source link

Import paths not available publicly #1

Open steveh opened 3 years ago

steveh commented 3 years ago

Hi there,

Thanks for publishing the source code. I'd like to integrate the components of session-manager-plugin into my own tooling, but I'm not able to import them, because the paths in the source code refer to github.com/aws/SSMCLI instead of github.com/aws/session-manager-plugin.


go get github.com/aws/session-manager-plugin/src/sessionmanagerplugin/session

go: downloading github.com/aws/session-manager-plugin v0.0.0-20210609234953-e4ad4017df96
go: downloading github.com/aws/aws-sdk-go v1.38.60
github.com/aws/session-manager-plugin/src/sessionmanagerplugin/session imports
    github.com/aws/SSMCLI/src/config: cannot find module providing package github.com/aws/SSMCLI/src/config
github.com/aws/session-manager-plugin/src/sessionmanagerplugin/session imports
    github.com/aws/SSMCLI/src/datachannel: cannot find module providing package github.com/aws/SSMCLI/src/datachannel
github.com/aws/session-manager-plugin/src/sessionmanagerplugin/session imports
    github.com/aws/SSMCLI/src/log: cannot find module providing package github.com/aws/SSMCLI/src/log
github.com/aws/session-manager-plugin/src/sessionmanagerplugin/session imports
    github.com/aws/SSMCLI/src/message: cannot find module providing package github.com/aws/SSMCLI/src/message
github.com/aws/session-manager-plugin/src/sessionmanagerplugin/session imports
    github.com/aws/SSMCLI/src/retry: cannot find module providing package github.com/aws/SSMCLI/src/retry
github.com/aws/session-manager-plugin/src/sessionmanagerplugin/session imports
    github.com/aws/SSMCLI/src/sdkutil: cannot find module providing package github.com/aws/SSMCLI/src/sdkutil
github.com/aws/session-manager-plugin/src/sessionmanagerplugin/session imports
    github.com/aws/SSMCLI/src/sessionmanagerplugin/session/sessionutil: cannot find module providing package github.com/aws/SSMCLI/src/sessionmanagerplugin/session/sessionutil
github.com/aws/session-manager-plugin/src/sessionmanagerplugin/session imports
    github.com/aws/SSMCLI/src/version: cannot find module providing package github.com/aws/SSMCLI/src/version
``
aidansteele commented 3 years ago

A workaround that lets me use this package in the interim (while we wait for a solution from AWS) is to use a replace directive in our go.mod like this:

module yourpackagenamehere

go 1.16

require (
    github.com/aws/SSMCLI v1.0.0
    github.com/aws/aws-sdk-go v1.38.64 // indirect
    github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect
    github.com/fsnotify/fsnotify v1.4.9 // indirect
    github.com/gorilla/websocket v1.4.2 // indirect
    github.com/stretchr/testify v1.7.0 // indirect
    github.com/twinj/uuid v0.0.0-20151029044442-89173bcdda19 // indirect
)

replace github.com/aws/SSMCLI => github.com/aws/session-manager-plugin v0.0.0-20210609234953-e4ad4017df96
Yangtao-Hua commented 3 years ago

Thank you for reaching out to us, we will research this issue and come back.

Ichimikichiki commented 3 years ago

github.com/aws/SSMCLI doesn't even exist - not really much to research.

Also, why would you deploy code you hadn't even tried?

Also this isn't an enhancement. This is to actually get your broken code to work. Pretty sloppy effort.

Yangtao-Hua commented 3 years ago

@Ichimikichiki, Sorry for the inconvenience about the import path. Would you like share more on your use case with session-manager-plugin. At the same time, we are working on the update of it, thanks for your patient again before we find a good solution for it.

rue-nsilverman commented 3 years ago

I also would like to see this resolved by replacing the correct URL throughout the repo. My use case FWIW, is that I have a custom EC2/SSM resolver that I'm writing as a go CLI, rather than have users download the plugin as a dependency, I would include the session-manager session package and call the ValidateInputAndStartSession directly. Then when compiled, its all in one tool rather than two.

I did try @aidansteele 's recommendation and it did function after a bunch of toying around, but I am still getting some runtime segfaults, and I struggled to get the replacement to pull its dependencies properly.

MatteoGioioso commented 2 years ago

@Yangtao-Hua one example use case that we have at the moment is to use SSM in a private network to access an RDS instance through IAM authentication. We are in the process of automating this by building a small CLI tool and it would be nice to include this plugin as a dependency and work directly with it instead of installing it manually.

I see there is already a PR, do you have any ETA to merge it?

Thanks.

hoshsadiq commented 2 years ago

@Yangtao-Hua any chance of getting #11 and #33 looked at?

Yangtao-Hua commented 2 years ago

Hi, We are actively working on fix of this issue, will prioritize it and keep progress posted.

Thanks, Yangtao

andymac4182 commented 2 years ago

Thanks @Yangtao-Hua 😄

Yangtao-Hua commented 1 year ago

Hi, Updated the import path in mainline, hope it will be helpful on code build. We did not move to go-mod in this change, but team already having it tracked in backlog.

Thanks, Yangtao