Amazon offers some excellent cloud computing services, but being self-managed at the basic level it can be a headache to diagnose and fix errors. I recently encountered a similar error where all my attempts to login into the EC2 instance failed with cloud-init: runcmd Caught exception reading instance data: http://169.254.169.254/2009-04-04/meta-data/security-groups
as shown in the Amazon EC2 instance console system log below.