{"action":"created","comment":{"url":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/comments/36440811","id":36440811,"diff_hunk":"@@ -0,0 +1,49 @@\n+require 'chef/provisioning/aws_driver/aws_provider'\n+\n+class Chef::Provider::AwsRdsInstance < Chef::Provisioning::AWSDriver::AWSProvider\n+  REQUIRED_OPTIONS = %w(db_instance_identifier allocated_storage engine\n+                        db_instance_class master_username master_user_password)\n+\n+  OTHER_OPTIONS = %w(engine_version multi_az iops publicly_accessible db_name db_port)\n+\n+  def update_aws_object(instance)\n+    Chef::Log.warn(\"aws_rds_instance does not support modifying a started instance\")\n+  end\n+\n+  def create_aws_object\n+    converge_by \"Create new RDS instance #{new_resource.db_instance_identifier} in #{region}\" do\n+      new_resource.driver.rds.client.create_db_instance(create_options)\n+    end\n+  end\n+\n+  def destroy_aws_object(instance)\n+    converge_by \"Deleting RDS instance #{new_resource.db_instance_identifier} in #{region}\" do\n+      instance.delete(skip_final_snapshot: true)\n+    end\n+  end\n+\n+  def create_options\n+    opts = {}\n+    opts.merge(new_resource.additional_options)\n+    REQUIRED_OPTIONS.each do |opt|\n+      opts[opt] = new_resource.send(opt.to_sym)\n+    end\n+    OTHER_OPTIONS.each do |opt|\n+      opts[opt] = new_resource.send(opt.to_sym) if ! new_resource.send(opt.to_sym).nil?\n+    end\n+    opts[:tags] = hash_to_tag_array(new_resource.aws_tags) if new_resource.aws_tags","path":"lib/chef/provider/aws_rds_instance.rb","position":34,"original_position":34,"commit_id":"269f4ca8ee4bf2956a0d6102b795efb0e8deaf55","original_commit_id":"269f4ca8ee4bf2956a0d6102b795efb0e8deaf55","user":{"login":"tyler-ball","id":2481463,"avatar_url":"https://avatars.githubusercontent.com/u/2481463?v=3","gravatar_id":"","url":"https://api.github.com/users/tyler-ball","html_url":"https://github.com/tyler-ball","followers_url":"https://api.github.com/users/tyler-ball/followers","following_url":"https://api.github.com/users/tyler-ball/following{/other_user}","gists_url":"https://api.github.com/users/tyler-ball/gists{/gist_id}","starred_url":"https://api.github.com/users/tyler-ball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyler-ball/subscriptions","organizations_url":"https://api.github.com/users/tyler-ball/orgs","repos_url":"https://api.github.com/users/tyler-ball/repos","events_url":"https://api.github.com/users/tyler-ball/events{/privacy}","received_events_url":"https://api.github.com/users/tyler-ball/received_events","type":"User","site_admin":false},"body":"You shouldn't _need_ to do this because the provider [takes care](https://github.com/chef/chef-provisioning-aws/blob/master/lib/chef/provisioning/aws_driver/aws_provider.rb#L124) of it for you.\r\n\r\nPros of this - having this here reduces the number of API calls we make to AWS\r\nCons of this - It adds more duplicated tagging code, of which there is already a lot ([1](https://github.com/chef/chef-provisioning-aws/blob/master/lib/chef/provisioning/aws_driver/aws_provider.rb#L237), [2](https://github.com/chef/chef-provisioning-aws/blob/master/lib/chef/provisioning/aws_driver/driver.rb#L94-L101), [3](https://github.com/chef/chef-provisioning-aws/blob/master/lib/chef/provisioning/aws_driver/driver.rb#L284-L311), [4](https://github.com/chef/chef-provisioning-aws/blob/master/lib/chef/provisioning/aws_driver/driver.rb#L1080))\r\n\r\nBecause my primary concern at this point is code complexity I would rather remove this logic and let the provider handle tagging.  Unless that wasn't working somehow?","created_at":"2015-08-06T17:21:29Z","updated_at":"2015-08-06T17:21:29Z","html_url":"https://github.com/chef/chef-provisioning-aws/pull/272#discussion_r36440811","pull_request_url":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/272","_links":{"self":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/comments/36440811"},"html":{"href":"https://github.com/chef/chef-provisioning-aws/pull/272#discussion_r36440811"},"pull_request":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/272"}}},"pull_request":{"url":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/272","id":41462724,"html_url":"https://github.com/chef/chef-provisioning-aws/pull/272","diff_url":"https://github.com/chef/chef-provisioning-aws/pull/272.diff","patch_url":"https://github.com/chef/chef-provisioning-aws/pull/272.patch","issue_url":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/272","number":272,"state":"open","locked":false,"title":"Initial commit of aws_rds_instance resource","user":{"login":"stevendanna","id":852371,"avatar_url":"https://avatars.githubusercontent.com/u/852371?v=3","gravatar_id":"","url":"https://api.github.com/users/stevendanna","html_url":"https://github.com/stevendanna","followers_url":"https://api.github.com/users/stevendanna/followers","following_url":"https://api.github.com/users/stevendanna/following{/other_user}","gists_url":"https://api.github.com/users/stevendanna/gists{/gist_id}","starred_url":"https://api.github.com/users/stevendanna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevendanna/subscriptions","organizations_url":"https://api.github.com/users/stevendanna/orgs","repos_url":"https://api.github.com/users/stevendanna/repos","events_url":"https://api.github.com/users/stevendanna/events{/privacy}","received_events_url":"https://api.github.com/users/stevendanna/received_events","type":"User","site_admin":false},"body":"This is a bare-bones resource for creating and destroying RDS instances.\r\nRDS instances have a lot of possible options, so rather than list them\r\nall in the resources, I've provided an `additional_options` hash that\r\nthe user can use to directly pass options to the underlying driver.  We\r\nwill likely expand the functionality here as we use it ourselves.","created_at":"2015-08-03T12:40:46Z","updated_at":"2015-08-06T17:21:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53eabc63c8e813dfedbccd9daadb9bb57f7e2140","assignee":{"login":"stevendanna","id":852371,"avatar_url":"https://avatars.githubusercontent.com/u/852371?v=3","gravatar_id":"","url":"https://api.github.com/users/stevendanna","html_url":"https://github.com/stevendanna","followers_url":"https://api.github.com/users/stevendanna/followers","following_url":"https://api.github.com/users/stevendanna/following{/other_user}","gists_url":"https://api.github.com/users/stevendanna/gists{/gist_id}","starred_url":"https://api.github.com/users/stevendanna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevendanna/subscriptions","organizations_url":"https://api.github.com/users/stevendanna/orgs","repos_url":"https://api.github.com/users/stevendanna/repos","events_url":"https://api.github.com/users/stevendanna/events{/privacy}","received_events_url":"https://api.github.com/users/stevendanna/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/chef/chef-provisioning-aws/milestones/6","html_url":"https://github.com/chef/chef-provisioning-aws/milestones/1.4.0","labels_url":"https://api.github.com/repos/chef/chef-provisioning-aws/milestones/6/labels","id":1213282,"number":6,"title":"1.4.0","description":"","creator":{"login":"tyler-ball","id":2481463,"avatar_url":"https://avatars.githubusercontent.com/u/2481463?v=3","gravatar_id":"","url":"https://api.github.com/users/tyler-ball","html_url":"https://github.com/tyler-ball","followers_url":"https://api.github.com/users/tyler-ball/followers","following_url":"https://api.github.com/users/tyler-ball/following{/other_user}","gists_url":"https://api.github.com/users/tyler-ball/gists{/gist_id}","starred_url":"https://api.github.com/users/tyler-ball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyler-ball/subscriptions","organizations_url":"https://api.github.com/users/tyler-ball/orgs","repos_url":"https://api.github.com/users/tyler-ball/repos","events_url":"https://api.github.com/users/tyler-ball/events{/privacy}","received_events_url":"https://api.github.com/users/tyler-ball/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":13,"state":"open","created_at":"2015-07-17T17:36:03Z","updated_at":"2015-08-05T09:56:52Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/272/commits","review_comments_url":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/272/comments","review_comment_url":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/272/comments","statuses_url":"https://api.github.com/repos/chef/chef-provisioning-aws/statuses/269f4ca8ee4bf2956a0d6102b795efb0e8deaf55","head":{"label":"chef:ssd/rds-resource","ref":"ssd/rds-resource","sha":"269f4ca8ee4bf2956a0d6102b795efb0e8deaf55","user":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":24198103,"name":"chef-provisioning-aws","full_name":"chef/chef-provisioning-aws","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/chef-provisioning-aws","description":"AWS driver and resources for Chef that uses the AWS SDK","fork":false,"url":"https://api.github.com/repos/chef/chef-provisioning-aws","forks_url":"https://api.github.com/repos/chef/chef-provisioning-aws/forks","keys_url":"https://api.github.com/repos/chef/chef-provisioning-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/chef-provisioning-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/chef-provisioning-aws/teams","hooks_url":"https://api.github.com/repos/chef/chef-provisioning-aws/hooks","issue_events_url":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/events{/number}","events_url":"https://api.github.com/repos/chef/chef-provisioning-aws/events","assignees_url":"https://api.github.com/repos/chef/chef-provisioning-aws/assignees{/user}","branches_url":"https://api.github.com/repos/chef/chef-provisioning-aws/branches{/branch}","tags_url":"https://api.github.com/repos/chef/chef-provisioning-aws/tags","blobs_url":"https://api.github.com/repos/chef/chef-provisioning-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/chef-provisioning-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/chef-provisioning-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/chef-provisioning-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/chef-provisioning-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/chef-provisioning-aws/languages","stargazers_url":"https://api.github.com/repos/chef/chef-provisioning-aws/stargazers","contributors_url":"https://api.github.com/repos/chef/chef-provisioning-aws/contributors","subscribers_url":"https://api.github.com/repos/chef/chef-provisioning-aws/subscribers","subscription_url":"https://api.github.com/repos/chef/chef-provisioning-aws/subscription","commits_url":"https://api.github.com/repos/chef/chef-provisioning-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/chef-provisioning-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/chef-provisioning-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/chef-provisioning-aws/contents/{+path}","compare_url":"https://api.github.com/repos/chef/chef-provisioning-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/chef-provisioning-aws/merges","archive_url":"https://api.github.com/repos/chef/chef-provisioning-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/chef-provisioning-aws/downloads","issues_url":"https://api.github.com/repos/chef/chef-provisioning-aws/issues{/number}","pulls_url":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/chef-provisioning-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/chef-provisioning-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/chef-provisioning-aws/labels{/name}","releases_url":"https://api.github.com/repos/chef/chef-provisioning-aws/releases{/id}","created_at":"2014-09-18T17:32:40Z","updated_at":"2015-08-04T19:30:13Z","pushed_at":"2015-08-05T23:15:37Z","git_url":"git://github.com/chef/chef-provisioning-aws.git","ssh_url":"git@github.com:chef/chef-provisioning-aws.git","clone_url":"https://github.com/chef/chef-provisioning-aws.git","svn_url":"https://github.com/chef/chef-provisioning-aws","homepage":"","size":2733,"stargazers_count":52,"watchers_count":52,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":73,"forks":38,"open_issues":73,"watchers":52,"default_branch":"master"}},"base":{"label":"chef:master","ref":"master","sha":"3635d8853f6169702c679cbd157a9dc46e2c8860","user":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"repo":{"id":24198103,"name":"chef-provisioning-aws","full_name":"chef/chef-provisioning-aws","owner":{"login":"chef","id":29740,"avatar_url":"https://avatars.githubusercontent.com/u/29740?v=3","gravatar_id":"","url":"https://api.github.com/users/chef","html_url":"https://github.com/chef","followers_url":"https://api.github.com/users/chef/followers","following_url":"https://api.github.com/users/chef/following{/other_user}","gists_url":"https://api.github.com/users/chef/gists{/gist_id}","starred_url":"https://api.github.com/users/chef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chef/subscriptions","organizations_url":"https://api.github.com/users/chef/orgs","repos_url":"https://api.github.com/users/chef/repos","events_url":"https://api.github.com/users/chef/events{/privacy}","received_events_url":"https://api.github.com/users/chef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chef/chef-provisioning-aws","description":"AWS driver and resources for Chef that uses the AWS SDK","fork":false,"url":"https://api.github.com/repos/chef/chef-provisioning-aws","forks_url":"https://api.github.com/repos/chef/chef-provisioning-aws/forks","keys_url":"https://api.github.com/repos/chef/chef-provisioning-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chef/chef-provisioning-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chef/chef-provisioning-aws/teams","hooks_url":"https://api.github.com/repos/chef/chef-provisioning-aws/hooks","issue_events_url":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/events{/number}","events_url":"https://api.github.com/repos/chef/chef-provisioning-aws/events","assignees_url":"https://api.github.com/repos/chef/chef-provisioning-aws/assignees{/user}","branches_url":"https://api.github.com/repos/chef/chef-provisioning-aws/branches{/branch}","tags_url":"https://api.github.com/repos/chef/chef-provisioning-aws/tags","blobs_url":"https://api.github.com/repos/chef/chef-provisioning-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chef/chef-provisioning-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chef/chef-provisioning-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/chef/chef-provisioning-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chef/chef-provisioning-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/chef/chef-provisioning-aws/languages","stargazers_url":"https://api.github.com/repos/chef/chef-provisioning-aws/stargazers","contributors_url":"https://api.github.com/repos/chef/chef-provisioning-aws/contributors","subscribers_url":"https://api.github.com/repos/chef/chef-provisioning-aws/subscribers","subscription_url":"https://api.github.com/repos/chef/chef-provisioning-aws/subscription","commits_url":"https://api.github.com/repos/chef/chef-provisioning-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/chef/chef-provisioning-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/chef/chef-provisioning-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/comments{/number}","contents_url":"https://api.github.com/repos/chef/chef-provisioning-aws/contents/{+path}","compare_url":"https://api.github.com/repos/chef/chef-provisioning-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chef/chef-provisioning-aws/merges","archive_url":"https://api.github.com/repos/chef/chef-provisioning-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chef/chef-provisioning-aws/downloads","issues_url":"https://api.github.com/repos/chef/chef-provisioning-aws/issues{/number}","pulls_url":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/chef/chef-provisioning-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/chef/chef-provisioning-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chef/chef-provisioning-aws/labels{/name}","releases_url":"https://api.github.com/repos/chef/chef-provisioning-aws/releases{/id}","created_at":"2014-09-18T17:32:40Z","updated_at":"2015-08-04T19:30:13Z","pushed_at":"2015-08-05T23:15:37Z","git_url":"git://github.com/chef/chef-provisioning-aws.git","ssh_url":"git@github.com:chef/chef-provisioning-aws.git","clone_url":"https://github.com/chef/chef-provisioning-aws.git","svn_url":"https://github.com/chef/chef-provisioning-aws","homepage":"","size":2733,"stargazers_count":52,"watchers_count":52,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":73,"forks":38,"open_issues":73,"watchers":52,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/272"},"html":{"href":"https://github.com/chef/chef-provisioning-aws/pull/272"},"issue":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/272"},"comments":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/272/comments"},"review_comments":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/272/comments"},"review_comment":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/272/commits"},"statuses":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/statuses/269f4ca8ee4bf2956a0d6102b795efb0e8deaf55"}}}}