Open binoculars opened 8 years ago
:+1: We'll tackle this after Re:invent. They will be announcing some Lambda versioning updates that we want to support that might also not be supported by CF.
This seems to have been added recently: AWS::Lambda::EventSourceMapping
Though it only supports Kinesis and DynamoDB :-1:
@dekz Thanks for sharing that! Hopefully soon on S3 and SNS. Kind of odd since S3 Events were the initial use case for Lambda.
I think we're going to have to continue to fake it till they make it.
"lambda": {
"enVars": [],
"package": {},
"excludePatterns": {},
"cloudFormation": {
"Description": "",
"MemorySize": 1024,
"Runtime": "nodejs",
"Timeout": 6
}
},
"apiGateway": {
"cloudFormation": {}
+},
+"eventSource": [
+ "apiGateway1": {
+ "type": "apiGateway",
+ "properties": {}
+ // Must use cli
+ },
+ "kinesisAbcd": {
+ "type": "kinesis",
+ "properties": {
+ "arn": "abcd:dev:stage:123"
+ }
+ // Can use AWS::Lambda::EventSourceMapping
+ },
+]
+}
Right now each lambda has a shared role, do we need to think about fine grain control on IAM roles for each lambda? So Lambda1 has restricted access to Kinesis, Lambda2 can read.
@dekz I would think we'd want to support both shared roles and 1:1 roles.
It appears that the Event Source can now be configured from the S3 side with Amazon Simple Storage Service NotificationConfiguration LambdaConfigurations. Likewise, in SNS, the Amazon SNS Subscription Property Type takes
{
"Endpoint" : "arn:aws:lambda:region:account-id:function:function-name",
"Protocol" : "lambda"
}
Still need to come up with a canonical way to specify it in AWS Modules.
Some Lambda functions are useful while only being triggered from S3 events, DynamoDB streams, SNS, etc. Having tooling around these would be extremely valuable.
Since there are (Edit:
nolimited) CloudFormation options for hooking up events to Lambda functions, we'll have to build that in.