{"action":"created","comment":{"url":"https://api.github.com/repos/hashicorp/terraform/pulls/comments/29307948","id":29307948,"diff_hunk":"@@ -0,0 +1,119 @@\n+package remote\n+\n+import (\n+\t\"bytes\"\n+\t\"fmt\"\n+\t\"io\"\n+\t\"os\"\n+\n+\t\"github.com/awslabs/aws-sdk-go/aws\"\n+\t\"github.com/awslabs/aws-sdk-go/service/s3\"\n+)\n+\n+func s3Factory(conf map[string]string) (Client, error) {\n+\tbucketName, ok := conf[\"bucket\"]\n+\tif !ok {\n+\t\treturn nil, fmt.Errorf(\"missing 'bucket' configuration\")\n+\t}\n+\n+\tkeyName, ok := conf[\"key\"]\n+\tif !ok {\n+\t\treturn nil, fmt.Errorf(\"missing 'key' configuration\")\n+\t}\n+\n+\tregionName, ok := conf[\"region\"]\n+\tif !ok {\n+\t\tregionName = os.Getenv(\"AWS_DEFAULT_REGION\")\n+\t\tif regionName == \"\" {\n+\t\t\treturn nil, fmt.Errorf(\"missing 'region' configuration or AWS_DEFAULT_REGION environment variable\")\n+\t\t}\n+\t}\n+\n+\taccessKeyId := conf[\"access_key\"]\n+\tsecretAccessKey := conf[\"secret_key\"]\n+\n+\tcredentials := aws.DetectCreds(accessKeyId, secretAccessKey, \"\")","path":"state/remote/s3.go","position":35,"original_position":35,"commit_id":"ead5c357cd707a03d27f3b4aab5a98fb00ea643a","original_commit_id":"ead5c357cd707a03d27f3b4aab5a98fb00ea643a","user":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"body":"Is there a way we can check if the credentials didn't load here? ","created_at":"2015-04-29T03:18:25Z","updated_at":"2015-04-29T03:18:25Z","html_url":"https://github.com/hashicorp/terraform/pull/1723#discussion_r29307948","pull_request_url":"https://api.github.com/repos/hashicorp/terraform/pulls/1723","_links":{"self":{"href":"https://api.github.com/repos/hashicorp/terraform/pulls/comments/29307948"},"html":{"href":"https://github.com/hashicorp/terraform/pull/1723#discussion_r29307948"},"pull_request":{"href":"https://api.github.com/repos/hashicorp/terraform/pulls/1723"}}},"pull_request":{"url":"https://api.github.com/repos/hashicorp/terraform/pulls/1723","id":34328466,"html_url":"https://github.com/hashicorp/terraform/pull/1723","diff_url":"https://github.com/hashicorp/terraform/pull/1723.diff","patch_url":"https://github.com/hashicorp/terraform/pull/1723.patch","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/1723","number":1723,"state":"open","locked":false,"title":"S3 Remote State Backend","user":{"login":"apparentlymart","id":20180,"avatar_url":"https://avatars.githubusercontent.com/u/20180?v=3","gravatar_id":"","url":"https://api.github.com/users/apparentlymart","html_url":"https://github.com/apparentlymart","followers_url":"https://api.github.com/users/apparentlymart/followers","following_url":"https://api.github.com/users/apparentlymart/following{/other_user}","gists_url":"https://api.github.com/users/apparentlymart/gists{/gist_id}","starred_url":"https://api.github.com/users/apparentlymart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apparentlymart/subscriptions","organizations_url":"https://api.github.com/users/apparentlymart/orgs","repos_url":"https://api.github.com/users/apparentlymart/repos","events_url":"https://api.github.com/users/apparentlymart/events{/privacy}","received_events_url":"https://api.github.com/users/apparentlymart/received_events","type":"User","site_admin":false},"body":"This is a rewrite of @kubek2k's earlier work in terms of both the new remote state API and the new AWS client.\r\n\r\nPushing this now for early review to see if I'm on the right track, though I know I still have some unit and acceptance tests to write, which will follow in a subsequent commit.\r\n","created_at":"2015-04-29T02:00:35Z","updated_at":"2015-04-29T03:18:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"880ec69a5f2f37a3d7fdd51a29c0d07c8c39db22","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hashicorp/terraform/pulls/1723/commits","review_comments_url":"https://api.github.com/repos/hashicorp/terraform/pulls/1723/comments","review_comment_url":"https://api.github.com/repos/hashicorp/terraform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/1723/comments","statuses_url":"https://api.github.com/repos/hashicorp/terraform/statuses/ead5c357cd707a03d27f3b4aab5a98fb00ea643a","head":{"label":"apparentlymart:s3remotestate","ref":"s3remotestate","sha":"ead5c357cd707a03d27f3b4aab5a98fb00ea643a","user":{"login":"apparentlymart","id":20180,"avatar_url":"https://avatars.githubusercontent.com/u/20180?v=3","gravatar_id":"","url":"https://api.github.com/users/apparentlymart","html_url":"https://github.com/apparentlymart","followers_url":"https://api.github.com/users/apparentlymart/followers","following_url":"https://api.github.com/users/apparentlymart/following{/other_user}","gists_url":"https://api.github.com/users/apparentlymart/gists{/gist_id}","starred_url":"https://api.github.com/users/apparentlymart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apparentlymart/subscriptions","organizations_url":"https://api.github.com/users/apparentlymart/orgs","repos_url":"https://api.github.com/users/apparentlymart/repos","events_url":"https://api.github.com/users/apparentlymart/events{/privacy}","received_events_url":"https://api.github.com/users/apparentlymart/received_events","type":"User","site_admin":false},"repo":{"id":34530243,"name":"terraform","full_name":"apparentlymart/terraform","owner":{"login":"apparentlymart","id":20180,"avatar_url":"https://avatars.githubusercontent.com/u/20180?v=3","gravatar_id":"","url":"https://api.github.com/users/apparentlymart","html_url":"https://github.com/apparentlymart","followers_url":"https://api.github.com/users/apparentlymart/followers","following_url":"https://api.github.com/users/apparentlymart/following{/other_user}","gists_url":"https://api.github.com/users/apparentlymart/gists{/gist_id}","starred_url":"https://api.github.com/users/apparentlymart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apparentlymart/subscriptions","organizations_url":"https://api.github.com/users/apparentlymart/orgs","repos_url":"https://api.github.com/users/apparentlymart/repos","events_url":"https://api.github.com/users/apparentlymart/events{/privacy}","received_events_url":"https://api.github.com/users/apparentlymart/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/apparentlymart/terraform","description":"Terraform is a tool for building, changing, and combining infrastructure safely and efficiently.","fork":true,"url":"https://api.github.com/repos/apparentlymart/terraform","forks_url":"https://api.github.com/repos/apparentlymart/terraform/forks","keys_url":"https://api.github.com/repos/apparentlymart/terraform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apparentlymart/terraform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apparentlymart/terraform/teams","hooks_url":"https://api.github.com/repos/apparentlymart/terraform/hooks","issue_events_url":"https://api.github.com/repos/apparentlymart/terraform/issues/events{/number}","events_url":"https://api.github.com/repos/apparentlymart/terraform/events","assignees_url":"https://api.github.com/repos/apparentlymart/terraform/assignees{/user}","branches_url":"https://api.github.com/repos/apparentlymart/terraform/branches{/branch}","tags_url":"https://api.github.com/repos/apparentlymart/terraform/tags","blobs_url":"https://api.github.com/repos/apparentlymart/terraform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apparentlymart/terraform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apparentlymart/terraform/git/refs{/sha}","trees_url":"https://api.github.com/repos/apparentlymart/terraform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apparentlymart/terraform/statuses/{sha}","languages_url":"https://api.github.com/repos/apparentlymart/terraform/languages","stargazers_url":"https://api.github.com/repos/apparentlymart/terraform/stargazers","contributors_url":"https://api.github.com/repos/apparentlymart/terraform/contributors","subscribers_url":"https://api.github.com/repos/apparentlymart/terraform/subscribers","subscription_url":"https://api.github.com/repos/apparentlymart/terraform/subscription","commits_url":"https://api.github.com/repos/apparentlymart/terraform/commits{/sha}","git_commits_url":"https://api.github.com/repos/apparentlymart/terraform/git/commits{/sha}","comments_url":"https://api.github.com/repos/apparentlymart/terraform/comments{/number}","issue_comment_url":"https://api.github.com/repos/apparentlymart/terraform/issues/comments{/number}","contents_url":"https://api.github.com/repos/apparentlymart/terraform/contents/{+path}","compare_url":"https://api.github.com/repos/apparentlymart/terraform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apparentlymart/terraform/merges","archive_url":"https://api.github.com/repos/apparentlymart/terraform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apparentlymart/terraform/downloads","issues_url":"https://api.github.com/repos/apparentlymart/terraform/issues{/number}","pulls_url":"https://api.github.com/repos/apparentlymart/terraform/pulls{/number}","milestones_url":"https://api.github.com/repos/apparentlymart/terraform/milestones{/number}","notifications_url":"https://api.github.com/repos/apparentlymart/terraform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apparentlymart/terraform/labels{/name}","releases_url":"https://api.github.com/repos/apparentlymart/terraform/releases{/id}","created_at":"2015-04-24T16:45:48Z","updated_at":"2015-04-28T18:34:16Z","pushed_at":"2015-04-29T01:58:03Z","git_url":"git://github.com/apparentlymart/terraform.git","ssh_url":"git@github.com:apparentlymart/terraform.git","clone_url":"https://github.com/apparentlymart/terraform.git","svn_url":"https://github.com/apparentlymart/terraform","homepage":"http://www.terraform.io","size":21593,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hashicorp:master","ref":"master","sha":"8f3e188f845a67b08a7feb25af247e56c80fc66b","user":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"repo":{"id":17728164,"name":"terraform","full_name":"hashicorp/terraform","owner":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars.githubusercontent.com/u/761456?v=3","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hashicorp/terraform","description":"Terraform is a tool for building, changing, and combining infrastructure safely and efficiently.","fork":false,"url":"https://api.github.com/repos/hashicorp/terraform","forks_url":"https://api.github.com/repos/hashicorp/terraform/forks","keys_url":"https://api.github.com/repos/hashicorp/terraform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/terraform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/terraform/teams","hooks_url":"https://api.github.com/repos/hashicorp/terraform/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/terraform/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/terraform/events","assignees_url":"https://api.github.com/repos/hashicorp/terraform/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/terraform/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/terraform/tags","blobs_url":"https://api.github.com/repos/hashicorp/terraform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/terraform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/terraform/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/terraform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/terraform/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/terraform/languages","stargazers_url":"https://api.github.com/repos/hashicorp/terraform/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/terraform/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/terraform/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/terraform/subscription","commits_url":"https://api.github.com/repos/hashicorp/terraform/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/terraform/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/terraform/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/terraform/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/terraform/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/terraform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/terraform/merges","archive_url":"https://api.github.com/repos/hashicorp/terraform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/terraform/downloads","issues_url":"https://api.github.com/repos/hashicorp/terraform/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/terraform/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/terraform/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/terraform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/terraform/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/terraform/releases{/id}","created_at":"2014-03-13T22:25:48Z","updated_at":"2015-04-29T02:56:52Z","pushed_at":"2015-04-29T02:59:34Z","git_url":"git://github.com/hashicorp/terraform.git","ssh_url":"git@github.com:hashicorp/terraform.git","clone_url":"https://github.com/hashicorp/terraform.git","svn_url":"https://github.com/hashicorp/terraform","homepage":"http://www.terraform.io","size":43258,"stargazers_count":2304,"watchers_count":2304,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":401,"mirror_url":null,"open_issues_count":280,"forks":401,"open_issues":280,"watchers":2304,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/terraform/pulls/1723"},"html":{"href":"https://github.com/hashicorp/terraform/pull/1723"},"issue":{"href":"https://api.github.com/repos/hashicorp/terraform/issues/1723"},"comments":{"href":"https://api.github.com/repos/hashicorp/terraform/issues/1723/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/terraform/pulls/1723/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/terraform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/terraform/pulls/1723/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/terraform/statuses/ead5c357cd707a03d27f3b4aab5a98fb00ea643a"}}}}