I have a script that uses ec2-associate-address that I have set in a cron job to run on boot. The idea is to use this instance as a spot instance that will automatically get its public IP assigned on boot. However, since it is a VPC instance, it seems like it cannot make outbound requests until the EIP is assigned.
The error I get is: Unknown problem connecting to host: 'https://ec2.amazonaws.com' Unable to execute HTTP request: Connect to ec2.amazonaws.com:443 timed out
What is the easiest way to accomplish this? I know the ID of the EIP, but I obviously will not have the instance ID since it is a spot request.