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:
David McDonald
2021-01-11 13:46:47 +00:00
committed by Pea Tyczynska
parent 1e537d507b
commit 9da8e54d69

View File

@@ -56,6 +56,11 @@ class CBCProxyClientBase(ABC):
def lambda_name(self): def lambda_name(self):
pass pass
@property
@abstractmethod
def failover_lambda_name(self):
pass
@property @property
@abstractmethod @abstractmethod
def LANGUAGE_ENGLISH(self): 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. canary, a specific lambda that does not open a vpn or connect to a provider but just responds from within AWS.
""" """
lambda_name = 'canary' 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_ENGLISH = None
LANGUAGE_WELSH = None LANGUAGE_WELSH = None
@@ -149,6 +157,7 @@ class CBCProxyCanary(CBCProxyClientBase):
class CBCProxyEE(CBCProxyClientBase): class CBCProxyEE(CBCProxyClientBase):
lambda_name = 'bt-ee-1-proxy' lambda_name = 'bt-ee-1-proxy'
failover_lambda_name = 'bt-ee-2-proxy'
LANGUAGE_ENGLISH = 'en-GB' LANGUAGE_ENGLISH = 'en-GB'
LANGUAGE_WELSH = 'cy-GB' LANGUAGE_WELSH = 'cy-GB'
@@ -208,6 +217,7 @@ class CBCProxyEE(CBCProxyClientBase):
class CBCProxyVodafone(CBCProxyClientBase): class CBCProxyVodafone(CBCProxyClientBase):
lambda_name = 'vodafone-1-proxy' lambda_name = 'vodafone-1-proxy'
failover_lambda_name = 'vodafone-2-proxy'
LANGUAGE_ENGLISH = 'English' LANGUAGE_ENGLISH = 'English'
LANGUAGE_WELSH = 'Welsh' LANGUAGE_WELSH = 'Welsh'