2017-06-15 28 views
0

我试图执行以下Ruby代码,并且它经常以“params [:environment]的意外值”错误失败。我尝试了许多不同的选项来将Hash传递给'environment'参数,但它触发了同样的错误。无法将环境变量传递到Ruby中的Create_Function AWS SDK方法

require 'aws-sdk' 

client = Aws::Lambda::Client.new(region: 'us-east-1') 
args = {} 
args[:role] = "some_role" 
args[:function_name] = "function" 
args[:handler] = "function_handler" 
args[:runtime] = "java8" 

code = {} 
code[:zip_file] = ::File.open("file.jar", "rb").read 

args[:code] = code 

environment = {} 
environment[:variables] = { "AAA": "BBB" } 
args[:environment] = environment 

client.create_function(args) 

回答

0

从2.6到2.9

通过升级Ruby的AWS SDK固定