{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/pulls/comments/23382740","id":23382740,"diff_hunk":"@@ -195,4 +197,153 @@ def expect_failed_apply(config)\n     end\n   end\n \n+  describe 'should create a new instance with puppet resource' do\n+\n+    before(:all) do\n+      @config = {\n+        :name => \"#{PuppetManifest.env_id}-#{SecureRandom.uuid}\",\n+        :instance_type => 't1.micro',\n+        :region => @default_region,\n+        :image_id => 'ami-41e85d5c',\n+        :ensure => 'present',\n+        :monitoring => false,\n+        :availability_zone => @default_availability_zone,\n+        :security_groups => 'default',\n+      }\n+\n+      # The value for this ENV var must be an existing key in your Amazon account\n+      # the key must be available in the sa-east-1 region\n+      if ENV['AWS_KEY_PAIR']\n+        @config[:key_name] = ENV['AWS_KEY_PAIR']\n+      end\n+      # create new instance with puppet resource\n+      TestExecutor.puppet_resource('ec2_instance', @config, '--modulepath ../')\n+      #wait for instance to report as running\n+      @instance = get_instance(@config[:name])\n+      @aws.ec2_client.wait_until(:instance_running, instance_ids:[@instance.instance_id])\n+      # set env variable and use puppet resource to inspect state of ec2 instance\n+      ENV['AWS_REGION'] = @config[:region]\n+      @result = TestExecutor.puppet_resource('ec2_instance', {:name => @config[:name]}, '--modulepath ../')\n+      expect(@result.stderr).not_to match(/Error:/)","path":"spec/acceptance/instance_spec.rb","position":45,"original_position":45,"commit_id":"490e0e6fd0015996f27a6878b203d7bc448e2588","original_commit_id":"490e0e6fd0015996f27a6878b203d7bc448e2588","user":{"login":"garethr","id":2029,"avatar_url":"https://avatars.githubusercontent.com/u/2029?v=3","gravatar_id":"","url":"https://api.github.com/users/garethr","html_url":"https://github.com/garethr","followers_url":"https://api.github.com/users/garethr/followers","following_url":"https://api.github.com/users/garethr/following{/other_user}","gists_url":"https://api.github.com/users/garethr/gists{/gist_id}","starred_url":"https://api.github.com/users/garethr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garethr/subscriptions","organizations_url":"https://api.github.com/users/garethr/orgs","repos_url":"https://api.github.com/users/garethr/repos","events_url":"https://api.github.com/users/garethr/events{/privacy}","received_events_url":"https://api.github.com/users/garethr/received_events","type":"User","site_admin":false},"body":"Could this just check for anything in stderr? Or the exit code?","created_at":"2015-01-22T15:27:49Z","updated_at":"2015-01-22T15:27:49Z","html_url":"https://github.com/puppetlabs/puppetlabs-aws/pull/46#discussion_r23382740","pull_request_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/pulls/comments/23382740"},"html":{"href":"https://github.com/puppetlabs/puppetlabs-aws/pull/46#discussion_r23382740"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/pulls/46","id":27365573,"html_url":"https://github.com/puppetlabs/puppetlabs-aws/pull/46","diff_url":"https://github.com/puppetlabs/puppetlabs-aws/pull/46.diff","patch_url":"https://github.com/puppetlabs/puppetlabs-aws/pull/46.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/issues/46","number":46,"state":"open","locked":false,"title":"Tests for puppet resource ec2_instance","user":{"login":"zreichert","id":2602509,"avatar_url":"https://avatars.githubusercontent.com/u/2602509?v=3","gravatar_id":"","url":"https://api.github.com/users/zreichert","html_url":"https://github.com/zreichert","followers_url":"https://api.github.com/users/zreichert/followers","following_url":"https://api.github.com/users/zreichert/following{/other_user}","gists_url":"https://api.github.com/users/zreichert/gists{/gist_id}","starred_url":"https://api.github.com/users/zreichert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zreichert/subscriptions","organizations_url":"https://api.github.com/users/zreichert/orgs","repos_url":"https://api.github.com/users/zreichert/repos","events_url":"https://api.github.com/users/zreichert/events{/privacy}","received_events_url":"https://api.github.com/users/zreichert/received_events","type":"User","site_admin":false},"body":"This PR is complete but there are several bugs that are blocking it.  \r\nCLOUD-198 - fixed by https://github.com/puppetlabs/puppetlabs-aws/pull/52\r\nCLOUD-202 - will cause resources from this test to not be torn down\r\nCLOUD-196 ","created_at":"2015-01-14T17:06:26Z","updated_at":"2015-01-22T15:27:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"793c304dc7523243f8605a61212e9365fbc91a51","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/pulls/46/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/pulls/46/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/pulls/comments/{number}","comments_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/issues/46/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/statuses/490e0e6fd0015996f27a6878b203d7bc448e2588","head":{"label":"zreichert:ec2_resource_test","ref":"ec2_resource_test","sha":"490e0e6fd0015996f27a6878b203d7bc448e2588","user":{"login":"zreichert","id":2602509,"avatar_url":"https://avatars.githubusercontent.com/u/2602509?v=3","gravatar_id":"","url":"https://api.github.com/users/zreichert","html_url":"https://github.com/zreichert","followers_url":"https://api.github.com/users/zreichert/followers","following_url":"https://api.github.com/users/zreichert/following{/other_user}","gists_url":"https://api.github.com/users/zreichert/gists{/gist_id}","starred_url":"https://api.github.com/users/zreichert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zreichert/subscriptions","organizations_url":"https://api.github.com/users/zreichert/orgs","repos_url":"https://api.github.com/users/zreichert/repos","events_url":"https://api.github.com/users/zreichert/events{/privacy}","received_events_url":"https://api.github.com/users/zreichert/received_events","type":"User","site_admin":false},"repo":{"id":28407503,"name":"puppetlabs-aws","full_name":"zreichert/puppetlabs-aws","owner":{"login":"zreichert","id":2602509,"avatar_url":"https://avatars.githubusercontent.com/u/2602509?v=3","gravatar_id":"","url":"https://api.github.com/users/zreichert","html_url":"https://github.com/zreichert","followers_url":"https://api.github.com/users/zreichert/followers","following_url":"https://api.github.com/users/zreichert/following{/other_user}","gists_url":"https://api.github.com/users/zreichert/gists{/gist_id}","starred_url":"https://api.github.com/users/zreichert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zreichert/subscriptions","organizations_url":"https://api.github.com/users/zreichert/orgs","repos_url":"https://api.github.com/users/zreichert/repos","events_url":"https://api.github.com/users/zreichert/events{/privacy}","received_events_url":"https://api.github.com/users/zreichert/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zreichert/puppetlabs-aws","description":"Puppet module for managing AWS resources to build out infrastructure","fork":true,"url":"https://api.github.com/repos/zreichert/puppetlabs-aws","forks_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/forks","keys_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/teams","hooks_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/hooks","issue_events_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/issues/events{/number}","events_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/events","assignees_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/assignees{/user}","branches_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/branches{/branch}","tags_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/tags","blobs_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/languages","stargazers_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/stargazers","contributors_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/contributors","subscribers_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/subscribers","subscription_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/subscription","commits_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/issues/comments/{number}","contents_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/contents/{+path}","compare_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/merges","archive_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/downloads","issues_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/issues{/number}","pulls_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/labels{/name}","releases_url":"https://api.github.com/repos/zreichert/puppetlabs-aws/releases{/id}","created_at":"2014-12-23T16:18:11Z","updated_at":"2014-12-23T16:18:13Z","pushed_at":"2015-01-22T00:39:49Z","git_url":"git://github.com/zreichert/puppetlabs-aws.git","ssh_url":"git@github.com:zreichert/puppetlabs-aws.git","clone_url":"https://github.com/zreichert/puppetlabs-aws.git","svn_url":"https://github.com/zreichert/puppetlabs-aws","homepage":"","size":389,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"puppetlabs:master","ref":"master","sha":"a046f379fde3b57f8a1c7959ce08909507b7bd9d","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":23803367,"name":"puppetlabs-aws","full_name":"puppetlabs/puppetlabs-aws","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/puppetlabs-aws","description":"Puppet module for managing AWS resources to build out infrastructure","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws","forks_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/issues/comments/{number}","contents_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/releases{/id}","created_at":"2014-09-08T18:42:08Z","updated_at":"2015-01-21T21:59:53Z","pushed_at":"2015-01-21T21:59:52Z","git_url":"git://github.com/puppetlabs/puppetlabs-aws.git","ssh_url":"git@github.com:puppetlabs/puppetlabs-aws.git","clone_url":"https://github.com/puppetlabs/puppetlabs-aws.git","svn_url":"https://github.com/puppetlabs/puppetlabs-aws","homepage":"","size":1571,"stargazers_count":37,"watchers_count":37,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":18,"forks":15,"open_issues":18,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/pulls/46"},"html":{"href":"https://github.com/puppetlabs/puppetlabs-aws/pull/46"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/issues/46"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-aws/statuses/490e0e6fd0015996f27a6878b203d7bc448e2588"}}}}