gpt4 book ai didi

javascript - AWS Javascript 开发工具包 : Greengrass createFunctionDefinition

转载 作者:行者123 更新时间:2023-11-30 19:52:07 33 4
gpt4 key购买 nike

我正在根据这个 https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Greengrass.html#createFunctionDefinition-property 格式化我的参数

但无论出于何种原因,它在“执行”和 DefaultConfig 时都会给我一个关键错误

Response:

Request ID:
"3ed83472-39af-493b-9df7-7f82d2f14636"

Function Logs:
r: Unexpected key \'Execution\' found in params.InitialVersion.Functions[0].FunctionConfiguration.Environment',
code: 'MultipleValidationErrors',
errors:
[ { UnexpectedParameter: Unexpected key 'DefaultConfig' found in params.InitialVersion
at ParamValidator.fail (/var/runtime/node_modules/aws-

代码

GG.createFunctionDefinition({
InitialVersion: {
DefaultConfig: {
Execution: {
IsolationMode: "NoContainer"}
},
Functions: [
{
FunctionArn: "arn:aws:lambda:us-west-2:644226108543:function:SahmCumminsTelemetryTest:1",
FunctionConfiguration: {
MemorySize: 524288,
Pinned: true,
Timeout: 600,
Environment: {
AccessSysfs: false,
Execution: {
IsolationMode: "NoContainer",
RunAs: {
Gid: 0,
Uid: 0
}
}
}
},
Id: "function_definition",
},
],
},
Name: "function_definition",
}, function (err, data) {
if (err) {
console.log(err, err.stack);
}
else {
funcArn = data.LatestVersionArn;

};

最佳答案

我认为问题在于配置数据指定了两个相互排斥的选项。指定了一个内存大小值,它说它应该使用“NoContainer”。当 Greengrass 容器未使用时,内存大小不是有效选项。

尝试删除内存大小,看看是否能解决问题。

当设置 NoContainer 时,我在 Github“scrubs”上共享的配置代码可以解决这个问题。清理过程是将内存大小设置为 NULL,因此当它序列化为 JSON 时,该字段丢失。

https://github.com/awslabs/aws-greengrass-provisioner/blob/e2608654b65682ca9b5b03da962cc8cb29ea1cbf/src/main/java/com/awslabs/aws/greengrass/provisioner/implementations/helpers/BasicGreengrassHelper.java#L390

关于javascript - AWS Javascript 开发工具包 : Greengrass createFunctionDefinition,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54370643/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com