I'm currently trying to use the aws-ebs builder to deploy an AMI from a packer built Centos 7 minimal AMI (not from the marketplace). The base AMI is configured to use an account called ec2-user account for ssh; therefore my builder file looks like the example below. During the build process, the temporary instance is created, but packer isn't able to SSH to the new temporary instance. I've confirmed, using debug methods that the SSH keys are in fact in place and that I can manually connect to the instance. I've also confirmed from the instance logs, that packer is attempting to connect to the instance, and sshd is able to find the public key on the instance, but then the session is terminated
Packer 0.10.1
Attached Packer debug log
Thanks for the help.
{
"builders": [{
"type": "amazon-ebs",
"access_key": "",
"secret_key": "",
"region": "us-east-1",
"vpc_id" : "my_vpc_id",
"source_ami": "my_ami_id",
"instance_type": "t2.micro",
"user_data_file" : "my_user_data_file_path",
"ssh_keypair_name" : "my_key_name",
"ssh_private_key_file" : "my_key_path.pem",
"ssh_username": "ec2-user",
"associate_public_ip_address" : "1",
"subnet_id" : "my_subnet_id",
"ami_name": "test {{timestamp}}"
}]
}