{"action":"created","comment":{"url":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/comments/31482301","id":31482301,"diff_hunk":"@@ -0,0 +1,31 @@\n+require 'chef/provisioning/aws_driver/aws_resource'\n+\n+class Chef::Resource::AwsCacheCluster < Chef::Provisioning::AWSDriver::AWSResource\n+  aws_sdk_type AWS::ElastiCache\n+\n+  attribute :cluster_name, kind_of: String, name_attribute: true\n+  attribute :az_mode, kind_of: String\n+  attribute :preferred_availability_zone, kind_of: String\n+  attribute :preferred_availability_zones,","path":"lib/chef/resource/aws_cache_cluster.rb","position":9,"original_position":9,"commit_id":"f91f9db5d3af4adbab2cd72bf46f73a54c4efa6a","original_commit_id":"f91f9db5d3af4adbab2cd72bf46f73a54c4efa6a","user":{"login":"dblessing","id":2394772,"avatar_url":"https://avatars.githubusercontent.com/u/2394772?v=3","gravatar_id":"","url":"https://api.github.com/users/dblessing","html_url":"https://github.com/dblessing","followers_url":"https://api.github.com/users/dblessing/followers","following_url":"https://api.github.com/users/dblessing/following{/other_user}","gists_url":"https://api.github.com/users/dblessing/gists{/gist_id}","starred_url":"https://api.github.com/users/dblessing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblessing/subscriptions","organizations_url":"https://api.github.com/users/dblessing/orgs","repos_url":"https://api.github.com/users/dblessing/repos","events_url":"https://api.github.com/users/dblessing/events{/privacy}","received_events_url":"https://api.github.com/users/dblessing/received_events","type":"User","site_admin":false},"body":"I tried to stay as close to the API implementation as possible. Both are present here http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/ElastiCache/Client/V20140930.html#create_cache_cluster-instance_method \r\n\r\nI can try to combine them, but I need to test what valid values are for each. The `preferred_availability_zones` documentation makes the array values look weird.","created_at":"2015-06-01T23:44:05Z","updated_at":"2015-06-01T23:44:05Z","html_url":"https://github.com/chef/chef-provisioning-aws/pull/212#discussion_r31482301","pull_request_url":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/212","_links":{"self":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/comments/31482301"},"html":{"href":"https://github.com/chef/chef-provisioning-aws/pull/212#discussion_r31482301"},"pull_request":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/212"}}},"pull_request":{"url":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/212","id":36260847,"html_url":"https://github.com/chef/chef-provisioning-aws/pull/212","diff_url":"https://github.com/chef/chef-provisioning-aws/pull/212.diff","patch_url":"https://github.com/chef/chef-provisioning-aws/pull/212.patch","issue_url":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/212","number":212,"state":"open","locked":false,"title":"Feedback: Elasticache","user":{"login":"dblessing","id":2394772,"avatar_url":"https://avatars.githubusercontent.com/u/2394772?v=3","gravatar_id":"","url":"https://api.github.com/users/dblessing","html_url":"https://github.com/dblessing","followers_url":"https://api.github.com/users/dblessing/followers","following_url":"https://api.github.com/users/dblessing/following{/other_user}","gists_url":"https://api.github.com/users/dblessing/gists{/gist_id}","starred_url":"https://api.github.com/users/dblessing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblessing/subscriptions","organizations_url":"https://api.github.com/users/dblessing/orgs","repos_url":"https://api.github.com/users/dblessing/repos","events_url":"https://api.github.com/users/dblessing/events{/privacy}","received_events_url":"https://api.github.com/users/dblessing/received_events","type":"User","site_admin":false},"body":"Fixes #207 - Support for defining an Elasticache cluster (Redis/Memcache)\r\n\r\n- [x] Subnet group\r\n- [x] ~~Security group~~\r\n- [x] Cache cluster\r\n- [x] Replication group (Required for redis clustering)\r\n\r\nEdit: Security groups aren't necessary. Only if creating a cache cluster outside of a VPC\r\n\r\nLike RDS, Elasticache has a one to many relationship between subnet/security groups and the actual cache cluster. Thus, they must be separate resources. Unfortunately it is not possible to re-use regular VPC subnet/security groups.\r\n\r\nElasticache is kind of a beast because there's no SDK resource class, only a client. This implementation works for subnet groups just fine. Hopefully we can carry that in to the security groups and cache cluster, too. \r\n\r\nInput is greatly appreciated. I decided to go w/ `cache` in the resource names as opposed to `elasticache` to keep it from being too wordy. \r\n\r\nI will add some tests before I'm done.\r\n\r\nSubnet group resource example (vpc is implicit based on subnets specified):\r\n```\r\naws_cache_subnet_group 'test-ec' do\r\n  description 'My awesome group'\r\n  subnets [ 'public-test' ]\r\nend\r\n```\r\n\r\nCache cluster resource example:\r\n```\r\naws_cache_cluster 'my-cluster-mem' do\r\n  number_nodes 2\r\n  node_type 'cache.t2.micro'\r\n  engine 'memcached'\r\n  engine_version '1.4.14'\r\n  security_groups ['my_security_group']\r\n  subnet_group_name 'test-ec'\r\nend\r\n```","created_at":"2015-05-27T01:10:46Z","updated_at":"2015-06-01T23:44:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c300b07a4dc036e662c7fdcd3117ce9da3cd9cfd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/212/commits","review_comments_url":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/212/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/212/comments","statuses_url":"https://api.github.com/repos/chef/chef-provisioning-aws/statuses/f91f9db5d3af4adbab2cd72bf46f73a54c4efa6a","head":{"label":"dblessing:elasticache","ref":"elasticache","sha":"f91f9db5d3af4adbab2cd72bf46f73a54c4efa6a","user":{"login":"dblessing","id":2394772,"avatar_url":"https://avatars.githubusercontent.com/u/2394772?v=3","gravatar_id":"","url":"https://api.github.com/users/dblessing","html_url":"https://github.com/dblessing","followers_url":"https://api.github.com/users/dblessing/followers","following_url":"https://api.github.com/users/dblessing/following{/other_user}","gists_url":"https://api.github.com/users/dblessing/gists{/gist_id}","starred_url":"https://api.github.com/users/dblessing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblessing/subscriptions","organizations_url":"https://api.github.com/users/dblessing/orgs","repos_url":"https://api.github.com/users/dblessing/repos","events_url":"https://api.github.com/users/dblessing/events{/privacy}","received_events_url":"https://api.github.com/users/dblessing/received_events","type":"User","site_admin":false},"repo":{"id":32890703,"name":"chef-provisioning-aws","full_name":"dblessing/chef-provisioning-aws","owner":{"login":"dblessing","id":2394772,"avatar_url":"https://avatars.githubusercontent.com/u/2394772?v=3","gravatar_id":"","url":"https://api.github.com/users/dblessing","html_url":"https://github.com/dblessing","followers_url":"https://api.github.com/users/dblessing/followers","following_url":"https://api.github.com/users/dblessing/following{/other_user}","gists_url":"https://api.github.com/users/dblessing/gists{/gist_id}","starred_url":"https://api.github.com/users/dblessing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dblessing/subscriptions","organizations_url":"https://api.github.com/users/dblessing/orgs","repos_url":"https://api.github.com/users/dblessing/repos","events_url":"https://api.github.com/users/dblessing/events{/privacy}","received_events_url":"https://api.github.com/users/dblessing/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dblessing/chef-provisioning-aws","description":"AWS driver and resources for Chef that uses the AWS SDK","fork":true,"url":"https://api.github.com/repos/dblessing/chef-provisioning-aws","forks_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/forks","keys_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/teams","hooks_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/hooks","issue_events_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/issues/events{/number}","events_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/events","assignees_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/assignees{/user}","branches_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/branches{/branch}","tags_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/tags","blobs_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/git/refs{/sha}","trees_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/statuses/{sha}","languages_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/languages","stargazers_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/stargazers","contributors_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/contributors","subscribers_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/subscribers","subscription_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/subscription","commits_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/commits{/sha}","git_commits_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/git/commits{/sha}","comments_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/comments{/number}","issue_comment_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/issues/comments{/number}","contents_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/contents/{+path}","compare_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/merges","archive_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/downloads","issues_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/issues{/number}","pulls_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/pulls{/number}","milestones_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/milestones{/number}","notifications_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/labels{/name}","releases_url":"https://api.github.com/repos/dblessing/chef-provisioning-aws/releases{/id}","created_at":"2015-03-25T21:03:47Z","updated_at":"2015-04-08T12:53:52Z","pushed_at":"2015-05-28T21:19:25Z","git_url":"git://github.com/dblessing/chef-provisioning-aws.git","ssh_url":"git@github.com:dblessing/chef-provisioning-aws.git","clone_url":"https://github.com/dblessing/chef-provisioning-aws.git","svn_url":"https://github.com/dblessing/chef-provisioning-aws","homepage":"","size":788,"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":"chef:master","ref":"master","sha":"8558aa974d1ac7645c653ee5b6d711500b8dcc3b","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-05-27T04:39:56Z","pushed_at":"2015-05-28T21:19:26Z","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":4071,"stargazers_count":41,"watchers_count":41,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":67,"forks":32,"open_issues":67,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/212"},"html":{"href":"https://github.com/chef/chef-provisioning-aws/pull/212"},"issue":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/212"},"comments":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/issues/212/comments"},"review_comments":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/pulls/212/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/212/commits"},"statuses":{"href":"https://api.github.com/repos/chef/chef-provisioning-aws/statuses/f91f9db5d3af4adbab2cd72bf46f73a54c4efa6a"}}}}