Commit 6841313f authored by Andreas Muttscheller's avatar Andreas Muttscheller

Fix serverless schedule settings

parent c4510f44
......@@ -48,10 +48,10 @@ functions:
reservedConcurrency: 1 # Only one instance may run at a time
iamRoleStatementsInherit: true
events:
# Monday to Friday - once at 3am
- schedule:
enabled: ${self:custom.scheduleEnabled.${opt:stage}, self:custom.scheduleEnabled.other}
rate: cron(0 3 ? * MON-FRI *)
# Monday to Friday - once at 3am
- schedule:
enabled: ${self:custom.scheduleEnabled.${self:provider.stage}, self:custom.scheduleEnabled.other}
rate: cron(0 3 ? * MON-FRI *)
ScheduledPlannedTimetableFetchWorker:
handler: de.codecentric.amuttsch.bahndelayinfo.aws.lambda.ScheduledPlannedTimetableFetchWorker::handleRequest
reservedConcurrency: 1 # Only one instance may run at a time
......@@ -63,8 +63,8 @@ functions:
#- schedule: cron(0/2 5-10 ? * MON-FRI *)
#- schedule: cron(0/2 14-19 ? * MON-FRI *)
- schedule:
enabled: ${self:custom.scheduleEnabled.${opt:stage}, self:custom.scheduleEnabled.other}
rate: cron(0/1 5-19 ? * MON-FRI *)
enabled: ${self:custom.scheduleEnabled.${self:provider.stage}, self:custom.scheduleEnabled.other}
rate: cron(0/1 5-19 ? * MON-FRI *)
SlackChangeReporter:
handler: de.codecentric.amuttsch.bahndelayinfo.aws.lambda.SNSChangeSlackReporter::handleRequest
reservedConcurrency: 1 # Only one instance may run at a time
......@@ -75,35 +75,35 @@ functions:
iamRoleStatementsInherit: true
timeout: 30
events:
- schedule:
enabled: ${self:custom.scheduleEnabled.${opt:stage}, self:custom.scheduleEnabled.other}
rate: cron(0/2 6-18 ? * MON-FRI *)
- http:
path: slack/event
method: post
- schedule:
enabled: ${self:custom.scheduleEnabled.${self:provider.stage}, self:custom.scheduleEnabled.other}
rate: cron(0/2 6-18 ? * MON-FRI *)
- http:
path: slack/event
method: post
APISlackBotEventHandlerWorker:
handler: de.codecentric.amuttsch.bahndelayinfo.aws.lambda.APISlackBotEventHandlerWorker::handleRequest
reservedConcurrency: 1 # Only one instance may run at a time
events:
- schedule:
enabled: ${self:custom.scheduleEnabled.${opt:stage}, self:custom.scheduleEnabled.other}
rate: cron(0/2 6-18 ? * MON-FRI *)
- schedule:
enabled: ${self:custom.scheduleEnabled.${self:provider.stage}, self:custom.scheduleEnabled.other}
rate: cron(0/2 6-18 ? * MON-FRI *)
APIStationQuery:
handler: de.codecentric.amuttsch.bahndelayinfo.aws.lambda.APIStationQuery::handleRequest
iamRoleStatementsInherit: true
timeout: 30
events:
- http:
path: stations
method: get
- http:
path: stations
method: get
APIGraphQLHandler:
handler: de.codecentric.amuttsch.bahndelayinfo.aws.lambda.APIGraphQLHandler::handleRequest
iamRoleStatementsInherit: true
timeout: 30
events:
- http:
path: graphql
method: post
- http:
path: graphql
method: post
resources:
Resources:
......@@ -112,31 +112,31 @@ resources:
Properties:
TableName: ${self:service}-${self:provider.stage}-Stations
AttributeDefinitions:
- AttributeName: eva
AttributeType: N
- AttributeName: name
AttributeType: S
- AttributeName: eva
AttributeType: N
- AttributeName: name
AttributeType: S
KeySchema:
- AttributeName: eva
KeyType: HASH
- AttributeName: eva
KeyType: HASH
BillingMode: PAY_PER_REQUEST
GlobalSecondaryIndexes:
- IndexName: NameIndex
KeySchema:
- AttributeName: name
KeyType: HASH
Projection:
ProjectionType: ALL
- IndexName: NameIndex
KeySchema:
- AttributeName: name
KeyType: HASH
Projection:
ProjectionType: ALL
TimeTableStopTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: ${self:service}-${self:provider.stage}-TimetableStops
AttributeDefinitions:
- AttributeName: id
AttributeType: S
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
- AttributeName: id
KeyType: HASH
TimeToLiveSpecification:
AttributeName: ttl
Enabled: true
......@@ -146,11 +146,11 @@ resources:
Properties:
TableName: ${self:service}-${self:provider.stage}-PlannedTimetables
AttributeDefinitions:
- AttributeName: eva
AttributeType: S
- AttributeName: eva
AttributeType: S
KeySchema:
- AttributeName: eva
KeyType: HASH
- AttributeName: eva
KeyType: HASH
TimeToLiveSpecification:
AttributeName: ttl
Enabled: true
......@@ -160,11 +160,11 @@ resources:
Properties:
TableName: ${self:service}-${self:provider.stage}-SlackUsers
AttributeDefinitions:
- AttributeName: id
AttributeType: S
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
- AttributeName: id
KeyType: HASH
TimeToLiveSpecification:
AttributeName: ttl
Enabled: true
......@@ -187,10 +187,10 @@ resources:
AccessPolicies:
Version: "2012-10-17"
Statement:
- Effect: "Allow"
Principal:
AWS: "*"
Action: "es:*"
Resource: "*"
- Effect: "Allow"
Principal:
AWS: "*"
Action: "es:*"
Resource: "*"
AdvancedOptions:
rest.action.multi.allow_explicit_index: "true"
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment