When you try to launch a new EC2 instance in AWS using Chef Test Kitchen and the process times out with the message:
Waiting for SSH service on …:22, retrying in 3 seconds
$$$$$$ [SSH] connection failed, terminating (#<Net::SSH::AuthenticationFailed: Authentication failed for user …@…>)
>>>>>> ——Exception——-
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Failed to complete #create action: [SSH session could not be established] on default-rhel7
>>>>>> ———————-
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose –all` for configuration
Check the access to the “ssh_key” which is specified in the platforms: driver: transport: section of the .kitchen.yml file.
The .pem file should be accessible from the cookbook directory with the absolute or relative path.