本文整理汇总了Python中troposphere.autoscaling.AutoScalingGroup类的典型用法代码示例。如果您正苦于以下问题:Python AutoScalingGroup类的具体用法?Python AutoScalingGroup怎么用?Python AutoScalingGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AutoScalingGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_none
def test_none(self):
group = AutoScalingGroup(
'mygroup',
MaxSize="1",
MinSize="1",
)
with self.assertRaises(ValueError):
self.assertTrue(group.validate())
示例2: test_instanceid
def test_instanceid(self):
group = AutoScalingGroup(
'mygroup',
InstanceId="i-1234",
MaxSize="1",
MinSize="1",
)
self.assertTrue(group.validate())
示例3: test_launchconfigurationname
def test_launchconfigurationname(self):
group = AutoScalingGroup(
'mygroup',
LaunchConfigurationName="I'm a test",
MaxSize="1",
MinSize="1",
)
self.assertTrue(group.validate())
示例4: test_launchconfigurationname
def test_launchconfigurationname(self):
group = AutoScalingGroup(
"mygroup",
AvailabilityZones=["eu-west-1a", "eu-west-1b"],
LaunchConfigurationName="I'm a test",
MaxSize="1",
MinSize="1",
)
self.assertTrue(group.validate())
示例5: test_instanceid
def test_instanceid(self):
group = AutoScalingGroup(
'mygroup',
AvailabilityZones=['eu-west-1a', 'eu-west-1b'],
InstanceId="i-1234",
MaxSize="1",
MinSize="1",
)
self.assertTrue(group.validate())
示例6: test_exclusive
def test_exclusive(self):
group = AutoScalingGroup(
'mygroup',
InstanceId="i-1234",
LaunchConfigurationName="I'm a test",
MaxSize="1",
MinSize="1",
)
with self.assertRaises(ValueError):
self.assertTrue(group.validate())
示例7: test_AutoScalingRollingUpdate_all_defaults
def test_AutoScalingRollingUpdate_all_defaults(self):
group = AutoScalingGroup(
'mygroup',
AvailabilityZones=['eu-west-1a', 'eu-west-1b'],
LaunchConfigurationName="I'm a test",
MaxSize="1",
MinSize="1",
UpdatePolicy=UpdatePolicy(
AutoScalingRollingUpdate=AutoScalingRollingUpdate())
)
self.assertTrue(group.validate())
示例8: test_working
def test_working(self):
group = AutoScalingGroup('mygroup',
LaunchConfigurationName="I'm a test",
MaxSize="4",
MinSize="2",
UpdatePolicy=UpdatePolicy('AutoScalingRollingUpdate',
PauseTime='PT1M5S',
MinInstancesInService='2',
MaxBatchSize='1',
)
)
self.assertTrue(group.validate())
示例9: test_mininstances
def test_mininstances(self):
group = AutoScalingGroup('mygroup',
LaunchConfigurationName="I'm a test",
MaxSize="1",
MinSize="1",
UpdatePolicy=UpdatePolicy('AutoScalingRollingUpdate',
PauseTime='PT1M5S',
MinInstancesInService='1',
MaxBatchSize='1',
)
)
with self.assertRaises(ValueError):
self.assertTrue(group.validate())
示例10: test_size_if
def test_size_if(self):
group = AutoScalingGroup(
"mygroup",
AvailabilityZones=["eu-west-1a", "eu-west-1b"],
LaunchConfigurationName="I'm a test",
MaxSize=If("isstage", "1", "5"),
MinSize="1",
UpdatePolicy=UpdatePolicy(
AutoScalingRollingUpdate=AutoScalingRollingUpdate(
PauseTime="PT5M", MinInstancesInService="1", MaxBatchSize="1", WaitOnResourceSignals=True
)
),
)
self.assertTrue(group.validate())
示例11: test_helperfn_as_updatepolicy
def test_helperfn_as_updatepolicy(self):
update_policy = UpdatePolicy(
AutoScalingRollingUpdate=AutoScalingRollingUpdate(
PauseTime="PT5M", MinInstancesInService="1", MaxBatchSize="1", WaitOnResourceSignals=True
)
)
group = AutoScalingGroup(
"mygroup",
AvailabilityZones=["eu-west-1a", "eu-west-1b"],
LaunchConfigurationName="I'm a test",
MaxSize=If("isstage", "1", "5"),
MinSize="1",
UpdatePolicy=If("UseUpdatePolicy", update_policy, Ref("AWS::NoValue")),
)
self.assertTrue(group.validate())
示例12: test_mininstances_mininstancesinservice_is_ref
def test_mininstances_mininstancesinservice_is_ref(self):
paramMinInstancesInService = Parameter(
"ParamMinInstancesInService",
Type="String"
)
group = AutoScalingGroup(
'mygroup',
LaunchConfigurationName="I'm a test",
MaxSize="4",
MinSize="2",
UpdatePolicy=UpdatePolicy(
'AutoScalingRollingUpdate',
PauseTime='PT1M5S',
MinInstancesInService=Ref(paramMinInstancesInService),
MaxBatchSize="2",
)
)
self.assertTrue(group.validate())
示例13: test_AutoScalingRollingUpdate_validation
def test_AutoScalingRollingUpdate_validation(self):
update_policy = UpdatePolicy(
AutoScalingRollingUpdate=AutoScalingRollingUpdate(
MinInstancesInService="2",
MaxBatchSize='1'
)
)
group = AutoScalingGroup(
'mygroup',
AvailabilityZones=['eu-west-1a', 'eu-west-1b'],
LaunchConfigurationName="I'm a test",
MaxSize="2",
MinSize="1",
UpdatePolicy=update_policy
)
with self.assertRaises(ValueError):
self.assertTrue(group.validate())
示例14: test_mininstances_maxsize_is_ref
def test_mininstances_maxsize_is_ref(self):
paramMaxSize = Parameter(
"ParamMaxSize",
Type="String"
)
group = AutoScalingGroup(
'mygroup',
AvailabilityZones=['eu-west-1a', 'eu-west-1b'],
LaunchConfigurationName="I'm a test",
MaxSize=Ref(paramMaxSize),
MinSize="2",
UpdatePolicy=UpdatePolicy(
AutoScalingRollingUpdate=AutoScalingRollingUpdate(
PauseTime='PT1M5S',
MinInstancesInService='2',
MaxBatchSize="1"
)
)
)
self.assertTrue(group.validate())
示例15: test_instanceid
def test_instanceid(self):
group = AutoScalingGroup(
"mygroup", AvailabilityZones=["eu-west-1a", "eu-west-1b"], InstanceId="i-1234", MaxSize="1", MinSize="1"
)
self.assertTrue(group.validate())