diff --git a/app/terraform/proxy/fastly.py b/app/terraform/proxy/fastly.py index f00e506..0261416 100644 --- a/app/terraform/proxy/fastly.py +++ b/app/terraform/proxy/fastly.py @@ -11,7 +11,6 @@ class ProxyFastlyAutomation(ProxyAutomation): short_name = "proxy_fastly" description = "Deploy proxies to Fastly" provider = "fastly" - subgroup_max = min(current_app.config.get("FASTLY_MAX_BACKENDS", 5), 20) template_parameters = [ "aws_access_key", @@ -114,6 +113,11 @@ class ProxyFastlyAutomation(ProxyAutomation): {% endfor %}{# group #} """ + def __init__(self): + # Requires Flask application context to read configuration + self.subgroup_max = min(current_app.config.get("FASTLY_MAX_BACKENDS", 5), 20) + super().__init__() + def import_state(self, state: Optional[Any]) -> None: proxies = Proxy.query.filter( Proxy.provider == self.provider,