mirror of
https://github.com/fog/fog-aws.git
synced 2022-11-09 13:50:52 -05:00
[AWS|Autoscaling] Support classic link related properties for launch configurations
This commit is contained in:
parent
da2a4adc30
commit
bb4eb92226
3 changed files with 15 additions and 4 deletions
|
@ -22,7 +22,8 @@ module Fog
|
|||
attribute :user_data, :aliases => 'UserData'
|
||||
attribute :spot_price, :aliases => 'SpotPrice'
|
||||
attribute :placement_tenancy, :aliases => 'PlacementTenancy'
|
||||
|
||||
attribute :classic_link_vpc_id, :aliases => 'ClassicLinkVPCId'
|
||||
attribute :classic_link_security_groups, :aliases => 'ClassicLinkVPCSecurityGroups'
|
||||
|
||||
def initialize(attributes={})
|
||||
#attributes[:availability_zones] ||= %w(us-east-1a us-east-1b us-east-1c us-east-1d)
|
||||
|
|
|
@ -12,7 +12,7 @@ module Fog
|
|||
end
|
||||
|
||||
def reset_launch_configuration
|
||||
@launch_configuration = { 'BlockDeviceMappings' => [], 'InstanceMonitoring' => {}, 'SecurityGroups' => [] }
|
||||
@launch_configuration = { 'BlockDeviceMappings' => [], 'InstanceMonitoring' => {}, 'SecurityGroups' => [], 'ClassicLinkVPCSecurityGroups' => []}
|
||||
end
|
||||
|
||||
def reset_block_device_mapping
|
||||
|
@ -30,6 +30,8 @@ module Fog
|
|||
@in_block_device_mappings = true
|
||||
when 'SecurityGroups'
|
||||
@in_security_groups = true
|
||||
when 'ClassicLinkVPCSecurityGroups'
|
||||
@in_classic_link_security_groups = true
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -41,6 +43,8 @@ module Fog
|
|||
reset_block_device_mapping
|
||||
elsif @in_security_groups
|
||||
@launch_configuration['SecurityGroups'] << value
|
||||
elsif @in_classic_link_security_groups
|
||||
@launch_configuration['ClassicLinkVPCSecurityGroups'] << value
|
||||
else
|
||||
@results['LaunchConfigurations'] << @launch_configuration
|
||||
reset_launch_configuration
|
||||
|
@ -62,7 +66,7 @@ module Fog
|
|||
@launch_configuration[name] = Time.parse(value)
|
||||
when 'ImageId', 'InstanceType', 'KeyName'
|
||||
@launch_configuration[name] = value
|
||||
when 'LaunchConfigurationARN', 'LaunchConfigurationName'
|
||||
when 'LaunchConfigurationARN', 'LaunchConfigurationName', 'ClassicLinkVPCId'
|
||||
@launch_configuration[name] = value
|
||||
when 'KernelId', 'RamdiskId', 'UserData'
|
||||
@launch_configuration[name] = value
|
||||
|
@ -79,7 +83,8 @@ module Fog
|
|||
@in_launch_configurations = false
|
||||
when 'SecurityGroups'
|
||||
@in_security_groups = false
|
||||
|
||||
when 'ClassicLinkVPCSecurityGroups'
|
||||
@in_classic_link_security_groups = false
|
||||
when 'NextToken'
|
||||
@results[name] = value
|
||||
|
||||
|
|
|
@ -64,6 +64,11 @@ module Fog
|
|||
if security_groups = options.delete('SecurityGroups')
|
||||
options.merge!(AWS.indexed_param('SecurityGroups.member.%d', [*security_groups]))
|
||||
end
|
||||
|
||||
if classic_link_groups = options.delete('ClassicLinkVPCSecurityGroups')
|
||||
options.merge!(AWS.indexed_param('ClassicLinkVPCSecurityGroups.member.%d', [*classic_link_groups]))
|
||||
end
|
||||
|
||||
if options['UserData']
|
||||
options['UserData'] = Base64.encode64(options['UserData'])
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue