{"action":"created","comment":{"url":"https://api.github.com/repos/ZimbraOS/zm-aws/pulls/comments/186154659","pull_request_review_id":117692877,"id":186154659,"diff_hunk":"@@ -1,44 +1,74 @@\n resource \"aws_alb\" \"app\" {\n-  name               = \"${local.env_prefix_d}app\"\n+  name               = \"${local.env_prefix_d}alb-app\"\n   subnets            = [\"${local.public_subnet_ids}\"]\n   load_balancer_type = \"application\"\n-\n-  security_groups = [\"${aws_security_group.app.id}\"]\n+  \n+  security_groups = [\"${aws_security_group.alb.id}\"]\n \n   enable_deletion_protection = true\n \n-  listener {\n-    ssl_certificate_id = \"${local.app_certificate_id}\"\n-    lb_port            = 443\n-    lb_protocol        = \"https\"\n-    instance_port      = 443\n-    instance_protocol  = \"https\"\n+  tags {\n+    Name        = \"${local.environment}_alb_app\"\n+    Environment = \"${local.environment}\"\n+    Project     = \"blockchain\"\n   }\n+}\n \n-  listener {\n-    ssl_certificate_id = \"${local.app_certificate_id}\"\n-    lb_port            = 8443\n-    lb_protocol        = \"https\"\n-    instance_port      = 8081\n-    instance_protocol  = \"http\"\n+################################################################################## Listeners\n+resource \"aws_alb_listener\" \"zimbra_core\" {  \n+  load_balancer_arn = \"${aws_alb.app.arn}\"  \n+  port              = \"8443\"  \n+  protocol          = \"HTTPS\"\n+  certificate_arn   = \"${local.app_certificate_id}\"\n+  \n+  default_action {    \n+    target_group_arn = \"${aws_alb_target_group.zimbra_core.arn}\"\n+    type             = \"forward\"  \n   }\n+}\n \n-  health_check {\n-    healthy_threshold   = 2\n-    unhealthy_threshold = 8\n-    timeout             = 30\n-    target              = \"HTTPS:443/\"\n-    interval            = 60\n+################################################################################## Listener rules\n+resource \"aws_alb_listener_rule\" \"zimbra_core\" {\n+  depends_on   = [\"aws_alb_target_group.zimbra_core\"]  \n+  listener_arn = \"${aws_alb_listener.zimbra_core.arn}\"\n+  action {    \n+    type             = \"forward\"    \n+    target_group_arn = \"${aws_alb_target_group.zimbra_core.id}\"  \n+  }   \n+  condition {    \n+    field  = \"path-pattern\"    \n+    values = [\"/\"]  \n   }\n+}\n \n-  tags {\n-    Name        = \"${local.environment}_elb_app\"\n-    Environment = \"${local.environment}\"\n-    Project     = \"blockchain\"\n+################################################################################## Target groups\n+resource \"aws_alb_target_group\" \"zimbra_core\" {  \n+  name     = \"${local.env_prefix_d}tg-zimbra-core\"\n+  port     = 8443\n+  protocol = \"HTTPS\"  \n+  vpc_id = \"${local.vpc_id}\"   \n+\n+ \n+  health_check {    \n+    healthy_threshold   = 5    \n+    unhealthy_threshold = 2    \n+    timeout             = 5    \n+    interval            = 30    \n+    path                = \"/\"    \n+    port                = 8443\n+    protocol            = \"HTTPS\"\n   }\n }\n \n-resource \"aws_lb_listener_certificate\" \"https\" {\n-  listener_arn    = \"${aws_lb_listener.app.arn}\"\n-  certificate_arn = \"${local.app_certificate_id}\"\n-}\n+################################################################################## Target group endpoints (targets)\n+resource \"aws_alb_target_group_attachment\" \"zimbra_core_managers\" {\n+  target_group_arn = \"${aws_alb_target_group.zimbra_core.arn}\"\n+  \n+  # tested it works but just bind a manager_0\n+  #target_id     = \"${element(local.manager_instance_ids, count.index)}\" \n+\n+  #no tested yet, we need three managers nodes to be binded\n+  target_id = \"${element(split(\",\", local.manager_instance_ids_string), count.index)}\"","path":"zimbrax/modules/app/load-balancer.tf","position":100,"original_position":100,"commit_id":"216c353fb0335debfbf2c5df4b9de0af6096ca02","original_commit_id":"216c353fb0335debfbf2c5df4b9de0af6096ca02","user":{"login":"spoon16","id":123686,"avatar_url":"https://avatars3.githubusercontent.com/u/123686?v=4","gravatar_id":"","url":"https://api.github.com/users/spoon16","html_url":"https://github.com/spoon16","followers_url":"https://api.github.com/users/spoon16/followers","following_url":"https://api.github.com/users/spoon16/following{/other_user}","gists_url":"https://api.github.com/users/spoon16/gists{/gist_id}","starred_url":"https://api.github.com/users/spoon16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spoon16/subscriptions","organizations_url":"https://api.github.com/users/spoon16/orgs","repos_url":"https://api.github.com/users/spoon16/repos","events_url":"https://api.github.com/users/spoon16/events{/privacy}","received_events_url":"https://api.github.com/users/spoon16/received_events","type":"User","site_admin":false},"body":"I want this to point at the ASG of workers... not the managers. The managers cluster is not as scalable or highly available as the workers group.","created_at":"2018-05-04T17:36:44Z","updated_at":"2018-05-04T17:36:59Z","html_url":"https://github.com/ZimbraOS/zm-aws/pull/1#discussion_r186154659","pull_request_url":"https://api.github.com/repos/ZimbraOS/zm-aws/pulls/1","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ZimbraOS/zm-aws/pulls/comments/186154659"},"html":{"href":"https://github.com/ZimbraOS/zm-aws/pull/1#discussion_r186154659"},"pull_request":{"href":"https://api.github.com/repos/ZimbraOS/zm-aws/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/ZimbraOS/zm-aws/pulls/1","id":185865445,"html_url":"https://github.com/ZimbraOS/zm-aws/pull/1","diff_url":"https://github.com/ZimbraOS/zm-aws/pull/1.diff","patch_url":"https://github.com/ZimbraOS/zm-aws/pull/1.patch","issue_url":"https://api.github.com/repos/ZimbraOS/zm-aws/issues/1","number":1,"state":"open","locked":false,"title":"first try to add and ALB into the deploy","user":{"login":"jnambo","id":32464901,"avatar_url":"https://avatars0.githubusercontent.com/u/32464901?v=4","gravatar_id":"","url":"https://api.github.com/users/jnambo","html_url":"https://github.com/jnambo","followers_url":"https://api.github.com/users/jnambo/followers","following_url":"https://api.github.com/users/jnambo/following{/other_user}","gists_url":"https://api.github.com/users/jnambo/gists{/gist_id}","starred_url":"https://api.github.com/users/jnambo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnambo/subscriptions","organizations_url":"https://api.github.com/users/jnambo/orgs","repos_url":"https://api.github.com/users/jnambo/repos","events_url":"https://api.github.com/users/jnambo/events{/privacy}","received_events_url":"https://api.github.com/users/jnambo/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-03T23:45:30Z","updated_at":"2018-05-04T17:36:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c112128ddab16fed9e1a51b7b8862d850d87390","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ZimbraOS/zm-aws/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ZimbraOS/zm-aws/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ZimbraOS/zm-aws/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ZimbraOS/zm-aws/issues/1/comments","statuses_url":"https://api.github.com/repos/ZimbraOS/zm-aws/statuses/216c353fb0335debfbf2c5df4b9de0af6096ca02","head":{"label":"ZimbraOS:ALB","ref":"ALB","sha":"216c353fb0335debfbf2c5df4b9de0af6096ca02","user":{"login":"ZimbraOS","id":38531913,"avatar_url":"https://avatars0.githubusercontent.com/u/38531913?v=4","gravatar_id":"","url":"https://api.github.com/users/ZimbraOS","html_url":"https://github.com/ZimbraOS","followers_url":"https://api.github.com/users/ZimbraOS/followers","following_url":"https://api.github.com/users/ZimbraOS/following{/other_user}","gists_url":"https://api.github.com/users/ZimbraOS/gists{/gist_id}","starred_url":"https://api.github.com/users/ZimbraOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZimbraOS/subscriptions","organizations_url":"https://api.github.com/users/ZimbraOS/orgs","repos_url":"https://api.github.com/users/ZimbraOS/repos","events_url":"https://api.github.com/users/ZimbraOS/events{/privacy}","received_events_url":"https://api.github.com/users/ZimbraOS/received_events","type":"Organization","site_admin":false},"repo":{"id":131563586,"name":"zm-aws","full_name":"ZimbraOS/zm-aws","owner":{"login":"ZimbraOS","id":38531913,"avatar_url":"https://avatars0.githubusercontent.com/u/38531913?v=4","gravatar_id":"","url":"https://api.github.com/users/ZimbraOS","html_url":"https://github.com/ZimbraOS","followers_url":"https://api.github.com/users/ZimbraOS/followers","following_url":"https://api.github.com/users/ZimbraOS/following{/other_user}","gists_url":"https://api.github.com/users/ZimbraOS/gists{/gist_id}","starred_url":"https://api.github.com/users/ZimbraOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZimbraOS/subscriptions","organizations_url":"https://api.github.com/users/ZimbraOS/orgs","repos_url":"https://api.github.com/users/ZimbraOS/repos","events_url":"https://api.github.com/users/ZimbraOS/events{/privacy}","received_events_url":"https://api.github.com/users/ZimbraOS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ZimbraOS/zm-aws","description":null,"fork":false,"url":"https://api.github.com/repos/ZimbraOS/zm-aws","forks_url":"https://api.github.com/repos/ZimbraOS/zm-aws/forks","keys_url":"https://api.github.com/repos/ZimbraOS/zm-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ZimbraOS/zm-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ZimbraOS/zm-aws/teams","hooks_url":"https://api.github.com/repos/ZimbraOS/zm-aws/hooks","issue_events_url":"https://api.github.com/repos/ZimbraOS/zm-aws/issues/events{/number}","events_url":"https://api.github.com/repos/ZimbraOS/zm-aws/events","assignees_url":"https://api.github.com/repos/ZimbraOS/zm-aws/assignees{/user}","branches_url":"https://api.github.com/repos/ZimbraOS/zm-aws/branches{/branch}","tags_url":"https://api.github.com/repos/ZimbraOS/zm-aws/tags","blobs_url":"https://api.github.com/repos/ZimbraOS/zm-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ZimbraOS/zm-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ZimbraOS/zm-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/ZimbraOS/zm-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ZimbraOS/zm-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/ZimbraOS/zm-aws/languages","stargazers_url":"https://api.github.com/repos/ZimbraOS/zm-aws/stargazers","contributors_url":"https://api.github.com/repos/ZimbraOS/zm-aws/contributors","subscribers_url":"https://api.github.com/repos/ZimbraOS/zm-aws/subscribers","subscription_url":"https://api.github.com/repos/ZimbraOS/zm-aws/subscription","commits_url":"https://api.github.com/repos/ZimbraOS/zm-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/ZimbraOS/zm-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/ZimbraOS/zm-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/ZimbraOS/zm-aws/issues/comments{/number}","contents_url":"https://api.github.com/repos/ZimbraOS/zm-aws/contents/{+path}","compare_url":"https://api.github.com/repos/ZimbraOS/zm-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ZimbraOS/zm-aws/merges","archive_url":"https://api.github.com/repos/ZimbraOS/zm-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ZimbraOS/zm-aws/downloads","issues_url":"https://api.github.com/repos/ZimbraOS/zm-aws/issues{/number}","pulls_url":"https://api.github.com/repos/ZimbraOS/zm-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/ZimbraOS/zm-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/ZimbraOS/zm-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ZimbraOS/zm-aws/labels{/name}","releases_url":"https://api.github.com/repos/ZimbraOS/zm-aws/releases{/id}","deployments_url":"https://api.github.com/repos/ZimbraOS/zm-aws/deployments","created_at":"2018-04-30T06:36:26Z","updated_at":"2018-04-30T19:17:05Z","pushed_at":"2018-05-04T05:32:46Z","git_url":"git://github.com/ZimbraOS/zm-aws.git","ssh_url":"git@github.com:ZimbraOS/zm-aws.git","clone_url":"https://github.com/ZimbraOS/zm-aws.git","svn_url":"https://github.com/ZimbraOS/zm-aws","homepage":null,"size":26,"stargazers_count":0,"watchers_count":0,"language":"HCL","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ZimbraOS:master","ref":"master","sha":"e0ca8a2709264728548cc9fc9add4db1fc4fa54a","user":{"login":"ZimbraOS","id":38531913,"avatar_url":"https://avatars0.githubusercontent.com/u/38531913?v=4","gravatar_id":"","url":"https://api.github.com/users/ZimbraOS","html_url":"https://github.com/ZimbraOS","followers_url":"https://api.github.com/users/ZimbraOS/followers","following_url":"https://api.github.com/users/ZimbraOS/following{/other_user}","gists_url":"https://api.github.com/users/ZimbraOS/gists{/gist_id}","starred_url":"https://api.github.com/users/ZimbraOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZimbraOS/subscriptions","organizations_url":"https://api.github.com/users/ZimbraOS/orgs","repos_url":"https://api.github.com/users/ZimbraOS/repos","events_url":"https://api.github.com/users/ZimbraOS/events{/privacy}","received_events_url":"https://api.github.com/users/ZimbraOS/received_events","type":"Organization","site_admin":false},"repo":{"id":131563586,"name":"zm-aws","full_name":"ZimbraOS/zm-aws","owner":{"login":"ZimbraOS","id":38531913,"avatar_url":"https://avatars0.githubusercontent.com/u/38531913?v=4","gravatar_id":"","url":"https://api.github.com/users/ZimbraOS","html_url":"https://github.com/ZimbraOS","followers_url":"https://api.github.com/users/ZimbraOS/followers","following_url":"https://api.github.com/users/ZimbraOS/following{/other_user}","gists_url":"https://api.github.com/users/ZimbraOS/gists{/gist_id}","starred_url":"https://api.github.com/users/ZimbraOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZimbraOS/subscriptions","organizations_url":"https://api.github.com/users/ZimbraOS/orgs","repos_url":"https://api.github.com/users/ZimbraOS/repos","events_url":"https://api.github.com/users/ZimbraOS/events{/privacy}","received_events_url":"https://api.github.com/users/ZimbraOS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ZimbraOS/zm-aws","description":null,"fork":false,"url":"https://api.github.com/repos/ZimbraOS/zm-aws","forks_url":"https://api.github.com/repos/ZimbraOS/zm-aws/forks","keys_url":"https://api.github.com/repos/ZimbraOS/zm-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ZimbraOS/zm-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ZimbraOS/zm-aws/teams","hooks_url":"https://api.github.com/repos/ZimbraOS/zm-aws/hooks","issue_events_url":"https://api.github.com/repos/ZimbraOS/zm-aws/issues/events{/number}","events_url":"https://api.github.com/repos/ZimbraOS/zm-aws/events","assignees_url":"https://api.github.com/repos/ZimbraOS/zm-aws/assignees{/user}","branches_url":"https://api.github.com/repos/ZimbraOS/zm-aws/branches{/branch}","tags_url":"https://api.github.com/repos/ZimbraOS/zm-aws/tags","blobs_url":"https://api.github.com/repos/ZimbraOS/zm-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ZimbraOS/zm-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ZimbraOS/zm-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/ZimbraOS/zm-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ZimbraOS/zm-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/ZimbraOS/zm-aws/languages","stargazers_url":"https://api.github.com/repos/ZimbraOS/zm-aws/stargazers","contributors_url":"https://api.github.com/repos/ZimbraOS/zm-aws/contributors","subscribers_url":"https://api.github.com/repos/ZimbraOS/zm-aws/subscribers","subscription_url":"https://api.github.com/repos/ZimbraOS/zm-aws/subscription","commits_url":"https://api.github.com/repos/ZimbraOS/zm-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/ZimbraOS/zm-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/ZimbraOS/zm-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/ZimbraOS/zm-aws/issues/comments{/number}","contents_url":"https://api.github.com/repos/ZimbraOS/zm-aws/contents/{+path}","compare_url":"https://api.github.com/repos/ZimbraOS/zm-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ZimbraOS/zm-aws/merges","archive_url":"https://api.github.com/repos/ZimbraOS/zm-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ZimbraOS/zm-aws/downloads","issues_url":"https://api.github.com/repos/ZimbraOS/zm-aws/issues{/number}","pulls_url":"https://api.github.com/repos/ZimbraOS/zm-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/ZimbraOS/zm-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/ZimbraOS/zm-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ZimbraOS/zm-aws/labels{/name}","releases_url":"https://api.github.com/repos/ZimbraOS/zm-aws/releases{/id}","deployments_url":"https://api.github.com/repos/ZimbraOS/zm-aws/deployments","created_at":"2018-04-30T06:36:26Z","updated_at":"2018-04-30T19:17:05Z","pushed_at":"2018-05-04T05:32:46Z","git_url":"git://github.com/ZimbraOS/zm-aws.git","ssh_url":"git@github.com:ZimbraOS/zm-aws.git","clone_url":"https://github.com/ZimbraOS/zm-aws.git","svn_url":"https://github.com/ZimbraOS/zm-aws","homepage":null,"size":26,"stargazers_count":0,"watchers_count":0,"language":"HCL","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ZimbraOS/zm-aws/pulls/1"},"html":{"href":"https://github.com/ZimbraOS/zm-aws/pull/1"},"issue":{"href":"https://api.github.com/repos/ZimbraOS/zm-aws/issues/1"},"comments":{"href":"https://api.github.com/repos/ZimbraOS/zm-aws/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ZimbraOS/zm-aws/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ZimbraOS/zm-aws/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ZimbraOS/zm-aws/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ZimbraOS/zm-aws/statuses/216c353fb0335debfbf2c5df4b9de0af6096ca02"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"spoon16"}}