本文整理汇总了Python中troposphere.autoscaling.AutoScalingGroup.LaunchConfigurationName方法的典型用法代码示例。如果您正苦于以下问题:Python AutoScalingGroup.LaunchConfigurationName方法的具体用法?Python AutoScalingGroup.LaunchConfigurationName怎么用?Python AutoScalingGroup.LaunchConfigurationName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类troposphere.autoscaling.AutoScalingGroup
的用法示例。
在下文中一共展示了AutoScalingGroup.LaunchConfigurationName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: LaunchConfiguration
# 需要导入模块: from troposphere.autoscaling import AutoScalingGroup [as 别名]
# 或者: from troposphere.autoscaling.AutoScalingGroup import LaunchConfigurationName [as 别名]
consul_block_device_mapping.Ebs = consul_block_device
consul_launch_config = LaunchConfiguration(config['name'] + 'ConsulLaunchConfig')
consul_launch_config.AssociatePublicIpAddress = True
consul_launch_config.EbsOptimized = config['consul_launch_config']['ebs_optimized']
consul_launch_config.ImageId = config['consul_launch_config']['image_id']
consul_launch_config.KeyName = config['consul_launch_config']['key_name']
consul_launch_config.InstanceType = config['consul_launch_config']['instance_type']
consul_launch_config.BlockDeviceMappings = [consul_block_device_mapping]
consul_launch_config.SecurityGroups = [Ref(config['name'] + 'homeSsh'), Ref(consul_sg)]
t.add_resource(consul_launch_config)
# auto scale group for consul server
consul_asg = AutoScalingGroup(config['name'] + 'ConsulAsg')
consul_asg.AvailabilityZones = config['consul_asg']['availability_zones']
consul_asg.LaunchConfigurationName = Ref(consul_launch_config)
consul_asg.MaxSize = config['consul_asg']['max_size']
consul_asg.MinSize = config['consul_asg']['min_size']
consul_asg.VPCZoneIdentifier = [Ref(subnet.title) for subnet in app_subnets]
name_tag = {'Key': 'Name', 'Value': config['consul_asg']['instance_name'], 'PropagateAtLaunch': True}
consul_asg.Tags = [name_tag]
t.add_resource(consul_asg)
# launch configuration for application
block_device = EBSBlockDevice(config['name'] + 'Ebs')
block_device.DeleteOnTermination = config['app_launch_config']['block_device']['delete_on_termination']
block_device_mapping = BlockDeviceMapping(config['name'] + 'BlockDeviceMapping')
block_device_mapping.DeviceName = '/dev/sda1'
block_device_mapping.Ebs = block_device