Skip to content

Commit 3a757d5

Browse files
committed
Function template
1 parent 9662172 commit 3a757d5

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

sample-apps/nodejs-apig/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# API Gateway proxy integration with Node.js
22

3-
The sample application is a Lambda function that processes events from an API Gateway REST API. The API provides a public endpoint that you can access with a web browser or other HTTP client. When you send a request to the endpoint, the API serializes the request and sends it to the function. The function calls the Lambda API to get utilization data and returns it to the API in the required format.
3+
This sample application is a Lambda function that processes events from an API Gateway REST API. The API provides a public endpoint that you can access with a web browser or other HTTP client. When you send a request to the endpoint, the API serializes the request and sends it to the function. The function calls the Lambda API to get utilization data and returns it to the API in the required format.
44

55
:warning: The application creates a public API endpoint that is accessible over the internet. When you're done testing, run the cleanup script to delete it.
66

templates/function-inline.yml

+16
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,22 @@ Resources:
3333
Timeout: 10
3434
TracingConfig:
3535
Mode: Active
36+
scheduledEvent:
37+
Type: AWS::Events::Rule
38+
Properties:
39+
Description: Scheduled event
40+
ScheduleExpression: rate(2 minutes)
41+
State: ENABLED
42+
Targets:
43+
- Arn: !GetAtt function.Arn
44+
Id: Function
45+
invokePermission:
46+
Type: AWS::Lambda::Permission
47+
Properties:
48+
FunctionName: !Ref function
49+
Action: lambda:InvokeFunction
50+
Principal: events.amazonaws.com
51+
SourceArn: !GetAtt scheduledEvent.Arn
3652
executionRole:
3753
Type: AWS::IAM::Role
3854
Properties:

0 commit comments

Comments
 (0)