访问参数我有一个CloudFormation
模板,看起来像这样:CloudFormation - 从LAMBDA代码
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "This template will deploy stuff",
"Parameters":{
"myParamToLambdaFunction" : {
"Description" : "Please enter the the value",
"Type" : "String",
"ConstraintDescription" : "must have some value."
}
},
"Resources": {
"SecGrpValidatorFromCFTemplate": {
"Type": "AWS::Lambda::Function",
"Properties": {
"FunctionName": "mylambdafunctionname",
"Handler": "myfile.lambda_handler",
"Role": {
"Fn::GetAtt": ["somerole", "Arn"]
},
"Timeout": "30",
"Runtime": "python2.7",
"Code": {
"S3Bucket":"mybucket",
"S3Key":"mylambdafunction.zip"
}
}
}
}
我需要的myParamToLambdaFunction
值传递给lambda函数。
有没有办法做到这一点?
不是我真正想要的。我需要将CloudFormation的输入参数的值注入到Lambda中的一个变量中。我已将这个问题发布到AWS论坛以及更多详细信息:[链接到AWS论坛上的问题](https://forums.aws.amazon.com/thread.jspa?threadID=236582&tstart=0) – Asdfg
您可以在node.js中执行它,因为你可以在CF中直接提供lambda代码,但是在python中我不认为有办法做到这一点。 –