{"action":"created","comment":{"url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/pulls/comments/100833818","pull_request_review_id":21531831,"id":100833818,"diff_hunk":"@@ -0,0 +1,91 @@\n+provider \"aws\" {\n+  profile = \"${var.profile}\" # Assumes you have valid AWS credentials.\n+  region  = \"${var.region}\"\n+}\n+\n+# --- ECS RESOURCES --- #\n+\n+resource \"aws_ecs_cluster\" \"gt-site-cluster\" {\n+  name = \"gt-site-cluster\"\n+\n+  lifecycle {\n+    create_before_destroy = true\n+  }\n+}\n+\n+# `containers.json` is analogous to `docker-compose.yml`.\n+# All the container settings are there.\n+resource \"aws_ecs_task_definition\" \"gt-site-cluster-task\" {\n+  family                = \"gt-site-cluster\"\n+  container_definitions = \"${file(\"containers.json\")}\"\n+}\n+\n+resource \"aws_ecs_service\" \"gt-site-cluster-service\" {\n+  name                               = \"gt-site-cluster\"\n+  cluster                            = \"${aws_ecs_cluster.gt-site-cluster.id}\"\n+  task_definition                    = \"${aws_ecs_task_definition.gt-site-cluster-task.family}:${aws_ecs_task_definition.gt-site-cluster-task.revision}\"\n+  desired_count                      = \"${var.desired_instance_count}\"\n+  iam_role                           = \"${var.ecs_service_role}\"\n+  deployment_minimum_healthy_percent = \"0\"\n+  deployment_maximum_percent         = \"100\"\n+\n+  load_balancer {\n+    elb_name       = \"${aws_elb.gt-site-elb.name}\"\n+    container_name = \"gtsite-nginx\"\n+    container_port = 8080\n+  }\n+}\n+\n+# A load balancer is necessary to launch the EC2 manager instance properly.\n+resource \"aws_elb\" \"gt-site-elb\" {\n+  subnets = [\"${var.subnet_id}\"]\n+\n+  listener {\n+    lb_port           = 80\n+    lb_protocol       = \"HTTP\"\n+    instance_port     = 8080   # The port that the nginx container is listening on.\n+    instance_protocol = \"HTTP\"\n+  }\n+\n+  cross_zone_load_balancing = false\n+  idle_timeout              = 3600\n+\n+  tags {\n+    Name = \"gt-site-cluster elb\"\n+  }\n+}\n+\n+resource \"aws_launch_configuration\" \"ecs\" {\n+  name                 = \"ECS ${aws_ecs_cluster.gt-site-cluster.name}\"\n+  image_id             = \"${var.aws_ecs_ami}\"\n+  instance_type        = \"${var.ec2_instance_type}\"\n+  iam_instance_profile = \"${var.ecs_instance_profile}\"\n+\n+  key_name                    = \"${var.ec2_key}\"\n+  associate_public_ip_address = true\n+  user_data                   = \"#!/bin/bash\\necho ECS_CLUSTER='${aws_ecs_cluster.gt-site-cluster.name}' > /etc/ecs/ecs.config\"\n+}\n+\n+resource \"aws_autoscaling_group\" \"ecs\" {\n+  lifecycle {\n+    create_before_destroy = true\n+  }\n+\n+  # Explicitly linking ASG and launch configuration by name\n+  # to force replacement on launch configuration changes.\n+  name = \"${aws_launch_configuration.ecs.name}\"\n+\n+  launch_configuration      = \"${aws_launch_configuration.ecs.name}\"\n+  health_check_grace_period = 600\n+  health_check_type         = \"EC2\"\n+  desired_capacity          = \"${var.desired_instance_count}\"\n+  min_size                  = \"${var.desired_instance_count}\"\n+  max_size                  = \"${var.desired_instance_count}\"\n+  vpc_zone_identifier       = [\"${var.subnet_id}\"]\n+","path":"terraform/gt-site.tf","position":85,"original_position":85,"commit_id":"2125a0e7ccbdc47c15fc12d1b221f91337816caa","original_commit_id":"2125a0e7ccbdc47c15fc12d1b221f91337816caa","user":{"login":"hectcastro","id":43639,"avatar_url":"https://avatars.githubusercontent.com/u/43639?v=3","gravatar_id":"","url":"https://api.github.com/users/hectcastro","html_url":"https://github.com/hectcastro","followers_url":"https://api.github.com/users/hectcastro/followers","following_url":"https://api.github.com/users/hectcastro/following{/other_user}","gists_url":"https://api.github.com/users/hectcastro/gists{/gist_id}","starred_url":"https://api.github.com/users/hectcastro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hectcastro/subscriptions","organizations_url":"https://api.github.com/users/hectcastro/orgs","repos_url":"https://api.github.com/users/hectcastro/repos","events_url":"https://api.github.com/users/hectcastro/events{/privacy}","received_events_url":"https://api.github.com/users/hectcastro/received_events","type":"User","site_admin":false},"body":"We should include an `enabled_metrics` attribute here that looks like:\r\n\r\n```hcl\r\n  enabled_metrics = [\r\n    \"GroupMinSize\",\r\n    \"GroupMaxSize\",\r\n    \"GroupDesiredCapacity\",\r\n    \"GroupInServiceInstances\",\r\n    \"GroupPendingInstances\",\r\n    \"GroupStandbyInstances\",\r\n    \"GroupTerminatingInstances\",\r\n    \"GroupTotalInstances\",\r\n  ]\r\n```","created_at":"2017-02-13T16:26:37Z","updated_at":"2017-02-13T16:42:49Z","html_url":"https://github.com/fosskers/geotrellis-site-deployment/pull/1#discussion_r100833818","pull_request_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/pulls/comments/100833818"},"html":{"href":"https://github.com/fosskers/geotrellis-site-deployment/pull/1#discussion_r100833818"},"pull_request":{"href":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/pulls/1","id":105671327,"html_url":"https://github.com/fosskers/geotrellis-site-deployment/pull/1","diff_url":"https://github.com/fosskers/geotrellis-site-deployment/pull/1.diff","patch_url":"https://github.com/fosskers/geotrellis-site-deployment/pull/1.patch","issue_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/issues/1","number":1,"state":"open","locked":false,"title":"Provide a working setup","user":{"login":"fosskers","id":229679,"avatar_url":"https://avatars.githubusercontent.com/u/229679?v=3","gravatar_id":"","url":"https://api.github.com/users/fosskers","html_url":"https://github.com/fosskers","followers_url":"https://api.github.com/users/fosskers/followers","following_url":"https://api.github.com/users/fosskers/following{/other_user}","gists_url":"https://api.github.com/users/fosskers/gists{/gist_id}","starred_url":"https://api.github.com/users/fosskers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fosskers/subscriptions","organizations_url":"https://api.github.com/users/fosskers/orgs","repos_url":"https://api.github.com/users/fosskers/repos","events_url":"https://api.github.com/users/fosskers/events{/privacy}","received_events_url":"https://api.github.com/users/fosskers/received_events","type":"User","site_admin":false},"body":"### TODO\r\n- [x] `docker-compose` config\r\n- [x] Vagrant config\r\n- [x] Terraform config\r\n- [x] Scripts\r\n- [x] README\r\n- [x] Testing\r\n- [ ] docker images to quay\r\n- [ ] Deal with feedback\r\n\r\n### Motivation\r\nThis brings our website and demo deployment under one unified configuration. All demos and their API calls are also managed by a single nginx, with Transit now available under `http://<host>/transit/` and Chatta under `http://<host>/chatta/`.\r\n\r\nFurther long-lived demos should be added in a similar way.","created_at":"2017-02-10T17:30:01Z","updated_at":"2017-02-13T16:42:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"607128f9eb26ef768c9c46d78f59a4d68829a0c4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/pulls/1/commits","review_comments_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/pulls/1/comments","review_comment_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/issues/1/comments","statuses_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/statuses/2125a0e7ccbdc47c15fc12d1b221f91337816caa","head":{"label":"fosskers:develop","ref":"develop","sha":"2125a0e7ccbdc47c15fc12d1b221f91337816caa","user":{"login":"fosskers","id":229679,"avatar_url":"https://avatars.githubusercontent.com/u/229679?v=3","gravatar_id":"","url":"https://api.github.com/users/fosskers","html_url":"https://github.com/fosskers","followers_url":"https://api.github.com/users/fosskers/followers","following_url":"https://api.github.com/users/fosskers/following{/other_user}","gists_url":"https://api.github.com/users/fosskers/gists{/gist_id}","starred_url":"https://api.github.com/users/fosskers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fosskers/subscriptions","organizations_url":"https://api.github.com/users/fosskers/orgs","repos_url":"https://api.github.com/users/fosskers/repos","events_url":"https://api.github.com/users/fosskers/events{/privacy}","received_events_url":"https://api.github.com/users/fosskers/received_events","type":"User","site_admin":false},"repo":{"id":80562061,"name":"geotrellis-site-deployment","full_name":"fosskers/geotrellis-site-deployment","owner":{"login":"fosskers","id":229679,"avatar_url":"https://avatars.githubusercontent.com/u/229679?v=3","gravatar_id":"","url":"https://api.github.com/users/fosskers","html_url":"https://github.com/fosskers","followers_url":"https://api.github.com/users/fosskers/followers","following_url":"https://api.github.com/users/fosskers/following{/other_user}","gists_url":"https://api.github.com/users/fosskers/gists{/gist_id}","starred_url":"https://api.github.com/users/fosskers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fosskers/subscriptions","organizations_url":"https://api.github.com/users/fosskers/orgs","repos_url":"https://api.github.com/users/fosskers/repos","events_url":"https://api.github.com/users/fosskers/events{/privacy}","received_events_url":"https://api.github.com/users/fosskers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fosskers/geotrellis-site-deployment","description":"A unified deployment story for geotrellis.io and its corresponding demos.","fork":false,"url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment","forks_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/forks","keys_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/teams","hooks_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/hooks","issue_events_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/issues/events{/number}","events_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/events","assignees_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/assignees{/user}","branches_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/branches{/branch}","tags_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/tags","blobs_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/git/refs{/sha}","trees_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/statuses/{sha}","languages_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/languages","stargazers_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/stargazers","contributors_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/contributors","subscribers_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/subscribers","subscription_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/subscription","commits_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/commits{/sha}","git_commits_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/git/commits{/sha}","comments_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/comments{/number}","issue_comment_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/issues/comments{/number}","contents_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/contents/{+path}","compare_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/merges","archive_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/downloads","issues_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/issues{/number}","pulls_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/pulls{/number}","milestones_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/milestones{/number}","notifications_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/labels{/name}","releases_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/releases{/id}","deployments_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/deployments","created_at":"2017-01-31T21:03:31Z","updated_at":"2017-02-10T17:26:16Z","pushed_at":"2017-02-10T17:30:02Z","git_url":"git://github.com/fosskers/geotrellis-site-deployment.git","ssh_url":"git@github.com:fosskers/geotrellis-site-deployment.git","clone_url":"https://github.com/fosskers/geotrellis-site-deployment.git","svn_url":"https://github.com/fosskers/geotrellis-site-deployment","homepage":"","size":6,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"fosskers:master","ref":"master","sha":"907209c67f74c2da1bbc01dcfa9339be0346b12f","user":{"login":"fosskers","id":229679,"avatar_url":"https://avatars.githubusercontent.com/u/229679?v=3","gravatar_id":"","url":"https://api.github.com/users/fosskers","html_url":"https://github.com/fosskers","followers_url":"https://api.github.com/users/fosskers/followers","following_url":"https://api.github.com/users/fosskers/following{/other_user}","gists_url":"https://api.github.com/users/fosskers/gists{/gist_id}","starred_url":"https://api.github.com/users/fosskers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fosskers/subscriptions","organizations_url":"https://api.github.com/users/fosskers/orgs","repos_url":"https://api.github.com/users/fosskers/repos","events_url":"https://api.github.com/users/fosskers/events{/privacy}","received_events_url":"https://api.github.com/users/fosskers/received_events","type":"User","site_admin":false},"repo":{"id":80562061,"name":"geotrellis-site-deployment","full_name":"fosskers/geotrellis-site-deployment","owner":{"login":"fosskers","id":229679,"avatar_url":"https://avatars.githubusercontent.com/u/229679?v=3","gravatar_id":"","url":"https://api.github.com/users/fosskers","html_url":"https://github.com/fosskers","followers_url":"https://api.github.com/users/fosskers/followers","following_url":"https://api.github.com/users/fosskers/following{/other_user}","gists_url":"https://api.github.com/users/fosskers/gists{/gist_id}","starred_url":"https://api.github.com/users/fosskers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fosskers/subscriptions","organizations_url":"https://api.github.com/users/fosskers/orgs","repos_url":"https://api.github.com/users/fosskers/repos","events_url":"https://api.github.com/users/fosskers/events{/privacy}","received_events_url":"https://api.github.com/users/fosskers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fosskers/geotrellis-site-deployment","description":"A unified deployment story for geotrellis.io and its corresponding demos.","fork":false,"url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment","forks_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/forks","keys_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/teams","hooks_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/hooks","issue_events_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/issues/events{/number}","events_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/events","assignees_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/assignees{/user}","branches_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/branches{/branch}","tags_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/tags","blobs_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/git/refs{/sha}","trees_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/statuses/{sha}","languages_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/languages","stargazers_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/stargazers","contributors_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/contributors","subscribers_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/subscribers","subscription_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/subscription","commits_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/commits{/sha}","git_commits_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/git/commits{/sha}","comments_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/comments{/number}","issue_comment_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/issues/comments{/number}","contents_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/contents/{+path}","compare_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/merges","archive_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/downloads","issues_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/issues{/number}","pulls_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/pulls{/number}","milestones_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/milestones{/number}","notifications_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/labels{/name}","releases_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/releases{/id}","deployments_url":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/deployments","created_at":"2017-01-31T21:03:31Z","updated_at":"2017-02-10T17:26:16Z","pushed_at":"2017-02-10T17:30:02Z","git_url":"git://github.com/fosskers/geotrellis-site-deployment.git","ssh_url":"git@github.com:fosskers/geotrellis-site-deployment.git","clone_url":"https://github.com/fosskers/geotrellis-site-deployment.git","svn_url":"https://github.com/fosskers/geotrellis-site-deployment","homepage":"","size":6,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/pulls/1"},"html":{"href":"https://github.com/fosskers/geotrellis-site-deployment/pull/1"},"issue":{"href":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/issues/1"},"comments":{"href":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/fosskers/geotrellis-site-deployment/statuses/2125a0e7ccbdc47c15fc12d1b221f91337816caa"}}}}
{"actor":{"display_login":"hectcastro"}}