Skip to content

Commit

Permalink
handle 50 lambda limit
Browse files Browse the repository at this point in the history
  • Loading branch information
ircwaves committed Jul 8, 2023
1 parent 520fa14 commit 3657a23
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/cirrus/plugins/management/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,19 @@ def get_env_from_lambda(stackname: str, session):
def get_lambda_functions(self):
if self._functions is None:
aws_lambda = self.get_session().client("lambda")
self._functions = [
f["FunctionName"].replace(f"{self.stackname}-", "")
for f in aws_lambda.list_functions()["Functions"]
if f["FunctionName"].startswith(self.stackname)
]

def deployment_functions_filter(response):
return [
f["FunctionName"].replace(f"{self.stackname}-", "")
for f in response["Functions"]
if f["FunctionName"].startswith(self.stackname)
]

resp = aws_lambda.list_functions()
self._functions = deployment_functions_filter(resp)
while "NextMarker" in resp:
resp = aws_lambda.list_functions(Marker=resp["NextMarker"])
self._functions += deployment_functions_filter(resp)
return self._functions

def get_session(self):
Expand Down

0 comments on commit 3657a23

Please sign in to comment.