65
65
'Value': {'Type': 'String',
67
67
properties_schema = {
68
'AvailabilityZones': {'Required': True,
70
'LaunchConfigurationName': {'Required': True,
72
'Size': {'Required': True,
74
'LoadBalancerNames': {'Type': 'List'},
75
'Tags': {'Type': 'List',
76
'Schema': {'Type': 'Map',
77
'Schema': tags_schema}}
68
'AvailabilityZones': {
71
'Description': _('Not Implemented.')},
72
'LaunchConfigurationName': {
75
'Description': _('Name of LaunchConfiguration resource.')},
79
'Description': _('Desired number of instances.')},
80
'LoadBalancerNames': {
82
'Description': _('List of LoadBalancer resources.')},
85
'Schema': {'Type': 'Map', 'Schema': tags_schema},
86
'Description': _('Tags to attach to this group.')}
79
88
update_allowed_keys = ('Properties', 'UpdatePolicy',)
80
89
update_allowed_properties = ('Size', 'LaunchConfigurationName',)
81
90
attributes_schema = {
82
"InstanceList": ("A comma-delimited list of server ip addresses. "
91
"InstanceList": _("A comma-delimited list of server ip addresses. "
85
94
rolling_update_schema = {
86
95
'MinInstancesInService': properties.Schema(properties.NUMBER,
269
278
'Value': {'Type': 'String',
270
279
'Required': True}}
271
280
properties_schema = {
272
'AvailabilityZones': {'Required': True,
274
'LaunchConfigurationName': {'Required': True,
276
'MaxSize': {'Required': True,
278
'MinSize': {'Required': True,
280
'Cooldown': {'Type': 'String'},
281
'DesiredCapacity': {'Type': 'Number'},
282
'HealthCheckGracePeriod': {'Type': 'Integer',
283
'Implemented': False},
284
'HealthCheckType': {'Type': 'String',
285
'AllowedValues': ['EC2', 'ELB'],
286
'Implemented': False},
287
'LoadBalancerNames': {'Type': 'List'},
288
'VPCZoneIdentifier': {'Type': 'List'},
289
'Tags': {'Type': 'List', 'Schema': {'Type': 'Map',
290
'Schema': tags_schema}}
281
'AvailabilityZones': {
284
'Description': _('Not Implemented.')},
285
'LaunchConfigurationName': {
288
'Description': _('Name of LaunchConfiguration resource.')},
292
'Description': _('Maximum number of instances in the group.')},
296
'Description': _('Minimum number of instances in the group.')},
299
'Description': _('Cooldown period, in seconds.')},
302
'Description': _('Desired initial number of instances.')},
303
'HealthCheckGracePeriod': {
305
'Implemented': False,
306
'Description': _('Not Implemented.')},
309
'AllowedValues': ['EC2', 'ELB'],
310
'Implemented': False,
311
'Description': _('Not Implemented.')},
312
'LoadBalancerNames': {
314
'Description': _('List of LoadBalancer resources.')},
315
'VPCZoneIdentifier': {
317
'Description': _('List of VPC subnet identifiers.')},
320
'Schema': {'Type': 'Map', 'Schema': tags_schema},
321
'Description': _('Tags to attach to this group.')}
292
323
rolling_update_schema = {
293
324
'MinInstancesInService': properties.Schema(properties.NUMBER,
433
461
'Value': {'Type': 'String',
434
462
'Required': True}}
435
463
properties_schema = {
436
'ImageId': {'Type': 'String',
438
'InstanceType': {'Type': 'String',
440
'KeyName': {'Type': 'String'},
441
'UserData': {'Type': 'String'},
442
'SecurityGroups': {'Type': 'List'},
443
'KernelId': {'Type': 'String',
444
'Implemented': False},
445
'RamDiskId': {'Type': 'String',
446
'Implemented': False},
447
'BlockDeviceMappings': {'Type': 'String',
448
'Implemented': False},
449
'NovaSchedulerHints': {'Type': 'List',
450
'Schema': {'Type': 'Map',
451
'Schema': tags_schema}},
467
'Description': _('Glance image ID or name.')},
471
'Description': _('Nova instance type (flavor).')},
474
'Description': _('Optional Nova keypair name.')},
477
'Description': _('User data to pass to instance.')},
480
'Description': _('Security group names to assign.')},
483
'Implemented': False,
484
'Description': _('Not Implemented.')},
487
'Implemented': False,
488
'Description': _('Not Implemented.')},
489
'BlockDeviceMappings': {
491
'Implemented': False,
492
'Description': _('Not Implemented.')},
493
'NovaSchedulerHints': {
495
'Schema': {'Type': 'Map', 'Schema': tags_schema},
496
'Description': _('Scheduler hints to pass '
497
'to Nova (Heat extension).')},
454
500
def FnGetRefId(self):
458
504
class ScalingPolicy(signal_responder.SignalResponder, CooldownMixin):
459
505
properties_schema = {
460
'AutoScalingGroupName': {'Type': 'String',
462
'ScalingAdjustment': {'Type': 'Number',
464
'AdjustmentType': {'Type': 'String',
465
'AllowedValues': ['ChangeInCapacity',
467
'PercentChangeInCapacity'],
469
'Cooldown': {'Type': 'Number'},
506
'AutoScalingGroupName': {
509
'Description': _('AutoScaling group name to apply policy to.')},
510
'ScalingAdjustment': {
513
'Description': _('Size of adjustment.')},
516
'AllowedValues': ['ChangeInCapacity',
518
'PercentChangeInCapacity'],
520
'Description': _('Type of adjustment (absolute or percentage).')},
523
'Description': _('Cooldown period, in seconds.')},
472
526
update_allowed_keys = ('Properties',)
473
527
update_allowed_properties = ('ScalingAdjustment', 'AdjustmentType',
475
529
attributes_schema = {
476
"AlarmUrl": ("A signed url to handle the alarm. "
530
"AlarmUrl": _("A signed url to handle the alarm. "
480
534
def handle_update(self, json_snippet, tmpl_diff, prop_diff):
512
566
(self.name, self.properties['Cooldown']))
515
group = self.stack[self.properties['AutoScalingGroupName']]
569
asgn_id = self.properties['AutoScalingGroupName']
570
group = self.stack.resource_by_refid(asgn_id)
517
572
logger.info('%s Alarm, adjusting Group %s by %s' %
518
573
(self.name, group.name,