Reputation: 145
I am using SAM to create few AWS resources like Lambda. I am using amplify to create S3. I need to create a eventbridge rule to trigger lambda whenever a file is uploaded to S3. But I have 2 issues:
MyLambda:
Type: AWS::Serverless::Function
Properties:
FunctionName: 'MyLambda123'
CodeUri: code/
Handler: lambda_function.lambda_handler
Runtime: python3.7
Policies:
- Statement:
- Sid: SSMDescribeParametersPolicy
Effect: Allow
Action:
- ssm:DescribeParameters
Resource: '*'
Events:
Trigger:
Type: EventBridgeRule
Properties:
Pattern:
source:
- "aws.s3"
detail:
bucket:
name: 'someexistingbucket'
MyLambda:
Type: AWS::Serverless::Function
Properties:
FunctionName: 'MyLambda123'
CodeUri: code/
Handler: lambda_function.lambda_handler
Runtime: python3.7
Policies:
- Statement:
- Sid: SSMDescribeParametersPolicy
Effect: Allow
Action:
- ssm:DescribeParameters
Resource: '*'
Events:
Trigger:
Type: EventBridgeRule
##Somehow I need to know how to use existing eventbridge rule (which I created manually)##
Upvotes: 2
Views: 498