<p>我有<code>AWS::Serverless::Function</code>,在its属性中有<em>Events</em>属性。如果有,那么您的配置如下:</p>
<pre><code>LambdaFunctionEC2KeyPair:
Type: AWS::Lambda::Function
Properties:
FunctionName: LambdaFunctionEC2KeyPair
Description: "Lambda Function to create EC2 KeyPair and storing it's private key securely to paramater store"
Handler: index.handler
Runtime: python3.6
Role: !GetAtt LambdaBasicExecutionRole.Arn
Code:
ZipFile: |
My code
Environment:
Variables:
env: !Ref Environment
kmsid: !Ref kmsKeyIIS
Events:
SNSTopicMessage:
Type: SNS
Properties:
Topic:
Fn::Join:
- ':'
- - arn
- Ref: AWS::Partition
- sns
- Ref: AWS::Region
- Ref: AWS::AccountId
- SNSTopicLambdaInvoke
DependsOn: LambdaBasicExecutionRole
</code></pre>
<p>我正在检查您的用例是否有<code>AWS::Lambda::Function</code>。你知道吗</p>
<p>您可以检查<a href="https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#sns" rel="nofollow noreferrer">this example</a>。你知道吗</p>
<p>关于无服务器函数和Lambda函数之间的区别
你可以签入这个答案:<a href="https://stackoverflow.com/questions/49953270/what-is-the-difference-between-a-serverless-function-and-a-lambda-function">What is the difference between a Serverless Function, and a Lambda Function</a></p>