def create_launch_configuration(image_id, instance_type, launch_configuration_name, options = {})
if self.data[:launch_configurations].has_key?(launch_configuration_name)
raise Fog::AWS::AutoScaling::IdentifierTaken.new("Launch Configuration by this name already exists - A launch configuration already exists with the name #{launch_configuration_name}")
end
self.data[:launch_configurations][launch_configuration_name] = {
'BlockDeviceMappings' => [],
'CreatedTime' => Time.now.utc,
'ImageId' => image_id,
'InstanceMonitoring' => {'Enabled' => true},
'InstanceType' => instance_type,
'KernelId' => nil,
'KeyName' => nil,
'LaunchConfigurationARN' => Fog::AWS::Mock.arn('autoscaling', self.data[:owner_id], "launchConfiguration:00000000-0000-0000-0000-000000000000:launchConfigurationName/#{launch_configuration_name}", @region),
'LaunchConfigurationName' => launch_configuration_name,
'RamdiskId' => nil,
'SecurityGroups' => [],
'UserData' => nil
}.merge!(options)
response = Excon::Response.new
response.status = 200
response.body = {
'ResponseMetadata' => { 'RequestId' => Fog::AWS::Mock.request_id }
}
response
end