Ok Solved.
I randomly decided that, to better debug, I would make a min instance count of 1. This threw up an error about my launchConfig. After some trolling around I found out that I had made a really big mistake with my template. So I changed the launchConfig to:
"LaunchConfig" : {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"Metadata" : {
"Comment" : "Install a simple PHP application",
"AWS::CloudFormation::Init" : {
"config" : {
"files" : {
"/etc/cron.d/worker" : {
"content" : "*/1 * * * * ubuntu /home/ubuntu/worker_cronjob &> /home/ubuntu/worker.log\n",
"mode" : "000644",
"owner" : "root",
"group" : "root"
},
"/home/ubuntu/worker_cronjob" : {
"content" : { "Fn::Join" : ["", [
"#!/usr/bin/env php\n",
"<?php\n",
"define('ROOT', dirname(__FILE__));",
"const AWS_KEY = \"", { "Ref" : "WorkerKeys" }, "\";",
"const AWS_SECRET = \"", { "Fn::GetAtt": ["WorkerKeys", "SecretAccessKey"]}, "\";",
"const QUEUE = \"", { "Ref" : "InputQueue" }, "\";",
"exec('git clone x '.ROOT.'/worker');",
"if(!file_exists(ROOT.'/worker/worker_despatcher.php')){",
"echo 'git not downloaded right';",
"exit();",
"}",
"echo 'git downloaded';",
"include_once ROOT.'/worker/worker_despatcher.php';"
]]},
"mode" : "000755",
"owner" : "ubuntu",
"group" : "ubuntu"
}
}
}
}
},
And my userdata to:
"UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [
"#!/bin/bash\n",
"apt-get -y install python-setuptools\n",
"easy_install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz\n",
"cfn-init -v ",
" -s ", { "Ref" : "AWS::StackName" },
" -r LaunchConfig ",
" --access-key ", { "Ref" : "WorkerKeys" },
" --secret-key ", {"Fn::GetAtt": ["WorkerKeys", "SecretAccessKey"]},
" --region ", { "Ref" : "AWS::Region" }, "\n"
]]}
And now everything works dandy.
So if you get the users-script error it means that your launch config is wrong and you should look at it again.
Thanks for the help :)
Best Answer
The AMI was deleted by another user at the same time I did my edits.
The message "AMI cannot be described" actually means "AMI could not be found".
Hope this helps someone.