bastion

package
v0.0.0-...-96da9d6 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AmiPlatformIsWindows

func AmiPlatformIsWindows(sess *session.Session, ami string) (bool, error)

func AttachIAMPolicyToRole

func AttachIAMPolicyToRole(sess *session.Session, policyArn string) error

func AuthorizeSecurityGroup

func AuthorizeSecurityGroup(sess *session.Session, security_group_id string, bastion_security_group_id string, remote_port int64) error

func BuildLinuxUserdata

func BuildLinuxUserdata(sshKey string, sshUser string, expire bool, expireAfter int, efs string, accessPoints string) string

func BuildWindowsUserdata

func BuildWindowsUserdata() string

func CheckRequirements

func CheckRequirements(c *cli.Context) error

func CmdLaunchLinuxBastion

func CmdLaunchLinuxBastion(c *cli.Context) error

func CmdLaunchWindowsBastion

func CmdLaunchWindowsBastion(c *cli.Context) error

func CmdStartRemotePortForwardSession

func CmdStartRemotePortForwardSession(c *cli.Context) error

func CmdStartSession

func CmdStartSession(c *cli.Context) error

func CmdTerminateInstance

func CmdTerminateInstance(c *cli.Context) error

func CopyPasswordToClipBoard

func CopyPasswordToClipBoard(password string)

func CreateBastion

func CreateBastion(c *cli.Context) (string, string, error)

func CreateIAMInstanceProfile

func CreateIAMInstanceProfile(sess *session.Session) error

func CreateIAMPolicy

func CreateIAMPolicy(sess *session.Session) (string, error)

func CreateIAMRequirementsIfNotExist

func CreateIAMRequirementsIfNotExist(sess *session.Session) error

func CreateIAMRole

func CreateIAMRole(sess *session.Session) error

func CreateKeyPair

func CreateKeyPair(sess *session.Session, id string) (string, string, error)

func DecodePassword

func DecodePassword(keypair string, passwordData string) (string, error)

func DeleteKeyPair

func DeleteKeyPair(sess *session.Session, id string) error

func DeleteKeyPairParameter

func DeleteKeyPairParameter(sess *session.Session, parameterName string) error

func EnrichInstancesDetail

func EnrichInstancesDetail(sess *session.Session, instances []*string) ([]string, error)

func GenerateSessionId

func GenerateSessionId() string

func GetAmiFromParameter

func GetAmiFromParameter(sess *session.Session, parameter string) (string, error)

func GetAndValidateAmi

func GetAndValidateAmi(sess *session.Session, input string, instance_type string) (string, error)

func GetArchitecture

func GetArchitecture(sess *session.Session, instance_type string) (string, error)

Get all supported architectures for current instance type

func GetDefaultKeyPairParameterName

func GetDefaultKeyPairParameterName(sessionId string) string

func GetIAMInstanceProfile

func GetIAMInstanceProfile(sess *session.Session) (string, error)

func GetInstanceIdBySessionId

func GetInstanceIdBySessionId(sess *session.Session, sessionId string) (string, error)

func GetKeyPairName

func GetKeyPairName(sessionId string) string

func GetKeyPairParameter

func GetKeyPairParameter(sess *session.Session, parameterName string) (string, error)

func GetRdsSecurityGroupId

func GetRdsSecurityGroupId(sess *session.Session, rds_instance string) (string, error)

func GetSecurityGroups

func GetSecurityGroups(sess *session.Session, vpcId string) ([]securitygroup, error)

func GetSessionIdFromInstance

func GetSessionIdFromInstance(sess *session.Session, instanceId string) (string, error)

func GetStartSessionPayload

func GetStartSessionPayload(sess *session.Session, input *ssm.StartSessionInput) (*ssm.StartSessionOutput, string, error)

func GetSubnet

func GetSubnet(sess *session.Session, subnetId string) (subnet, error)

func GetSubnets

func GetSubnets(sess *session.Session) ([]subnet, error)

func GetTagValue

func GetTagValue(tags []*ec2.Tag, key string) string

func GetWindowsPasswordData

func GetWindowsPasswordData(sess *session.Session, instanceId string) (string, error)

func IAMInstanceProfileExists

func IAMInstanceProfileExists(sess *session.Session) (bool, error)

func LookupSSMManagedInstances

func LookupSSMManagedInstances(sess *session.Session) ([]*string, error)

func LookupUserIdentity

func LookupUserIdentity(sess *session.Session) (string, error)

func PutKeyPairParameter

func PutKeyPairParameter(sess *session.Session, parameterName string, value string) error

func ReadAndValidatePublicKey

func ReadAndValidatePublicKey(filePath string) (string, error)

func RevertSecurityGroup

func RevertSecurityGroup(sess *session.Session, security_group_id string, bastion_security_group_id string, remote_port int64) error

func RunSubprocess

func RunSubprocess(process string, args ...string) error

func SelectInstance

func SelectInstance(sess *session.Session) (string, error)

func SelectRDSInstance

func SelectRDSInstance(sess *session.Session) (string, string, error)

func SelectSecurityGroup

func SelectSecurityGroup(securitygroups []securitygroup) securitygroup

func SelectSubnet

func SelectSubnet(subnets []subnet) subnet

func SetupAWSSession

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

func StartEc2

func StartEc2(id string, sess *session.Session, ami string, instanceProfile string, subnetId string, securitygroupId string, instanceType string, launchedBy string, userdata string, keyName string, spot bool, public bool, volumeEncryption bool, volumeType string) (string, error)

func StartRDPSession

func StartRDPSession(sess *session.Session, instanceId string, localRdpPort int, awsProfile string) error

func StartSSHSession

func StartSSHSession(sess *session.Session, instanceId string, sshUser string, sshOpts string, awsProfile string) error

func StartSession

func StartSession(sess *session.Session, instanceId string, awsProfile string) error

func TerminateEC2

func TerminateEC2(sess *session.Session, instanceId string) error

func TerminateSession

func TerminateSession(sess *session.Session, sessionId string) error

func ValidAmi

func ValidAmi(ami string) bool

func WaitForBastionStatusOK

func WaitForBastionStatusOK(sess *session.Session, instanceId string) error

func WaitForBastionToRun

func WaitForBastionToRun(sess *session.Session, instanceId string) error

func WaitForInstanceProfileToCreate

func WaitForInstanceProfileToCreate(sess *session.Session) error

func WaitForWindowsBastionPassword

func WaitForWindowsBastionPassword(sess *session.Session, instanceId string) error

Types

type AssumeRolePolicyDocument

type AssumeRolePolicyDocument struct {
	Version   string
	Statement []AssumeRoleStatementEntry
}

type AssumeRoleStatementEntry

type AssumeRoleStatementEntry struct {
	Effect    string
	Principal Principal
	Action    []string
}

type PolicyDocument

type PolicyDocument struct {
	Version   string
	Statement []PolicyStatementEntry
}

type PolicyStatementEntry

type PolicyStatementEntry struct {
	Effect   string
	Action   []string
	Resource string
}

type Principal

type Principal struct {
	Service []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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