omssh

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2019 License: MIT Imports: 14 Imported by: 0

README

oreno-mssh

AWS mssh Tool wrapper

This project provides an interactive cli tool using ec2-instance-connect api to connect via ssh to ec2 instance.

  • select profile in aws credentials
  • select ec2 instance id in list of ec2 intances gotten by credentials specified profile
  • ssh to ec2 instance by using ec2 instance connect api

Install

$ go get -u github.com/kenzo0107/omssh

LICENSE

The MIT License (MIT)

Copyright (c) 2019 Kenzo Tanaka

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssumeRoleWithSession

func AssumeRoleWithSession(region, defCredentialsPath string) (*session.Session, error)

AssumeRoleWithSession : returns switched role session from argument session and IAM

func FinderUsername

func FinderUsername() (user string, err error)

FinderUsername : find ssh username through fuzzyfinder

func GetProfile

func GetProfile(defCredentialsPath string) (profile string, err error)

GetProfile : return profile selected in .aws/credentials

func NewSession

func NewSession(profile, region string) *session.Session

NewSession : new session specified profile

Types

type EC2Client

type EC2Client struct {
	// contains filtered or unexported fields
}

EC2Client : ec2 client

func NewEC2

func NewEC2(sess *session.Session) *EC2Client

NewEC2 : new ec2 client

func (*EC2Client) GetEC2List

func (d *EC2Client) GetEC2List() ([]EC2Info, error)

GetEC2List : get list of ec2 instances

type EC2Info

type EC2Info struct {
	InstanceID       string
	PublicIPAddress  string
	PrivateIPAddress string
	InstanceType     string
	InstanceName     string
	AvailabilityZone string
}

EC2Info : required ec2 instance information

func FinderEC2Info

func FinderEC2Info(ec2List []EC2Info) (ec2Info EC2Info, err error)

FinderEC2Info : find information of ec2 instance through fuzzyfinder

type EC2InstanceConnectClient

type EC2InstanceConnectClient struct {
	// contains filtered or unexported fields
}

EC2InstanceConnectClient : ec2 instance connect client

func NewEC2InstanceConnect

func NewEC2InstanceConnect(sess *session.Session) *EC2InstanceConnectClient

NewEC2InstanceConnect : new ec2 instance connect client

func (*EC2InstanceConnectClient) SendSSHPubKey

func (d *EC2InstanceConnectClient) SendSSHPubKey(user, instanceID, publicKey, availabilityZone string) error

SendSSHPubKey : send ssh public key to using ec2 instance api

Directories

Path Synopsis
cmd
omssh command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL