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

Port forwarding fix and AWS regions update #59

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cmd/fwdrem.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var (
)

// get target
argTarget := strings.TrimSpace(viper.GetString("fwd-target"))
argTarget := strings.TrimSpace(viper.GetString("fwdrem-target"))
if argTarget != "" {
table, err := internal.FindInstances(ctx, *_credential.awsConfig)
if err != nil {
Expand All @@ -51,8 +51,8 @@ var (
}

// get port
argRemotePort := strings.TrimSpace(viper.GetString("fwd-remote-port"))
argLocalPort := strings.TrimSpace(viper.GetString("fwd-local-port"))
argRemotePort := strings.TrimSpace(viper.GetString("fwdrem-remote-port"))
argLocalPort := strings.TrimSpace(viper.GetString("fwdrem-local-port"))
if argRemotePort == "" {
askPort, err := internal.AskPorts()
if err != nil {
Expand All @@ -68,7 +68,7 @@ var (
}
}

argHost := strings.TrimSpace(viper.GetString("fwd-host"))
argHost := strings.TrimSpace(viper.GetString("fwdrem-host"))
if argHost == "" {
askHost, err := internal.AskHost()
if err != nil {
Expand Down Expand Up @@ -133,10 +133,10 @@ func init() {
fwdremCommand.Flags().StringP("host", "a", "", "[optional] it is remote host address to proxy to.")

// mapping viper
viper.BindPFlag("fwd-remote-port", fwdremCommand.Flags().Lookup("remote"))
viper.BindPFlag("fwd-local-port", fwdremCommand.Flags().Lookup("local"))
viper.BindPFlag("fwd-target", fwdremCommand.Flags().Lookup("target"))
viper.BindPFlag("fwd-host", fwdremCommand.Flags().Lookup("host"))
viper.BindPFlag("fwdrem-remote-port", fwdremCommand.Flags().Lookup("remote"))
viper.BindPFlag("fwdrem-local-port", fwdremCommand.Flags().Lookup("local"))
viper.BindPFlag("fwdrem-target", fwdremCommand.Flags().Lookup("target"))
viper.BindPFlag("fwdrem-host", fwdremCommand.Flags().Lookup("host"))

rootCmd.AddCommand(fwdremCommand)
}
8 changes: 4 additions & 4 deletions internal/ssm.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ var (
// default aws regions
defaultAwsRegions = []string{
"af-south-1",
"ap-east-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-south-1", "ap-southeast-2", "ap-southeast-3",
"ap-east-1", "ap-northeast-1", "ap-southeast-1", "ap-northeast-2", "ap-northeast-3", "ap-south-1", "ap-south-2", "ap-southeast-2", "ap-southeast-3", "ap-southeast-4",
"ca-central-1",
"cn-north-1", "cn-northwest-1",
"eu-central-1", "eu-north-1", "eu-south-1", "eu-west-1", "eu-west-2", "eu-west-3",
"me-south-1",
"eu-central-1", "eu-central-2", "eu-north-1", "eu-south-1", "eu-west-1", "eu-west-2", "eu-west-3", "eu-south-2",
"me-south-1", "me-central-1",
"sa-east-1",
"us-east-1", "us-east-2", "us-gov-east-1", "us-gov-west-2", "us-west-1", "us-west-2",
"us-east-1", "us-east-2", "us-gov-east-1", "us-gov-west-1", "us-west-1", "us-west-2",
}
)

Expand Down