我在CloudFormation中得到了lambda支持的自定义堆栈,所以我需要获取fetch函数并将其放到AWS控制台,我该如何处理这个问题?
我的堆栈如下所示;
” …
您需要使用您正在使用的变量来返回您的响应。例如(的NodeJS)
module.exports.createPoolList = (event, context, callback) => { if (event.RequestType == 'Create') { let array = event.ResourceProperties.OpsPoolArnList.split(","); array.push(event.ResourceProperties.UserPool); let response = { 'list': array.join(), }; sendresponse(event, "SUCCESS", response, ""); } if (event.RequestType == 'Delete') { sendresponse(event, "SUCCESS", null, ""); } callback(null, ""); };
这里 list 是包含我的输出和变量的变量回到我的身边 response 。构建的有效负载看起来像
list
response
let payload = { 'StackId': event.StackId, 'Status' : responsestatus, 'Reason' : reason, 'RequestId': event.RequestId, 'LogicalResourceId': event.LogicalResourceId, 'PhysicalResourceId': event.LogicalResourceId + 'qwerty', 'Data': response };
我在我的剧本中称之为
!GetAtt <ResourceName>.list
希望能帮助到你。