mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 23:41:17 -05:00
Define failover lambdas
We will need a lambda to failover to if the first lambda fails. This isn't so much a case of the lambda itself failing, as it is a cross availability zone resource automatically, it's more in case something in the networking goes down in our AZ and therefore the lambda can't call out to the CBC. In this case, we will be able to swap to using the second AZ by calling the second lambda.
This commit is contained in:
committed by
Pea Tyczynska
parent
1e537d507b
commit
9da8e54d69
@@ -56,6 +56,11 @@ class CBCProxyClientBase(ABC):
|
||||
def lambda_name(self):
|
||||
pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def failover_lambda_name(self):
|
||||
pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def LANGUAGE_ENGLISH(self):
|
||||
@@ -136,6 +141,9 @@ class CBCProxyCanary(CBCProxyClientBase):
|
||||
canary, a specific lambda that does not open a vpn or connect to a provider but just responds from within AWS.
|
||||
"""
|
||||
lambda_name = 'canary'
|
||||
# we don't need a failover lambda for the canary as it doesn't actually make calls out to a CBC
|
||||
# so we just reuse the normal one in case of a failover scenario
|
||||
failover_lambda_name = 'canary'
|
||||
|
||||
LANGUAGE_ENGLISH = None
|
||||
LANGUAGE_WELSH = None
|
||||
@@ -149,6 +157,7 @@ class CBCProxyCanary(CBCProxyClientBase):
|
||||
|
||||
class CBCProxyEE(CBCProxyClientBase):
|
||||
lambda_name = 'bt-ee-1-proxy'
|
||||
failover_lambda_name = 'bt-ee-2-proxy'
|
||||
|
||||
LANGUAGE_ENGLISH = 'en-GB'
|
||||
LANGUAGE_WELSH = 'cy-GB'
|
||||
@@ -208,6 +217,7 @@ class CBCProxyEE(CBCProxyClientBase):
|
||||
|
||||
class CBCProxyVodafone(CBCProxyClientBase):
|
||||
lambda_name = 'vodafone-1-proxy'
|
||||
failover_lambda_name = 'vodafone-2-proxy'
|
||||
|
||||
LANGUAGE_ENGLISH = 'English'
|
||||
LANGUAGE_WELSH = 'Welsh'
|
||||
|
||||
Reference in New Issue
Block a user