Amazon Ubuntu AMI: fail to handshake

Hello!

Running into an issue that I am hoping, I can get get some feedback on. When attempting to build ami, the provisioning step fails with error message failed to handshake even though ssh connection has been made.

Most of the issues I have read concerning this has to do with logging into the server with the wrong user or ssh keys. In this case, both user (ubuntu) and keys are default (user_name “ubuntu” is default for Ubuntu servers and temp. ssh keys are provisioned by default by ansible).

Below are the relevant files that ought to help with debugging the issue; will provide more info if needed. Would really appreciate feed. Thank you!

Reproduction Steps

Plugin and Packer version

  • Packer v1.8.7
  • Packer-Plugin-Amazon v1.2.5

Simplified Packer Buildfile

Operating system and Environment details

Local Machine: macOS Ventura

Remote:

  • aws_name = "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20230325"
  • ami_id = "ami-0a695f0d95cefc163"
  • ami_owners = ["099720109477"]
  • ssh_username = "ubuntu"

Log Fragments and crash.log files