Skip to content

Commit

Permalink
Catch edge case where an ARN isn't an ARN..
Browse files Browse the repository at this point in the history
  • Loading branch information
Rupert committed Aug 13, 2018
1 parent 32c5633 commit 0325025
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/lastkeypair/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,14 @@ func NewReifiedLoginWithCmd(cmd *cobra.Command, args []string) *ReifiedLogin {
kmsKeyId := viper.GetString("kms-key")
instanceArn, _ := cmd.PersistentFlags().GetString("instance-arn")
username, _ := cmd.PersistentFlags().GetString("ssh-username")
region, _ := cmd.PersistentFlags().GetString("region")
vouchers, _ := cmd.PersistentFlags().GetStringSlice("voucher")

instanceArnParts := strings.Split(instanceArn, ":")
instanceRegion := instanceArnParts[3]
sess := ClientAwsSession(profile, instanceRegion)
if len(instanceArnParts) > 3 {
region = instanceArnParts[3]
}
sess := ClientAwsSession(profile, region)

return &ReifiedLogin{
sess: sess,
Expand Down

0 comments on commit 0325025

Please sign in to comment.