使用Lambda函數運行Node.js加載6.10
我想包括客戶端提供的令牌(串)作爲ClientRequestToken在調用創建堆棧。
如果我有ClientRequestToken在傳遞到創建堆棧功能參數,可以我得到下面的錯誤:CloudFormation AWS-SDK節點創建堆棧錯誤UnexpectedParameter:意外鍵「ClientRequestToken」
2017-06-02T02:08:23.864Z 5a26eb46-4738-11e7-8020-730416363290 { UnexpectedParameter: Unexpected key 'ClientRequestToken' found in params
at ParamValidator.fail (/var/runtime/node_modules/aws-sdk/lib/param_validator.js:50:37)
at ParamValidator.validateStructure (/var/runtime/node_modules/aws-sdk/lib/param_validator.js:77:14)
at ParamValidator.validateMember (/var/runtime/node_modules/aws-sdk/lib/param_validator.js:88:21)
at ParamValidator.validate (/var/runtime/node_modules/aws-sdk/lib/param_validator.js:34:10)
at Request.VALIDATE_PARAMETERS (/var/runtime/node_modules/aws-sdk/lib/event_listeners.js:108:42)
at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
at callNextListener (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:95:12)
at /var/runtime/node_modules/aws-sdk/lib/event_listeners.js:74:9
at finish (/var/runtime/node_modules/aws-sdk/lib/config.js:313:7)
at /var/runtime/node_modules/aws-sdk/lib/config.js:331:9
message: 'Unexpected key \'ClientRequestToken\' found in params',
code: 'UnexpectedParameter',
time: 2017-06-02T02:08:23.864Z } 'UnexpectedParameter: Unexpected key \'ClientRequestToken\' found in params
at ParamValidator.fail (/var/runtime/node_modules/aws-sdk/lib/param_validator.js:50:37)
這裏是我正在創建params對象:
var params = {
StackName: stack_name,
ClientRequestToken : clientRequestToken,
Capabilities: [
'CAPABILITY_IAM'
],
NotificationARNs: [
'arn:aws:sns:ap-southeast-2:account-id:topic-name'
],
Parameters: parameters,
Tags: [
{
Key: 'Name',
Value: 'kktest'
},
],
TemplateURL: templateUrl
};
我無法理解這個錯誤。該ClientRequestToken爲創建堆棧方法的文檔中明確規定:http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudFormation.html#createStack-property
創建堆棧調用成功,如果我只是註釋掉ClientRequestToken在params對象。所以我的其他代碼似乎沒問題。
我已經發布這個到AWS論壇,但沒有回覆,但:https://forums.aws.amazon.com/thread.jspa?threadID=257033
可有人請與解決這方面的幫助?