2018-10-26 15:47:49 -07:00
|
|
|
package classic
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/hashicorp/packer/helper/communicator"
|
2020-11-17 16:31:03 -08:00
|
|
|
"github.com/hashicorp/packer/packer-plugin-sdk/multistep"
|
2018-10-26 15:47:49 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
type stepConnectBuilder struct {
|
|
|
|
*communicator.StepConnectSSH
|
|
|
|
KeyName string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *stepConnectBuilder) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
|
|
|
|
s.Config.SSHKeyPairName = s.KeyName
|
|
|
|
return s.StepConnectSSH.Run(ctx, state)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *stepConnectBuilder) Cleanup(state multistep.StateBag) {
|
|
|
|
s.StepConnectSSH.Cleanup(state)
|
|
|
|
}
|