{"action":"created","issue":{"url":"https://api.github.com/repos/alphagov/tsuru-terraform/issues/41","labels_url":"https://api.github.com/repos/alphagov/tsuru-terraform/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/alphagov/tsuru-terraform/issues/41/comments","events_url":"https://api.github.com/repos/alphagov/tsuru-terraform/issues/41/events","html_url":"https://github.com/alphagov/tsuru-terraform/pull/41","id":73326191,"number":41,"title":"[#93548898] aws: Replace ASGs with instances+count","user":{"login":"dcarley","id":260438,"avatar_url":"https://avatars.githubusercontent.com/u/260438?v=3","gravatar_id":"","url":"https://api.github.com/users/dcarley","html_url":"https://github.com/dcarley","followers_url":"https://api.github.com/users/dcarley/followers","following_url":"https://api.github.com/users/dcarley/following{/other_user}","gists_url":"https://api.github.com/users/dcarley/gists{/gist_id}","starred_url":"https://api.github.com/users/dcarley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcarley/subscriptions","organizations_url":"https://api.github.com/users/dcarley/orgs","repos_url":"https://api.github.com/users/dcarley/repos","events_url":"https://api.github.com/users/dcarley/events{/privacy}","received_events_url":"https://api.github.com/users/dcarley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-05-05T14:14:08Z","updated_at":"2015-05-07T13:55:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/alphagov/tsuru-terraform/pulls/41","html_url":"https://github.com/alphagov/tsuru-terraform/pull/41","diff_url":"https://github.com/alphagov/tsuru-terraform/pull/41.diff","patch_url":"https://github.com/alphagov/tsuru-terraform/pull/41.patch"},"body":"Auto-scaling Groups have been problematic for us for two reasons:\r\n\r\n- we can't easily use the launch configuration to run Ansible on instance\r\n  creation because we're using delegation and it would require open SSH\r\n  access between machines\r\n- they're not supported by Terraform on GCE so we have disparity between the\r\n  two sets of configs\r\n\r\nSo replace them with normal instances and `count` to create multiples of\r\nthem. Now that Terraform knows about the instances themselves we will be\r\nable to use its state file to drive Ansible's inventory. I've added\r\nadditional outputs of these instances like we have for GCE so that we can\r\ninput them into the inventory for the timebeing.\r\n\r\nWe may later periodically run Terraform to ensure that we have the desired\r\nstate and we could dynamically adjust the counts.\r\n\r\nIn it's current form this puts all of the instances into the same\r\navailability zone (default is the first). I'll address this in a following\r\ncommit. It's not trivial to do because subnets are also tied to AZs.\r\n\r\nI've kept the launch configs and moved them to a separate file, indicating\r\nthat they should later be removed, because Terraform doesn't know about the\r\nrelationships when destroying unmanaged resources from the statefile and was\r\nfailing with:\r\n\r\n    aws_launch_configuration.tsuru-sslproxy: Destroying...\r\n    aws_launch_configuration.api: Destroying...\r\n    aws_launch_configuration.router: Destroying...\r\n    Error applying plan:\r\n\r\n    3 error(s) occurred:\r\n\r\n    * Cannot delete launch configuration terraform-Sz66CQVUUQF3rN9tyDP5xdLPkX0= because it is attached to AutoScalingGroup dcarley-tsuru-api-asg\r\n    * Cannot delete launch configuration terraform-lj1WhKZSBN8NMqI9bgdYZ7OsYzc= because it is attached to AutoScalingGroup dcarley-tsuru-sslproxy-asg\r\n    * Cannot delete launch configuration terraform-lpuvad7RYsnJrKSNRq2S7ckT09Q= because it is attached to AutoScalingGroup dcarley-tsuru-router-asg"},"comment":{"url":"https://api.github.com/repos/alphagov/tsuru-terraform/issues/comments/99876716","html_url":"https://github.com/alphagov/tsuru-terraform/pull/41#issuecomment-99876716","issue_url":"https://api.github.com/repos/alphagov/tsuru-terraform/issues/41","id":99876716,"user":{"login":"annashipman","id":719118,"avatar_url":"https://avatars.githubusercontent.com/u/719118?v=3","gravatar_id":"","url":"https://api.github.com/users/annashipman","html_url":"https://github.com/annashipman","followers_url":"https://api.github.com/users/annashipman/followers","following_url":"https://api.github.com/users/annashipman/following{/other_user}","gists_url":"https://api.github.com/users/annashipman/gists{/gist_id}","starred_url":"https://api.github.com/users/annashipman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annashipman/subscriptions","organizations_url":"https://api.github.com/users/annashipman/orgs","repos_url":"https://api.github.com/users/annashipman/repos","events_url":"https://api.github.com/users/annashipman/events{/privacy}","received_events_url":"https://api.github.com/users/annashipman/received_events","type":"User","site_admin":false},"created_at":"2015-05-07T13:55:54Z","updated_at":"2015-05-07T13:55:54Z","body":"I meant to say - sound good? If there are any objections to merging this PR now, let me know.."}}