我试图执行以下Ruby代码,并且它常常在params [:environment]"中出现意外值。错误。我尝试了很多不同的方法来将Hash传递给'环境'参数但它会触发相同的错误。
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 :(得分:0)
通过将Ruby AWS SDK从2.6升级到2.9
来解决