From 3a881640fa79c859f3559dbf7614c85423d4d38e Mon Sep 17 00:00:00 2001 From: Todd Lisonbee Date: Wed, 19 Apr 2017 11:38:36 -0700 Subject: [PATCH 1/2] Parameterizing PauseTime and WaitOnResourceSignals --- smaas-cf/smaas/cms-cluster.py | 18 ++++++++++++++++-- smaas-cf/smaas/consul-cluster.py | 18 ++++++++++++++++-- smaas-cf/smaas/gateway-cluster.py | 18 ++++++++++++++++-- smaas-cf/smaas/vault-cluster.py | 20 ++++++++++++++++++-- 4 files changed, 66 insertions(+), 8 deletions(-) diff --git a/smaas-cf/smaas/cms-cluster.py b/smaas-cf/smaas/cms-cluster.py index 9b99c521..7642f053 100644 --- a/smaas-cf/smaas/cms-cluster.py +++ b/smaas-cf/smaas/cms-cluster.py @@ -150,6 +150,20 @@ Default="3" )) +pause_time_param = template.add_parameter(Parameter( + "pauseTime", + Description="Pause time for AutoScalingRollingUpdate e.g PT15M", + Type="String", + Default="PT15M" +)) + +wait_on_resource_signals_param = template.add_parameter(Parameter( + "waitOnResourceSignals", + Description="Enabling WaitOnResourceSignals allows CloudFormation to wait until you have received a success signal before performing the next scaling action.", + Type="String", + Default="True" +)) + ### # # Elastic Load Balancers @@ -241,8 +255,8 @@ AutoScalingRollingUpdate=AutoScalingRollingUpdate( MaxBatchSize=1, MinInstancesInService=Ref(minimum_instances_param), - PauseTime="PT15M", - WaitOnResourceSignals=True + PauseTime=Ref(pause_time_param), + WaitOnResourceSignals=Ref(wait_on_resource_signals_param) ) ), VPCZoneIdentifier=subnet_id_refs, diff --git a/smaas-cf/smaas/consul-cluster.py b/smaas-cf/smaas/consul-cluster.py index 649b0c6c..0c71314d 100644 --- a/smaas-cf/smaas/consul-cluster.py +++ b/smaas-cf/smaas/consul-cluster.py @@ -113,6 +113,20 @@ Default="3" )) +pause_time_param = template.add_parameter(Parameter( + "pauseTime", + Description="Pause time for AutoScalingRollingUpdate e.g PT15M", + Type="String", + Default="PT15M" +)) + +wait_on_resource_signals_param = template.add_parameter(Parameter( + "waitOnResourceSignals", + Description="Enabling WaitOnResourceSignals allows CloudFormation to wait until you have received a success signal before performing the next scaling action.", + Type="String", + Default="True" +)) + subnet_id_refs = [] for zone_identifier in range(1, 4): vpc_subnet_id = template.add_parameter(Parameter( @@ -158,8 +172,8 @@ AutoScalingRollingUpdate=AutoScalingRollingUpdate( MaxBatchSize=1, MinInstancesInService=Ref(minimum_instances_param), - PauseTime="PT15M", - WaitOnResourceSignals=True + PauseTime=Ref(pause_time_param), + WaitOnResourceSignals=Ref(wait_on_resource_signals_param) ) ), VPCZoneIdentifier=subnet_id_refs, diff --git a/smaas-cf/smaas/gateway-cluster.py b/smaas-cf/smaas/gateway-cluster.py index 1e2bc7fc..9a0c8468 100644 --- a/smaas-cf/smaas/gateway-cluster.py +++ b/smaas-cf/smaas/gateway-cluster.py @@ -182,6 +182,20 @@ Default="3" )) +pause_time_param = template.add_parameter(Parameter( + "pauseTime", + Description="Pause time for AutoScalingRollingUpdate e.g PT15M", + Type="String", + Default="PT15M" +)) + +wait_on_resource_signals_param = template.add_parameter(Parameter( + "waitOnResourceSignals", + Description="Enabling WaitOnResourceSignals allows CloudFormation to wait until you have received a success signal before performing the next scaling action.", + Type="String", + Default="True" +)) + ### # # Elastic Load Balancer @@ -296,8 +310,8 @@ AutoScalingRollingUpdate=AutoScalingRollingUpdate( MaxBatchSize=1, MinInstancesInService=Ref(minimum_instances_param), - PauseTime="PT15M", - WaitOnResourceSignals=True + PauseTime=Ref(pause_time_param), + WaitOnResourceSignals=Ref(wait_on_resource_signals_param) ) ), VPCZoneIdentifier=subnet_id_refs, diff --git a/smaas-cf/smaas/vault-cluster.py b/smaas-cf/smaas/vault-cluster.py index d94ea2f1..eee2b661 100644 --- a/smaas-cf/smaas/vault-cluster.py +++ b/smaas-cf/smaas/vault-cluster.py @@ -168,6 +168,22 @@ Default="3" )) + +pause_time_param = template.add_parameter(Parameter( + "pauseTime", + Description="Pause time for AutoScalingRollingUpdate e.g PT15M", + Type="String", + Default="PT15M" +)) + +wait_on_resource_signals_param = template.add_parameter(Parameter( + "waitOnResourceSignals", + Description="Enabling WaitOnResourceSignals allows CloudFormation to wait until you have received a success signal before performing the next scaling action.", + Type="String", + Default="True" +)) + + ### # # Elastic Load Balancer @@ -285,8 +301,8 @@ AutoScalingRollingUpdate=AutoScalingRollingUpdate( MaxBatchSize=1, MinInstancesInService=Ref(minimum_instances_param), - PauseTime="PT15M", - WaitOnResourceSignals=True + PauseTime=Ref(pause_time_param), + WaitOnResourceSignals=Ref(wait_on_resource_signals_param) ) ), VPCZoneIdentifier=subnet_id_refs, From 78fd0aa22f2ca862997341958f928df06ec5667a Mon Sep 17 00:00:00 2001 From: Todd Lisonbee Date: Wed, 19 Apr 2017 13:50:15 -0700 Subject: [PATCH 2/2] Version 0.19.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 09f65e6d..024cf3ed 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,4 +16,4 @@ group=com.nike artifactId=cerberus-lifecycle-cli -version=0.18.0 +version=0.19.0