{"action":"created","comment":{"url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/pulls/comments/187991102","pull_request_review_id":119880038,"id":187991102,"diff_hunk":"@@ -13,6 +13,65 @@ module \"label\" {\n   tags       = \"${var.tags}\"\n }\n \n+resource \"aws_s3_bucket\" \"cache_bucket\" {\n+  count         = \"${var.cache_enabled == \"true\" ? 1 : 0}\"\n+  bucket        = \"${local.cache_bucket_name_normalised}\"\n+  acl           = \"private\"\n+  force_destroy = true\n+  tags          = \"${module.label.tags}\"\n+\n+  lifecycle_rule {\n+    id      = \"codebuildcache\"\n+    enabled = true\n+\n+    prefix = \"/\"\n+    tags   = \"${module.label.tags}\"\n+\n+    expiration {\n+      days = \"${var.cache_expiration_days}\"\n+    }\n+  }\n+}\n+\n+provider \"random\" {\n+  version = \"~> 1.0\"\n+}\n+\n+provider \"null\" {\n+  version = \"~> 1.0\"\n+}","path":"main.tf","position":30,"original_position":30,"commit_id":"430bbb2acd0d2aa14ac5bfc6ffc87eb1bba4ee9b","original_commit_id":"430bbb2acd0d2aa14ac5bfc6ffc87eb1bba4ee9b","user":{"login":"Jamie-BitFlight","id":25075504,"avatar_url":"https://avatars3.githubusercontent.com/u/25075504?v=4","gravatar_id":"","url":"https://api.github.com/users/Jamie-BitFlight","html_url":"https://github.com/Jamie-BitFlight","followers_url":"https://api.github.com/users/Jamie-BitFlight/followers","following_url":"https://api.github.com/users/Jamie-BitFlight/following{/other_user}","gists_url":"https://api.github.com/users/Jamie-BitFlight/gists{/gist_id}","starred_url":"https://api.github.com/users/Jamie-BitFlight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jamie-BitFlight/subscriptions","organizations_url":"https://api.github.com/users/Jamie-BitFlight/orgs","repos_url":"https://api.github.com/users/Jamie-BitFlight/repos","events_url":"https://api.github.com/users/Jamie-BitFlight/events{/privacy}","received_events_url":"https://api.github.com/users/Jamie-BitFlight/received_events","type":"User","site_admin":false},"body":"I've added them here because users using the module may not know that the warnings about the provider versions not being set come from this module, its hard to track that down.\r\nSo I have set the provider versions here, to clear warnings and follow good practice.","created_at":"2018-05-14T15:13:24Z","updated_at":"2018-05-14T15:13:25Z","html_url":"https://github.com/cloudposse/terraform-aws-codebuild/pull/16#discussion_r187991102","pull_request_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/pulls/16","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/pulls/comments/187991102"},"html":{"href":"https://github.com/cloudposse/terraform-aws-codebuild/pull/16#discussion_r187991102"},"pull_request":{"href":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/pulls/16"}},"in_reply_to_id":187987432},"pull_request":{"url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/pulls/16","id":185691380,"html_url":"https://github.com/cloudposse/terraform-aws-codebuild/pull/16","diff_url":"https://github.com/cloudposse/terraform-aws-codebuild/pull/16.diff","patch_url":"https://github.com/cloudposse/terraform-aws-codebuild/pull/16.patch","issue_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/issues/16","number":16,"state":"open","locked":false,"title":"Added an S3 cache, so that the buildspec.yml can use cache and dynamic environment vars.","user":{"login":"Jamie-BitFlight","id":25075504,"avatar_url":"https://avatars3.githubusercontent.com/u/25075504?v=4","gravatar_id":"","url":"https://api.github.com/users/Jamie-BitFlight","html_url":"https://github.com/Jamie-BitFlight","followers_url":"https://api.github.com/users/Jamie-BitFlight/followers","following_url":"https://api.github.com/users/Jamie-BitFlight/following{/other_user}","gists_url":"https://api.github.com/users/Jamie-BitFlight/gists{/gist_id}","starred_url":"https://api.github.com/users/Jamie-BitFlight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jamie-BitFlight/subscriptions","organizations_url":"https://api.github.com/users/Jamie-BitFlight/orgs","repos_url":"https://api.github.com/users/Jamie-BitFlight/repos","events_url":"https://api.github.com/users/Jamie-BitFlight/events{/privacy}","received_events_url":"https://api.github.com/users/Jamie-BitFlight/received_events","type":"User","site_admin":false},"body":"## what\r\n* cache enabled by default with cache expiry default of 7 days.\r\n* two new variables: `cache_enabled` and `cache_expiration_days`\r\n  - `cache_expiration_days` is how many days until the cache expires.\r\n  - `cache_enabled` can be `\"true\"` or `\"false\"`\r\n  - `cache_enabled` set to `\"false\"` means that buildspec doesn't use the s3 bucket for caching and no bucket is created.\r\n\r\nAdditionally, I have added the ability for new environment variables to be dynamically added.\r\nnew environment variable called `environment_variables` which can take a list of map values in the module like so:\r\n```hcl\r\n    environment_variables = [{\r\n        name  = \"JENKINS_URL\"\r\n        value = \"https://jenkins.example.com\"\r\n      },\r\n      {\r\n        name  = \"COMPANY_NAME\"\r\n        value = \"Amazon\"\r\n      },\r\n      {\r\n        name = \"TIME_ZONE\"\r\n        value = \"Pacific/Auckland\"\r\n\r\n      }]\r\n```\r\n\r\n## why\r\n* Allows the buildspec to use the `cache` section.\r\n* Allows additional build time environment variables to be added without changing the module\r\n\r\n## references\r\n* https://aws.amazon.com/blogs/devops/how-to-enable-caching-for-aws-codebuild/","created_at":"2018-05-03T11:49:29Z","updated_at":"2018-05-14T15:13:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cab6c2210b0b36fc191c565aedf33f5f014e5af8","assignee":null,"assignees":[],"requested_reviewers":[{"login":"goruha","id":496956,"avatar_url":"https://avatars1.githubusercontent.com/u/496956?v=4","gravatar_id":"","url":"https://api.github.com/users/goruha","html_url":"https://github.com/goruha","followers_url":"https://api.github.com/users/goruha/followers","following_url":"https://api.github.com/users/goruha/following{/other_user}","gists_url":"https://api.github.com/users/goruha/gists{/gist_id}","starred_url":"https://api.github.com/users/goruha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goruha/subscriptions","organizations_url":"https://api.github.com/users/goruha/orgs","repos_url":"https://api.github.com/users/goruha/repos","events_url":"https://api.github.com/users/goruha/events{/privacy}","received_events_url":"https://api.github.com/users/goruha/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/pulls/16/commits","review_comments_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/pulls/16/comments","review_comment_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/issues/16/comments","statuses_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/statuses/430bbb2acd0d2aa14ac5bfc6ffc87eb1bba4ee9b","head":{"label":"Jamie-BitFlight:master","ref":"master","sha":"430bbb2acd0d2aa14ac5bfc6ffc87eb1bba4ee9b","user":{"login":"Jamie-BitFlight","id":25075504,"avatar_url":"https://avatars3.githubusercontent.com/u/25075504?v=4","gravatar_id":"","url":"https://api.github.com/users/Jamie-BitFlight","html_url":"https://github.com/Jamie-BitFlight","followers_url":"https://api.github.com/users/Jamie-BitFlight/followers","following_url":"https://api.github.com/users/Jamie-BitFlight/following{/other_user}","gists_url":"https://api.github.com/users/Jamie-BitFlight/gists{/gist_id}","starred_url":"https://api.github.com/users/Jamie-BitFlight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jamie-BitFlight/subscriptions","organizations_url":"https://api.github.com/users/Jamie-BitFlight/orgs","repos_url":"https://api.github.com/users/Jamie-BitFlight/repos","events_url":"https://api.github.com/users/Jamie-BitFlight/events{/privacy}","received_events_url":"https://api.github.com/users/Jamie-BitFlight/received_events","type":"User","site_admin":false},"repo":{"id":131976082,"name":"terraform-aws-codebuild","full_name":"Jamie-BitFlight/terraform-aws-codebuild","owner":{"login":"Jamie-BitFlight","id":25075504,"avatar_url":"https://avatars3.githubusercontent.com/u/25075504?v=4","gravatar_id":"","url":"https://api.github.com/users/Jamie-BitFlight","html_url":"https://github.com/Jamie-BitFlight","followers_url":"https://api.github.com/users/Jamie-BitFlight/followers","following_url":"https://api.github.com/users/Jamie-BitFlight/following{/other_user}","gists_url":"https://api.github.com/users/Jamie-BitFlight/gists{/gist_id}","starred_url":"https://api.github.com/users/Jamie-BitFlight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jamie-BitFlight/subscriptions","organizations_url":"https://api.github.com/users/Jamie-BitFlight/orgs","repos_url":"https://api.github.com/users/Jamie-BitFlight/repos","events_url":"https://api.github.com/users/Jamie-BitFlight/events{/privacy}","received_events_url":"https://api.github.com/users/Jamie-BitFlight/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Jamie-BitFlight/terraform-aws-codebuild","description":"Terraform Module to easily leverage AWS CodeBuild for Continuous Integration","fork":true,"url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild","forks_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/forks","keys_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/teams","hooks_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/hooks","issue_events_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/issues/events{/number}","events_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/events","assignees_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/assignees{/user}","branches_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/branches{/branch}","tags_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/tags","blobs_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/statuses/{sha}","languages_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/languages","stargazers_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/stargazers","contributors_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/contributors","subscribers_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/subscribers","subscription_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/subscription","commits_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/contents/{+path}","compare_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/merges","archive_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/downloads","issues_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/issues{/number}","pulls_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/pulls{/number}","milestones_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/milestones{/number}","notifications_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/labels{/name}","releases_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/releases{/id}","deployments_url":"https://api.github.com/repos/Jamie-BitFlight/terraform-aws-codebuild/deployments","created_at":"2018-05-03T09:58:45Z","updated_at":"2018-05-09T09:40:18Z","pushed_at":"2018-05-09T09:40:17Z","git_url":"git://github.com/Jamie-BitFlight/terraform-aws-codebuild.git","ssh_url":"git@github.com:Jamie-BitFlight/terraform-aws-codebuild.git","clone_url":"https://github.com/Jamie-BitFlight/terraform-aws-codebuild.git","svn_url":"https://github.com/Jamie-BitFlight/terraform-aws-codebuild","homepage":"https://cloudposse.com/","size":31,"stargazers_count":0,"watchers_count":0,"language":"HCL","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cloudposse:master","ref":"master","sha":"799e13d55cefb46222ccf1d24b9a112ccdf64d46","user":{"login":"cloudposse","id":16398900,"avatar_url":"https://avatars2.githubusercontent.com/u/16398900?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudposse","html_url":"https://github.com/cloudposse","followers_url":"https://api.github.com/users/cloudposse/followers","following_url":"https://api.github.com/users/cloudposse/following{/other_user}","gists_url":"https://api.github.com/users/cloudposse/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudposse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudposse/subscriptions","organizations_url":"https://api.github.com/users/cloudposse/orgs","repos_url":"https://api.github.com/users/cloudposse/repos","events_url":"https://api.github.com/users/cloudposse/events{/privacy}","received_events_url":"https://api.github.com/users/cloudposse/received_events","type":"Organization","site_admin":false},"repo":{"id":99681950,"name":"terraform-aws-codebuild","full_name":"cloudposse/terraform-aws-codebuild","owner":{"login":"cloudposse","id":16398900,"avatar_url":"https://avatars2.githubusercontent.com/u/16398900?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudposse","html_url":"https://github.com/cloudposse","followers_url":"https://api.github.com/users/cloudposse/followers","following_url":"https://api.github.com/users/cloudposse/following{/other_user}","gists_url":"https://api.github.com/users/cloudposse/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudposse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudposse/subscriptions","organizations_url":"https://api.github.com/users/cloudposse/orgs","repos_url":"https://api.github.com/users/cloudposse/repos","events_url":"https://api.github.com/users/cloudposse/events{/privacy}","received_events_url":"https://api.github.com/users/cloudposse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudposse/terraform-aws-codebuild","description":"Terraform Module to easily leverage AWS CodeBuild for Continuous Integration","fork":false,"url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild","forks_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/forks","keys_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/teams","hooks_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/hooks","issue_events_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/issues/events{/number}","events_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/events","assignees_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/assignees{/user}","branches_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/branches{/branch}","tags_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/tags","blobs_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/languages","stargazers_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/stargazers","contributors_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/contributors","subscribers_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/subscribers","subscription_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/subscription","commits_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/contents/{+path}","compare_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/merges","archive_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/downloads","issues_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/issues{/number}","pulls_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/labels{/name}","releases_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/releases{/id}","deployments_url":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/deployments","created_at":"2017-08-08T10:43:47Z","updated_at":"2018-05-02T13:09:47Z","pushed_at":"2018-05-09T09:40:18Z","git_url":"git://github.com/cloudposse/terraform-aws-codebuild.git","ssh_url":"git@github.com:cloudposse/terraform-aws-codebuild.git","clone_url":"https://github.com/cloudposse/terraform-aws-codebuild.git","svn_url":"https://github.com/cloudposse/terraform-aws-codebuild","homepage":"https://cloudposse.com/","size":18,"stargazers_count":10,"watchers_count":10,"language":"HCL","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":9,"open_issues":2,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/pulls/16"},"html":{"href":"https://github.com/cloudposse/terraform-aws-codebuild/pull/16"},"issue":{"href":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/issues/16"},"comments":{"href":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/cloudposse/terraform-aws-codebuild/statuses/430bbb2acd0d2aa14ac5bfc6ffc87eb1bba4ee9b"}},"author_association":"NONE"}}
{"actor":{"display_login":"Jamie-BitFlight"}}