{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/5408","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/5408/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/5408/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/5408/events","html_url":"https://github.com/hashicorp/terraform/issues/5408","id":137760902,"number":5408,"title":"Cannot deploy Private AMI","user":{"login":"darksheer","id":1522288,"avatar_url":"https://avatars.githubusercontent.com/u/1522288?v=3","gravatar_id":"","url":"https://api.github.com/users/darksheer","html_url":"https://github.com/darksheer","followers_url":"https://api.github.com/users/darksheer/followers","following_url":"https://api.github.com/users/darksheer/following{/other_user}","gists_url":"https://api.github.com/users/darksheer/gists{/gist_id}","starred_url":"https://api.github.com/users/darksheer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darksheer/subscriptions","organizations_url":"https://api.github.com/users/darksheer/orgs","repos_url":"https://api.github.com/users/darksheer/repos","events_url":"https://api.github.com/users/darksheer/events{/privacy}","received_events_url":"https://api.github.com/users/darksheer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/provider/aws","name":"provider/aws","color":"bfdadc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-02T03:28:36Z","updated_at":"2016-03-05T22:31:53Z","closed_at":"2016-03-05T22:31:53Z","body":"When trying to deploy an AMI within our AWS account, terraform returns the following error:\r\n\r\n`Error applying plan:\r\n\r\n1 error(s) occurred:\r\n\r\n* aws_instance.management_node: Error launching source instance: AuthFailure: Not authorized for images: [ami-700004]\r\n\tstatus code: 400, request id:\r\n\r\nTerraform does not automatically rollback in the face of errors.\r\nInstead, your Terraform state file has been partially updated with\r\nany resources that successfully completed. Please address the error\r\nabove and apply again to incrementally change your infrastructure.`\r\n\r\nThe AMI is able to be launched successfully via API or Web Console. \r\n\r\nHere is the snippet from the terraform config:\r\n\r\n```tf\r\nresource \"aws_instance\" \"management_node\" {\r\n\tami = \"${var.management_ami}\"\r\n\tavailability_zone = \"us-east-1b\"\r\n\tinstance_type = \"m4.xlarge\"\r\n\tkey_name = \"${var.aws_key_name}\"\r\n\tsecurity_groups = [\"${aws_security_group.private.id}\"]\r\n\tsubnet_id = \"${aws_subnet.us-east-1b-private.id}\"\r\n\tprivate_ip = \"192.168.0.70\"\r\n  tags {\r\n        Name = \"Management Server\"\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/192752968","html_url":"https://github.com/hashicorp/terraform/issues/5408#issuecomment-192752968","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/5408","id":192752968,"user":{"login":"darksheer","id":1522288,"avatar_url":"https://avatars.githubusercontent.com/u/1522288?v=3","gravatar_id":"","url":"https://api.github.com/users/darksheer","html_url":"https://github.com/darksheer","followers_url":"https://api.github.com/users/darksheer/followers","following_url":"https://api.github.com/users/darksheer/following{/other_user}","gists_url":"https://api.github.com/users/darksheer/gists{/gist_id}","starred_url":"https://api.github.com/users/darksheer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darksheer/subscriptions","organizations_url":"https://api.github.com/users/darksheer/orgs","repos_url":"https://api.github.com/users/darksheer/repos","events_url":"https://api.github.com/users/darksheer/events{/privacy}","received_events_url":"https://api.github.com/users/darksheer/received_events","type":"User","site_admin":false},"created_at":"2016-03-05T22:31:53Z","updated_at":"2016-03-05T22:31:53Z","body":"Fixed the problem by going into the AMI and adding the hosting account to the permissions list, ensuring the make snapshot option was selected.\r\n\r\nWhy I had to do this, IDK.  But resolved the issue.  \r\n\r\nThanks for the quick response."}}