EC2 instance provisioning failing

Hi all,

I have installed Foreman and foreman-proxy on Ubuntu-12.04.3. I'm trying to
provision EC2 instance in my AWS VPC but it is failing on the first step.
This is what I can see in the foreman log:

Started POST "/hosts" for xx.xx.xx.xx at Wed Jan 08 16:24:52 +1100 2014
Processing by HostsController#create as /
Parameters: {"authenticity_token"=>"xxxxxxxx", "capabilities"=>"image",
"host"=>{"puppet_proxy_id"=>"1", "ptable_id"=>"1", "overwrite"=>"false",
"hostgroup_id"=>"1", "root_pass"=>"[FILTERED]", "puppet_ca_proxy_id"=>"1",
"compute_attributes"=>{"flavor_id"=>"m1.small", "managed_ip"=>"public",
"image_id"=>"xxxxxxx", "security_group_ids"=>["", "xxxxxxx"],
"availability_zone"=>"ap-southeast-2a", "subnet_id"=>"xxxxxxx"},
"progress_report_id"=>"[FILTERED]", "build"=>"1", "environment_id"=>"1",
"architecture_id"=>"1", "comment"=>"", "name"=>"ec2-foreman-provisioned",
"puppetclass_ids"=>[""], "provision_method"=>"image", "disk"=>"",
"domain_id"=>"2", "is_owned_by"=>"", "enabled"=>"1",
"type"=>"Host::Managed", "mac"=>"", "operatingsystem_id"=>"2",
"medium_id"=>"1", "compute_resource_id"=>"1", "managed"=>"true"},
"utf8"=>"✓"}
Adding Compute instance for
ec2-foreman-provisioned.ap-southeast-2.compute.internal
Started GET "/tasks/558ffea9-dc91-4f95-b2a1-9b4c39597903"
for xx.xx.xx.xx at Wed Jan 08 16:24:54 +1100 2014
Processing by TasksController#show as /
Parameters: {"id"=>"558ffea9-dc91-4f95-b2a1-9b4c39597903"}
Rendered tasks/_list.html.erb (1.1ms)
Completed 200 OK in 6.7ms (Views: 3.0ms | ActiveRecord: 0.1ms)
Started GET "/tasks/558ffea9-dc91-4f95-b2a1-9b4c39597903"
for xx.xx.xx.xx at Wed Jan 08 16:24:56 +1100 2014
Processing by TasksController#show as /
Parameters: {"id"=>"558ffea9-dc91-4f95-b2a1-9b4c39597903"}
Rendered tasks/_list.html.erb (0.7ms)
Completed 200 OK in 4.2ms (Views: 1.4ms | ActiveRecord: 0.1ms)
Started GET "/tasks/558ffea9-dc91-4f95-b2a1-9b4c39597903"
for xx.xx.xx.xx at Wed Jan 08 16:24:57 +1100 2014
Processing by TasksController#show as /
Parameters: {"id"=>"558ffea9-dc91-4f95-b2a1-9b4c39597903"}
Rendered tasks/_list.html.erb (0.8ms)
Completed 200 OK in 4.9ms (Views: 1.6ms | ActiveRecord: 0.2ms)
Rolling back due to a problem: Set up compute instance
ec2-foreman-provisioned.ap-southeast-2.compute.internal 1 failed
ec2-foreman-provisioned.ap-southeast-2.compute.internalsetCompute
Failed to save:
Rendered hosts/_progress.html.erb (0.2ms)
Rendered puppetclasses/_selectedClasses.html.erb (0.0ms)

I have the template created and associated to the Host group this instance
is being launched into. It also shows up correctly when I click on Resolve
button in the Operating System tab. I have everything else created as well,
operating systems, network, subnet etc. The error is not really verbose so
don't know what to check. Any idea what is going on?

FOREMAN: 1.3.2
RUBY: ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
PUPPET: 2.7.11

Distributor ID: Ubuntu
Description: Ubuntu 12.04.3 LTS
Release: 12.04
Codename: precise
Kernel: 3.2.0-58-virtual

Thanks,
Igor