-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
124 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
# generated items | ||
packaged-template.yaml | ||
sam-template.yaml | ||
coverage | ||
yarn-error.log | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Transform: 'AWS::Serverless-2016-10-31' | ||
Description: 'An AWS CloudFormation template for running scheduled tasks.' | ||
Resources: | ||
ingestTopic: | ||
Type: 'AWS::SNS::Topic' | ||
Properties: {} | ||
tasksTable: | ||
Type: 'AWS::DynamoDB::Table' | ||
Properties: | ||
KeySchema: | ||
- AttributeName: taskId | ||
KeyType: HASH | ||
AttributeDefinitions: | ||
- AttributeName: taskId | ||
AttributeType: S | ||
ProvisionedThroughput: | ||
ReadCapacityUnits: | ||
Ref: ReadCapacityUnits | ||
WriteCapacityUnits: | ||
Ref: WriteCapacityUnits | ||
IngestFunction: | ||
Type: 'AWS::Serverless::Function' | ||
Properties: | ||
Handler: src/ingest.handler | ||
Runtime: nodejs10.x | ||
CodeUri: src | ||
MemorySize: 128 | ||
Timeout: 3 | ||
Policies: | ||
- Version: '2012-10-17' | ||
Statement: | ||
- Effect: Allow | ||
Action: | ||
- 'sns:Publish' | ||
Resource: | ||
Ref: DestinationArns | ||
- Effect: Allow | ||
Action: | ||
- 'dynamodb:UpdateItem' | ||
- 'dynamodb:Scan' | ||
- 'dynamodb:DeleteItem' | ||
Resource: | ||
'Fn::GetAtt': | ||
- tasksTable | ||
- Arn | ||
Environment: | ||
Variables: | ||
TASKS_TABLE: | ||
Ref: tasksTable | ||
Events: | ||
Event1: | ||
Type: SNS | ||
Properties: | ||
Topic: | ||
Ref: ingestTopic | ||
ScheduleFunction: | ||
Type: 'AWS::Serverless::Function' | ||
Properties: | ||
Handler: src/schedule.handler | ||
Runtime: nodejs10.x | ||
CodeUri: src | ||
MemorySize: 128 | ||
Timeout: 60 | ||
Policies: | ||
- Version: '2012-10-17' | ||
Statement: | ||
- Effect: Allow | ||
Action: | ||
- 'sns:Publish' | ||
Resource: | ||
Ref: DestinationArns | ||
- Effect: Allow | ||
Action: | ||
- 'dynamodb:UpdateItem' | ||
- 'dynamodb:Scan' | ||
- 'dynamodb:DeleteItem' | ||
Resource: | ||
'Fn::GetAtt': | ||
- tasksTable | ||
- Arn | ||
Environment: | ||
Variables: | ||
TASKS_TABLE: | ||
Ref: tasksTable | ||
Events: | ||
Event1: | ||
Type: Schedule | ||
Properties: | ||
Schedule: | ||
Ref: PollingSchedule | ||
Outputs: | ||
IngestSNSTopicArn: | ||
Description: The ARN of the Ingest SNS topic | ||
Value: | ||
Ref: ingestTopic | ||
Parameters: | ||
PollingSchedule: | ||
Default: rate(5 minutes) | ||
Type: String | ||
Description: >- | ||
The CloudWatch ScheduleExpression defining the interval the polling Lambda | ||
runs at. | ||
ReadCapacityUnits: | ||
Default: 1 | ||
Type: Number | ||
Description: The read capacity units for the Scheduled Tasks DynamoDB table. | ||
WriteCapacityUnits: | ||
Default: 1 | ||
Type: Number | ||
Description: The write capacity units for the Scheduled Tasks DynamoDB table. | ||
DestinationArns: | ||
Default: '' | ||
Type: CommaDelimitedList | ||
Description: >- | ||
A comma-separated list of possible destination SNS topic ARNs for | ||
permissioning the polling Lambda. |
This file was deleted.
Oops, something went wrong.