{"action":"created","comment":{"url":"https://api.github.com/repos/hackoregon/civic-devops/pulls/comments/181281917","pull_request_review_id":111876573,"id":181281917,"diff_hunk":"@@ -0,0 +1,108 @@\n+# Itention:\n+# Create a ec2 instance that has read permission to the existing s3 instance(s)\n+\n+# USAGE:\n+# Run:\n+#   aws cloudformation create-stack --stack-name <stack name here> --template-body file:///absolute/path/to/this-file.yaml --capabilities CAPABILITY_NAMED_IAM\n+\n+# TODO:\n+# - separate parameters into a file\n+# - write wrapper for the aws cli command\n+\n+\n+---\n+AWSTemplateFormatVersion: '2010-09-09'\n+Description: 'AWS CloudFormation to create a ec2 instance that has read permission to the existing s3 instance(s)'\n+\n+Parameters:\n+\n+    InstanceType:\n+        Description: Instance type used to build the machine(s)\n+        Type: String\n+        Default: t2.micro\n+\n+    ImageId:\n+        Description: AMI ID used to build the machine(s)\n+        Type: String\n+        Default: ami-7f43f307\n+\n+    AvailabilityZone:\n+        Description: Avalaibility Zone to deploy within (different than region)\n+        Type: String\n+        Default: us-west-2a\n+\n+    SubnetId:\n+        Description: Subnet's ID to be located at\n+        Type: String\n+        Default: subnet-8794fddf\n+\n+    SecurityGroupId:\n+        Description: The Security Groups to use for the EC2 hosts\n+        Type: String\n+        Default: sg-28154957\n+\n+Resources:\n+\n+  DBInstance:\n+    Type: AWS::EC2::Instance\n+    Properties:\n+      InstanceType: t2.micro # !Ref InstanceType\n+      ImageId: ami-7f43f307 # !Ref ImageId\n+      SecurityGroupIds:\n+      -\n+        sg-28154957 # !Ref SecurityGroupId\n+      AvailabilityZone: us-west-2a # !Ref AvailabilityZone\n+      SubnetId: subnet-8794fddf # !Ref SubnetId\n+      IamInstanceProfile: \n+        !Ref InstanceProfile\n+      BlockDeviceMappings:\n+      -\n+        DeviceName: /dev/sdb # !Ref DeviceName\n+        Ebs:\n+          VolumeType: gp2 # !Ref VolumeType\n+          VolumeSize: 8 # !Ref VolumeSize\n+          DeleteOnTermination: True # False # !Ref DeleteOnTermination\n+      KeyName: hackoregon-2018-database-dev-env # !Ref KeyName\n+      Tags:\n+      -\n+        Key: Name\n+        Value: DB # !Ref InstanceName\n+\n+  Role:\n+    Type: AWS::IAM::Role\n+    Properties:\n+      RoleName: db-role\n+      AssumeRolePolicyDocument:\n+        Version: '2012-10-17'\n+        Statement:\n+        - Effect: Allow\n+          Principal:\n+            Service:\n+            - ec2.amazonaws.com\n+          Action:\n+          - sts:AssumeRole\n+      Path: \"/\"\n+      #Policies:\n+      #  - !Ref RolePolicies\n+\n+  RolePolicies:\n+    Type: AWS::IAM::Policy\n+    Properties:\n+      PolicyName: ec2-read-s3-policy\n+      PolicyDocument:\n+        Version: '2012-10-17'\n+        Statement:\n+        - Effect: Allow\n+          Action: \n+            - \"s3:GetObject\"\n+            - \"s3:ListBucket\"\n+          Resource: \"*\"","path":"infrastructure/ec2-db.yaml","position":99,"original_position":99,"commit_id":"1da6dc8c49f05913c411b3fd4e192b4172e8841a","original_commit_id":"1da6dc8c49f05913c411b3fd4e192b4172e8841a","user":{"login":"khashf","id":6059347,"avatar_url":"https://avatars3.githubusercontent.com/u/6059347?v=4","gravatar_id":"","url":"https://api.github.com/users/khashf","html_url":"https://github.com/khashf","followers_url":"https://api.github.com/users/khashf/followers","following_url":"https://api.github.com/users/khashf/following{/other_user}","gists_url":"https://api.github.com/users/khashf/gists{/gist_id}","starred_url":"https://api.github.com/users/khashf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khashf/subscriptions","organizations_url":"https://api.github.com/users/khashf/orgs","repos_url":"https://api.github.com/users/khashf/repos","events_url":"https://api.github.com/users/khashf/events{/privacy}","received_events_url":"https://api.github.com/users/khashf/received_events","type":"User","site_admin":false},"body":"Thanks, Micheal. Yes, I'm aware of this. I wasn't sure which bucket to select so I left it a wildcard for easier testing. Patches incoming in a few mins","created_at":"2018-04-13T04:12:04Z","updated_at":"2018-04-13T04:12:04Z","html_url":"https://github.com/hackoregon/civic-devops/pull/69#discussion_r181281917","pull_request_url":"https://api.github.com/repos/hackoregon/civic-devops/pulls/69","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/hackoregon/civic-devops/pulls/comments/181281917"},"html":{"href":"https://github.com/hackoregon/civic-devops/pull/69#discussion_r181281917"},"pull_request":{"href":"https://api.github.com/repos/hackoregon/civic-devops/pulls/69"}},"in_reply_to_id":181268421},"pull_request":{"url":"https://api.github.com/repos/hackoregon/civic-devops/pulls/69","id":181106891,"html_url":"https://github.com/hackoregon/civic-devops/pull/69","diff_url":"https://github.com/hackoregon/civic-devops/pull/69.diff","patch_url":"https://github.com/hackoregon/civic-devops/pull/69.patch","issue_url":"https://api.github.com/repos/hackoregon/civic-devops/issues/69","number":69,"state":"open","locked":false,"title":"Launch EC2 instance with CloudFormation","user":{"login":"khashf","id":6059347,"avatar_url":"https://avatars3.githubusercontent.com/u/6059347?v=4","gravatar_id":"","url":"https://api.github.com/users/khashf","html_url":"https://github.com/khashf","followers_url":"https://api.github.com/users/khashf/followers","following_url":"https://api.github.com/users/khashf/following{/other_user}","gists_url":"https://api.github.com/users/khashf/gists{/gist_id}","starred_url":"https://api.github.com/users/khashf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khashf/subscriptions","organizations_url":"https://api.github.com/users/khashf/orgs","repos_url":"https://api.github.com/users/khashf/repos","events_url":"https://api.github.com/users/khashf/events{/privacy}","received_events_url":"https://api.github.com/users/khashf/received_events","type":"User","site_admin":false},"body":"AWS CloudFormation to create an ec2 instance that has read permission to the existing s3 instance(s)\r\n\r\nSmall notes:\r\nI accidentally branched out from a non-master branch and so pushed 2 unrelated files. The 2nd commit of this branch/PR fixes this issue. (Sorry Mike)\r\n\r\nUpon:\r\nSuggested by @DingoEatingFuzz in a discussion on PR https://github.com/hackoregon/civic-devops/pull/48\r\nRequested by @MikeTheCanuck at assignment https://github.com/hackoregon/civic-devops/issues/61","created_at":"2018-04-12T06:58:48Z","updated_at":"2018-04-13T04:12:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7077ffabe53ff9faddebde4dde35a98fdd6f7b53","assignee":{"login":"khashf","id":6059347,"avatar_url":"https://avatars3.githubusercontent.com/u/6059347?v=4","gravatar_id":"","url":"https://api.github.com/users/khashf","html_url":"https://github.com/khashf","followers_url":"https://api.github.com/users/khashf/followers","following_url":"https://api.github.com/users/khashf/following{/other_user}","gists_url":"https://api.github.com/users/khashf/gists{/gist_id}","starred_url":"https://api.github.com/users/khashf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khashf/subscriptions","organizations_url":"https://api.github.com/users/khashf/orgs","repos_url":"https://api.github.com/users/khashf/repos","events_url":"https://api.github.com/users/khashf/events{/privacy}","received_events_url":"https://api.github.com/users/khashf/received_events","type":"User","site_admin":false},"assignees":[{"login":"khashf","id":6059347,"avatar_url":"https://avatars3.githubusercontent.com/u/6059347?v=4","gravatar_id":"","url":"https://api.github.com/users/khashf","html_url":"https://github.com/khashf","followers_url":"https://api.github.com/users/khashf/followers","following_url":"https://api.github.com/users/khashf/following{/other_user}","gists_url":"https://api.github.com/users/khashf/gists{/gist_id}","starred_url":"https://api.github.com/users/khashf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khashf/subscriptions","organizations_url":"https://api.github.com/users/khashf/orgs","repos_url":"https://api.github.com/users/khashf/repos","events_url":"https://api.github.com/users/khashf/events{/privacy}","received_events_url":"https://api.github.com/users/khashf/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"MikeTheCanuck","id":6953053,"avatar_url":"https://avatars1.githubusercontent.com/u/6953053?v=4","gravatar_id":"","url":"https://api.github.com/users/MikeTheCanuck","html_url":"https://github.com/MikeTheCanuck","followers_url":"https://api.github.com/users/MikeTheCanuck/followers","following_url":"https://api.github.com/users/MikeTheCanuck/following{/other_user}","gists_url":"https://api.github.com/users/MikeTheCanuck/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeTheCanuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeTheCanuck/subscriptions","organizations_url":"https://api.github.com/users/MikeTheCanuck/orgs","repos_url":"https://api.github.com/users/MikeTheCanuck/repos","events_url":"https://api.github.com/users/MikeTheCanuck/events{/privacy}","received_events_url":"https://api.github.com/users/MikeTheCanuck/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":823306195,"url":"https://api.github.com/repos/hackoregon/civic-devops/labels/enhancement","name":"enhancement","color":"a2eeef","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/hackoregon/civic-devops/pulls/69/commits","review_comments_url":"https://api.github.com/repos/hackoregon/civic-devops/pulls/69/comments","review_comment_url":"https://api.github.com/repos/hackoregon/civic-devops/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hackoregon/civic-devops/issues/69/comments","statuses_url":"https://api.github.com/repos/hackoregon/civic-devops/statuses/1da6dc8c49f05913c411b3fd4e192b4172e8841a","head":{"label":"hackoregon:create-infra-with-cf","ref":"create-infra-with-cf","sha":"1da6dc8c49f05913c411b3fd4e192b4172e8841a","user":{"login":"hackoregon","id":6343574,"avatar_url":"https://avatars3.githubusercontent.com/u/6343574?v=4","gravatar_id":"","url":"https://api.github.com/users/hackoregon","html_url":"https://github.com/hackoregon","followers_url":"https://api.github.com/users/hackoregon/followers","following_url":"https://api.github.com/users/hackoregon/following{/other_user}","gists_url":"https://api.github.com/users/hackoregon/gists{/gist_id}","starred_url":"https://api.github.com/users/hackoregon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackoregon/subscriptions","organizations_url":"https://api.github.com/users/hackoregon/orgs","repos_url":"https://api.github.com/users/hackoregon/repos","events_url":"https://api.github.com/users/hackoregon/events{/privacy}","received_events_url":"https://api.github.com/users/hackoregon/received_events","type":"Organization","site_admin":false},"repo":{"id":119785724,"name":"civic-devops","full_name":"hackoregon/civic-devops","owner":{"login":"hackoregon","id":6343574,"avatar_url":"https://avatars3.githubusercontent.com/u/6343574?v=4","gravatar_id":"","url":"https://api.github.com/users/hackoregon","html_url":"https://github.com/hackoregon","followers_url":"https://api.github.com/users/hackoregon/followers","following_url":"https://api.github.com/users/hackoregon/following{/other_user}","gists_url":"https://api.github.com/users/hackoregon/gists{/gist_id}","starred_url":"https://api.github.com/users/hackoregon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackoregon/subscriptions","organizations_url":"https://api.github.com/users/hackoregon/orgs","repos_url":"https://api.github.com/users/hackoregon/repos","events_url":"https://api.github.com/users/hackoregon/events{/privacy}","received_events_url":"https://api.github.com/users/hackoregon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hackoregon/civic-devops","description":"Master collection point for issues, procedures, and code to manage the HackOregon Civic platform","fork":false,"url":"https://api.github.com/repos/hackoregon/civic-devops","forks_url":"https://api.github.com/repos/hackoregon/civic-devops/forks","keys_url":"https://api.github.com/repos/hackoregon/civic-devops/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hackoregon/civic-devops/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hackoregon/civic-devops/teams","hooks_url":"https://api.github.com/repos/hackoregon/civic-devops/hooks","issue_events_url":"https://api.github.com/repos/hackoregon/civic-devops/issues/events{/number}","events_url":"https://api.github.com/repos/hackoregon/civic-devops/events","assignees_url":"https://api.github.com/repos/hackoregon/civic-devops/assignees{/user}","branches_url":"https://api.github.com/repos/hackoregon/civic-devops/branches{/branch}","tags_url":"https://api.github.com/repos/hackoregon/civic-devops/tags","blobs_url":"https://api.github.com/repos/hackoregon/civic-devops/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hackoregon/civic-devops/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hackoregon/civic-devops/git/refs{/sha}","trees_url":"https://api.github.com/repos/hackoregon/civic-devops/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hackoregon/civic-devops/statuses/{sha}","languages_url":"https://api.github.com/repos/hackoregon/civic-devops/languages","stargazers_url":"https://api.github.com/repos/hackoregon/civic-devops/stargazers","contributors_url":"https://api.github.com/repos/hackoregon/civic-devops/contributors","subscribers_url":"https://api.github.com/repos/hackoregon/civic-devops/subscribers","subscription_url":"https://api.github.com/repos/hackoregon/civic-devops/subscription","commits_url":"https://api.github.com/repos/hackoregon/civic-devops/commits{/sha}","git_commits_url":"https://api.github.com/repos/hackoregon/civic-devops/git/commits{/sha}","comments_url":"https://api.github.com/repos/hackoregon/civic-devops/comments{/number}","issue_comment_url":"https://api.github.com/repos/hackoregon/civic-devops/issues/comments{/number}","contents_url":"https://api.github.com/repos/hackoregon/civic-devops/contents/{+path}","compare_url":"https://api.github.com/repos/hackoregon/civic-devops/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hackoregon/civic-devops/merges","archive_url":"https://api.github.com/repos/hackoregon/civic-devops/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hackoregon/civic-devops/downloads","issues_url":"https://api.github.com/repos/hackoregon/civic-devops/issues{/number}","pulls_url":"https://api.github.com/repos/hackoregon/civic-devops/pulls{/number}","milestones_url":"https://api.github.com/repos/hackoregon/civic-devops/milestones{/number}","notifications_url":"https://api.github.com/repos/hackoregon/civic-devops/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hackoregon/civic-devops/labels{/name}","releases_url":"https://api.github.com/repos/hackoregon/civic-devops/releases{/id}","deployments_url":"https://api.github.com/repos/hackoregon/civic-devops/deployments","created_at":"2018-02-01T05:07:29Z","updated_at":"2018-04-08T19:25:16Z","pushed_at":"2018-04-12T07:03:51Z","git_url":"git://github.com/hackoregon/civic-devops.git","ssh_url":"git@github.com:hackoregon/civic-devops.git","clone_url":"https://github.com/hackoregon/civic-devops.git","svn_url":"https://github.com/hackoregon/civic-devops","homepage":null,"size":143,"stargazers_count":4,"watchers_count":4,"language":"Shell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":26,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":26,"watchers":4,"default_branch":"master"}},"base":{"label":"hackoregon:master","ref":"master","sha":"fe2b0d7264c043b71dd3a1f4b7250e8b7ef637a5","user":{"login":"hackoregon","id":6343574,"avatar_url":"https://avatars3.githubusercontent.com/u/6343574?v=4","gravatar_id":"","url":"https://api.github.com/users/hackoregon","html_url":"https://github.com/hackoregon","followers_url":"https://api.github.com/users/hackoregon/followers","following_url":"https://api.github.com/users/hackoregon/following{/other_user}","gists_url":"https://api.github.com/users/hackoregon/gists{/gist_id}","starred_url":"https://api.github.com/users/hackoregon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackoregon/subscriptions","organizations_url":"https://api.github.com/users/hackoregon/orgs","repos_url":"https://api.github.com/users/hackoregon/repos","events_url":"https://api.github.com/users/hackoregon/events{/privacy}","received_events_url":"https://api.github.com/users/hackoregon/received_events","type":"Organization","site_admin":false},"repo":{"id":119785724,"name":"civic-devops","full_name":"hackoregon/civic-devops","owner":{"login":"hackoregon","id":6343574,"avatar_url":"https://avatars3.githubusercontent.com/u/6343574?v=4","gravatar_id":"","url":"https://api.github.com/users/hackoregon","html_url":"https://github.com/hackoregon","followers_url":"https://api.github.com/users/hackoregon/followers","following_url":"https://api.github.com/users/hackoregon/following{/other_user}","gists_url":"https://api.github.com/users/hackoregon/gists{/gist_id}","starred_url":"https://api.github.com/users/hackoregon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackoregon/subscriptions","organizations_url":"https://api.github.com/users/hackoregon/orgs","repos_url":"https://api.github.com/users/hackoregon/repos","events_url":"https://api.github.com/users/hackoregon/events{/privacy}","received_events_url":"https://api.github.com/users/hackoregon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hackoregon/civic-devops","description":"Master collection point for issues, procedures, and code to manage the HackOregon Civic platform","fork":false,"url":"https://api.github.com/repos/hackoregon/civic-devops","forks_url":"https://api.github.com/repos/hackoregon/civic-devops/forks","keys_url":"https://api.github.com/repos/hackoregon/civic-devops/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hackoregon/civic-devops/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hackoregon/civic-devops/teams","hooks_url":"https://api.github.com/repos/hackoregon/civic-devops/hooks","issue_events_url":"https://api.github.com/repos/hackoregon/civic-devops/issues/events{/number}","events_url":"https://api.github.com/repos/hackoregon/civic-devops/events","assignees_url":"https://api.github.com/repos/hackoregon/civic-devops/assignees{/user}","branches_url":"https://api.github.com/repos/hackoregon/civic-devops/branches{/branch}","tags_url":"https://api.github.com/repos/hackoregon/civic-devops/tags","blobs_url":"https://api.github.com/repos/hackoregon/civic-devops/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hackoregon/civic-devops/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hackoregon/civic-devops/git/refs{/sha}","trees_url":"https://api.github.com/repos/hackoregon/civic-devops/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hackoregon/civic-devops/statuses/{sha}","languages_url":"https://api.github.com/repos/hackoregon/civic-devops/languages","stargazers_url":"https://api.github.com/repos/hackoregon/civic-devops/stargazers","contributors_url":"https://api.github.com/repos/hackoregon/civic-devops/contributors","subscribers_url":"https://api.github.com/repos/hackoregon/civic-devops/subscribers","subscription_url":"https://api.github.com/repos/hackoregon/civic-devops/subscription","commits_url":"https://api.github.com/repos/hackoregon/civic-devops/commits{/sha}","git_commits_url":"https://api.github.com/repos/hackoregon/civic-devops/git/commits{/sha}","comments_url":"https://api.github.com/repos/hackoregon/civic-devops/comments{/number}","issue_comment_url":"https://api.github.com/repos/hackoregon/civic-devops/issues/comments{/number}","contents_url":"https://api.github.com/repos/hackoregon/civic-devops/contents/{+path}","compare_url":"https://api.github.com/repos/hackoregon/civic-devops/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hackoregon/civic-devops/merges","archive_url":"https://api.github.com/repos/hackoregon/civic-devops/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hackoregon/civic-devops/downloads","issues_url":"https://api.github.com/repos/hackoregon/civic-devops/issues{/number}","pulls_url":"https://api.github.com/repos/hackoregon/civic-devops/pulls{/number}","milestones_url":"https://api.github.com/repos/hackoregon/civic-devops/milestones{/number}","notifications_url":"https://api.github.com/repos/hackoregon/civic-devops/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hackoregon/civic-devops/labels{/name}","releases_url":"https://api.github.com/repos/hackoregon/civic-devops/releases{/id}","deployments_url":"https://api.github.com/repos/hackoregon/civic-devops/deployments","created_at":"2018-02-01T05:07:29Z","updated_at":"2018-04-08T19:25:16Z","pushed_at":"2018-04-12T07:03:51Z","git_url":"git://github.com/hackoregon/civic-devops.git","ssh_url":"git@github.com:hackoregon/civic-devops.git","clone_url":"https://github.com/hackoregon/civic-devops.git","svn_url":"https://github.com/hackoregon/civic-devops","homepage":null,"size":143,"stargazers_count":4,"watchers_count":4,"language":"Shell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":26,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":26,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hackoregon/civic-devops/pulls/69"},"html":{"href":"https://github.com/hackoregon/civic-devops/pull/69"},"issue":{"href":"https://api.github.com/repos/hackoregon/civic-devops/issues/69"},"comments":{"href":"https://api.github.com/repos/hackoregon/civic-devops/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/hackoregon/civic-devops/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/hackoregon/civic-devops/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hackoregon/civic-devops/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/hackoregon/civic-devops/statuses/1da6dc8c49f05913c411b3fd4e192b4172e8841a"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"khashf"}}