{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/92931496","pull_request_review_id":13455308,"id":92931496,"diff_hunk":"@@ -221,6 +254,21 @@ func (l *logStream) create() error {\n \treturn err\n }\n \n+// create creates log group and log stream for the instance of the awslogs logging driver\n+func (l *logStream) create() error {","path":"daemon/logger/awslogs/cloudwatchlogs.go","position":111,"original_position":111,"commit_id":"9e1f1cf77e925e5fb5bfc4216ac737fe129d70d6","original_commit_id":"9e1f1cf77e925e5fb5bfc4216ac737fe129d70d6","user":{"login":"samuelkarp","id":737750,"avatar_url":"https://avatars.githubusercontent.com/u/737750?v=3","gravatar_id":"","url":"https://api.github.com/users/samuelkarp","html_url":"https://github.com/samuelkarp","followers_url":"https://api.github.com/users/samuelkarp/followers","following_url":"https://api.github.com/users/samuelkarp/following{/other_user}","gists_url":"https://api.github.com/users/samuelkarp/gists{/gist_id}","starred_url":"https://api.github.com/users/samuelkarp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuelkarp/subscriptions","organizations_url":"https://api.github.com/users/samuelkarp/orgs","repos_url":"https://api.github.com/users/samuelkarp/repos","events_url":"https://api.github.com/users/samuelkarp/events{/privacy}","received_events_url":"https://api.github.com/users/samuelkarp/received_events","type":"User","site_admin":false},"body":"nit: Can you move `create()` above `createLogGroup()` just though things are ordered roughly caller above callee?","created_at":"2016-12-18T00:21:49Z","updated_at":"2016-12-18T00:29:09Z","html_url":"https://github.com/docker/docker/pull/29504#discussion_r92931496","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/29504","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/92931496"},"html":{"href":"https://github.com/docker/docker/pull/29504#discussion_r92931496"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/29504"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/29504","id":98459596,"html_url":"https://github.com/docker/docker/pull/29504","diff_url":"https://github.com/docker/docker/pull/29504.diff","patch_url":"https://github.com/docker/docker/pull/29504.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/29504","number":29504,"state":"open","locked":false,"title":"Support of CreateLogGroup for awslogs","user":{"login":"yongtang","id":6932348,"avatar_url":"https://avatars.githubusercontent.com/u/6932348?v=3","gravatar_id":"","url":"https://api.github.com/users/yongtang","html_url":"https://github.com/yongtang","followers_url":"https://api.github.com/users/yongtang/followers","following_url":"https://api.github.com/users/yongtang/following{/other_user}","gists_url":"https://api.github.com/users/yongtang/gists{/gist_id}","starred_url":"https://api.github.com/users/yongtang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongtang/subscriptions","organizations_url":"https://api.github.com/users/yongtang/orgs","repos_url":"https://api.github.com/users/yongtang/repos","events_url":"https://api.github.com/users/yongtang/events{/privacy}","received_events_url":"https://api.github.com/users/yongtang/received_events","type":"User","site_admin":false},"body":"**- What I did**\r\n\r\nThis fix tries to address the issue raised in #29334 where it was not possible to create log group for awslogs (CloudWatch) on-demand. Log group has to be created explicitly before container is running.\r\n\r\nThis behavior is inconsistent with AWS logs agent where log groups are always created as needed.\r\n\r\nThere were several concerns previously (See comments in #19617 and #29334):\r\n1. There is a limit of 500 log groups/account/region so resource might be exhausted if there is any typo or incorrect region.\r\n2. Logs are generated for every container so CreateLogGroup (or equally, DescribeLogGroups) might be called every time, which is redundant and potentially surprising.\r\n3. CreateLogStream and CreateLogGroup have different IAM policies.\r\n\r\n**- How I did it**\r\n\r\nThis fix addresses the issue by add `--log-opt awslogs-create-group=<true|false>` which by default is `false`. It requires user to explicitly request that log groups be created as needed.\r\n\r\n**- How to verify it**\r\n\r\nRelated unit test has been updated. And tests have also been done manually in AWS.\r\n\r\n**- Description for the changelog**\r\n\r\nAdd `--log-opt awslogs-create-group=<true|false>` for awslogs (CloudWatch) to support creation of log groups as needed.\r\n\r\n**- A picture of a cute animal (not mandatory but encouraged)**\r\n\r\n![ginger-kitten-33354-1920x1200](https://cloud.githubusercontent.com/assets/6932348/21290435/0a689f40-c46f-11e6-8675-cb7cf9695d07.jpg)\r\n\r\nThis fix fixes #29334.\r\n\r\nSigned-off-by: Yong Tang <yong.tang.github@outlook.com>","created_at":"2016-12-17T23:41:58Z","updated_at":"2016-12-18T00:29:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c48a7e05f13bb76ccce40b4d3901af61066621b7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/29504/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/29504/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/29504/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/9e1f1cf77e925e5fb5bfc4216ac737fe129d70d6","head":{"label":"yongtang:29334-awslogs-CreateLogGroup","ref":"29334-awslogs-CreateLogGroup","sha":"9e1f1cf77e925e5fb5bfc4216ac737fe129d70d6","user":{"login":"yongtang","id":6932348,"avatar_url":"https://avatars.githubusercontent.com/u/6932348?v=3","gravatar_id":"","url":"https://api.github.com/users/yongtang","html_url":"https://github.com/yongtang","followers_url":"https://api.github.com/users/yongtang/followers","following_url":"https://api.github.com/users/yongtang/following{/other_user}","gists_url":"https://api.github.com/users/yongtang/gists{/gist_id}","starred_url":"https://api.github.com/users/yongtang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongtang/subscriptions","organizations_url":"https://api.github.com/users/yongtang/orgs","repos_url":"https://api.github.com/users/yongtang/repos","events_url":"https://api.github.com/users/yongtang/events{/privacy}","received_events_url":"https://api.github.com/users/yongtang/received_events","type":"User","site_admin":false},"repo":{"id":53518876,"name":"docker","full_name":"yongtang/docker","owner":{"login":"yongtang","id":6932348,"avatar_url":"https://avatars.githubusercontent.com/u/6932348?v=3","gravatar_id":"","url":"https://api.github.com/users/yongtang","html_url":"https://github.com/yongtang","followers_url":"https://api.github.com/users/yongtang/followers","following_url":"https://api.github.com/users/yongtang/following{/other_user}","gists_url":"https://api.github.com/users/yongtang/gists{/gist_id}","starred_url":"https://api.github.com/users/yongtang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongtang/subscriptions","organizations_url":"https://api.github.com/users/yongtang/orgs","repos_url":"https://api.github.com/users/yongtang/repos","events_url":"https://api.github.com/users/yongtang/events{/privacy}","received_events_url":"https://api.github.com/users/yongtang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yongtang/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/yongtang/docker","forks_url":"https://api.github.com/repos/yongtang/docker/forks","keys_url":"https://api.github.com/repos/yongtang/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yongtang/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yongtang/docker/teams","hooks_url":"https://api.github.com/repos/yongtang/docker/hooks","issue_events_url":"https://api.github.com/repos/yongtang/docker/issues/events{/number}","events_url":"https://api.github.com/repos/yongtang/docker/events","assignees_url":"https://api.github.com/repos/yongtang/docker/assignees{/user}","branches_url":"https://api.github.com/repos/yongtang/docker/branches{/branch}","tags_url":"https://api.github.com/repos/yongtang/docker/tags","blobs_url":"https://api.github.com/repos/yongtang/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yongtang/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yongtang/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/yongtang/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yongtang/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/yongtang/docker/languages","stargazers_url":"https://api.github.com/repos/yongtang/docker/stargazers","contributors_url":"https://api.github.com/repos/yongtang/docker/contributors","subscribers_url":"https://api.github.com/repos/yongtang/docker/subscribers","subscription_url":"https://api.github.com/repos/yongtang/docker/subscription","commits_url":"https://api.github.com/repos/yongtang/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/yongtang/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/yongtang/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/yongtang/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/yongtang/docker/contents/{+path}","compare_url":"https://api.github.com/repos/yongtang/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yongtang/docker/merges","archive_url":"https://api.github.com/repos/yongtang/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yongtang/docker/downloads","issues_url":"https://api.github.com/repos/yongtang/docker/issues{/number}","pulls_url":"https://api.github.com/repos/yongtang/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/yongtang/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/yongtang/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yongtang/docker/labels{/name}","releases_url":"https://api.github.com/repos/yongtang/docker/releases{/id}","deployments_url":"https://api.github.com/repos/yongtang/docker/deployments","created_at":"2016-03-09T17:51:45Z","updated_at":"2016-03-09T17:51:56Z","pushed_at":"2016-12-18T00:27:17Z","git_url":"git://github.com/yongtang/docker.git","ssh_url":"git@github.com:yongtang/docker.git","clone_url":"https://github.com/yongtang/docker.git","svn_url":"https://github.com/yongtang/docker","homepage":"http://www.docker.com","size":114371,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"ee88de7385e374b05feaa510107513fbffbf3aad","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","deployments_url":"https://api.github.com/repos/docker/docker/deployments","created_at":"2013-01-18T18:10:57Z","updated_at":"2016-12-17T23:11:24Z","pushed_at":"2016-12-18T00:27:19Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":118660,"stargazers_count":37892,"watchers_count":37892,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11292,"mirror_url":null,"open_issues_count":2028,"forks":11292,"open_issues":2028,"watchers":37892,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/29504"},"html":{"href":"https://github.com/docker/docker/pull/29504"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/29504"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/29504/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/29504/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/29504/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/9e1f1cf77e925e5fb5bfc4216ac737fe129d70d6"}}}}
{"actor":{"display_login":"samuelkarp"}}