diff --git a/cloud_functions/notifier_tdem.py b/cloud_functions/notifier_tdem_handler.py similarity index 87% rename from cloud_functions/notifier_tdem.py rename to cloud_functions/notifier_tdem_handler.py index 92fb2ea..984b882 100644 --- a/cloud_functions/notifier_tdem.py +++ b/cloud_functions/notifier_tdem_handler.py @@ -1,3 +1,4 @@ +import os from lib.Notifier import Notifier from lib.Fetcher import Fetcher @@ -5,7 +6,8 @@ def main(event, context): # print("event:", event) # print("context:", context) source = 'tdem' - env = 'stage' + + env = os.environ.get('DEPLOY_STAGE') if env != 'dev': Fetcher(source) notifier = Notifier(source, env) diff --git a/cloud_functions/serverless.yml b/cloud_functions/serverless.yml index 59cfdd3..25f6872 100644 --- a/cloud_functions/serverless.yml +++ b/cloud_functions/serverless.yml @@ -1,4 +1,4 @@ -service: vaccinate-texas +service: go-get-it-health frameworkVersion: '2' provider: @@ -6,6 +6,10 @@ provider: runtime: python3.7 profile: default lambdaHashingVersion: 20201221 + environment: + DEPLOY_STAGE: ${opt:stage,'dev'} + apiGateway: + shouldStartNameWithService: true iamRoleStatements: - Effect: "Allow" Action: @@ -15,24 +19,17 @@ provider: Action: - secretsmanager:* Resource: '*' - + functions: notifier_tdem: - handler: notifier_tdem.main + handler: notifier_tdem_handler.main timeout: 600 layers: - arn:aws:lambda:us-east-1:359698300326:layer:vtx-sls-layer:1 events: - schedule: rate: rate(10 minutes) - # notifier_heb: - # handler: notifier_heb.main - # layers: - # - arn:aws:lambda:us-east-1:359698300326:layer:vtx-sls-layer:1 - # events: - # - schedule: - # rate: rate(10 minutes) - sms_inbound_handler: + sms_inbound: handler: sms_inbound_handler.main events: - http: