Skip to content

Commit

Permalink
fixup! Fix: Race between layer and Lambda update (#5927)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsotirho-ucsc committed Aug 15, 2024
1 parent 4ab5549 commit 642068b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions scripts/delete_lambda_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

def main():
require(config.terraform_component == '',
'Cannot be run with a terraform component',
'This script cannot be run with a Terraform component selected',
config.terraform_component)
Lambdas().delete_lambda_versions()
Lambdas().delete_stale_function_versions()


if __name__ == '__main__':
Expand Down
6 changes: 3 additions & 3 deletions src/azul/lambdas.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,16 @@ def reset_lambda_roles(self):
else:
break

def delete_lambda_versions(self):
def delete_stale_function_versions(self):
"""
Delete all but the latest published version of every AWS Lambda function
in the current deployment.
"""
log.info('Deleting old published versions of AWS Lambda functions')
log.info('Deleting stale versions of AWS Lambda functions')
for function in self.list_deployment_lambdas():
if function.version == '$LATEST':
log.info('Skipping latest version %r', function.name)
else:
log.info('Deleting published version %r of %r', function.version, function.name)
log.info('Deleting version %r of %r', function.version, function.name)
self._lambda.delete_function(FunctionName=function.name,
Qualifier=function.version)

0 comments on commit 642068b

Please sign in to comment.