From 720aeffca2bd2ae1eca158abc2d1463a8597afb6 Mon Sep 17 00:00:00 2001 From: Scot Spinner Date: Mon, 18 May 2015 10:34:21 -0700 Subject: [PATCH 1/2] adding parameter group option --- cloud/amazon/elasticache.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cloud/amazon/elasticache.py b/cloud/amazon/elasticache.py index bc51fd6d264..5e9c2cc0e12 100644 --- a/cloud/amazon/elasticache.py +++ b/cloud/amazon/elasticache.py @@ -57,6 +57,11 @@ options: - The port number on which each of the cache nodes will accept connections required: false default: 11211 + parameter_group: + description: + - Specify non-default parameter group names to be associated with cache cluster + required: false + default: None cache_subnet_group: description: - The subnet group name to associate with. Only use if inside a vpc. Required if inside a vpc @@ -148,7 +153,7 @@ class ElastiCacheManager(object): EXIST_STATUSES = ['available', 'creating', 'rebooting', 'modifying'] def __init__(self, module, name, engine, cache_engine_version, node_type, - num_nodes, cache_port, cache_subnet_group, + num_nodes, cache_port, parameter_group, cache_subnet_group, cache_security_groups, security_group_ids, zone, wait, hard_modify, region, **aws_connect_kwargs): self.module = module @@ -158,6 +163,7 @@ class ElastiCacheManager(object): self.node_type = node_type self.num_nodes = num_nodes self.cache_port = cache_port + self.parameter_group = parameter_group self.cache_subnet_group = cache_subnet_group self.cache_security_groups = cache_security_groups self.security_group_ids = security_group_ids @@ -216,6 +222,7 @@ class ElastiCacheManager(object): engine_version=self.cache_engine_version, cache_security_group_names=self.cache_security_groups, security_group_ids=self.security_group_ids, + cache_parameter_group_name=self.parameter_group, cache_subnet_group_name=self.cache_subnet_group, preferred_availability_zone=self.zone, port=self.cache_port) @@ -291,6 +298,7 @@ class ElastiCacheManager(object): num_cache_nodes=self.num_nodes, cache_node_ids_to_remove=nodes_to_remove, cache_security_group_names=self.cache_security_groups, + cache_parameter_group_name=self.parameter_group, security_group_ids=self.security_group_ids, apply_immediately=True, engine_version=self.cache_engine_version) @@ -481,6 +489,7 @@ def main(): node_type={'required': False, 'default': 'cache.m1.small'}, num_nodes={'required': False, 'default': None, 'type': 'int'}, cache_port={'required': False, 'default': 11211, 'type': 'int'}, + parameter_group={'required': False, 'default': None}, cache_subnet_group={'required': False, 'default': None}, cache_security_groups={'required': False, 'default': [default], 'type': 'list'}, @@ -514,6 +523,7 @@ def main(): zone = module.params['zone'] wait = module.params['wait'] hard_modify = module.params['hard_modify'] + parameter_group = module.params['parameter_group'] if cache_subnet_group and cache_security_groups == [default]: cache_security_groups = [] @@ -534,7 +544,7 @@ def main(): num_nodes, cache_port, cache_subnet_group, cache_security_groups, - security_group_ids, zone, wait, + security_group_ids, parameter_group, zone, wait, hard_modify, region, **aws_connect_kwargs) if state == 'present': From abf20836711ac0835e869adaa201e6732bb49482 Mon Sep 17 00:00:00 2001 From: Scot Spinner Date: Fri, 24 Jul 2015 14:11:53 -0700 Subject: [PATCH 2/2] one thing missed --- cloud/amazon/elasticache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/amazon/elasticache.py b/cloud/amazon/elasticache.py index deea0940995..5e5d3b6ee96 100644 --- a/cloud/amazon/elasticache.py +++ b/cloud/amazon/elasticache.py @@ -56,7 +56,7 @@ options: description: - The port number on which each of the cache nodes will accept connections required: false - default: 11211 + default: none parameter_group: description: - Specify non-default parameter group names to be associated with cache cluster