Closed sparrc closed 1 year ago
Thanks for the review, I will take a look at that, I think I should be able to fix it
Updated to PR to use ec2iface.EC2API
down into WaitUntilInstanceRunning
, thanks again for the review @lbajolet-hashicorp !
Now it seems like the mocks are panicking when ec2conn.WaitUntilInstanceRunningWithContext
is called. Not exactly sure why that is though? Do the mocks need to be regenerated?
edit: from what I could tell the runSpotEC2ConnMock
struct was not autogenerated, so I added the mock WaitUntilInstanceRunningWithContext
function manually, let me know if that looks OK!
When launching ec2 source instances, we have code which waits for the instance to become ready, but previously this codepath was not being applied to spot instances.
This change factors that code out into a common function, and then calls that common function in both the 'regular' and 'spot' instance launches.
This fixes issues where packer tries to connect to a spot instance before it is running and ready, which means it won't have a public ip address ready yet, and so packer times out on SSH access.
fixes #40