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 Sep 10, 2024
1 parent fc5ea33 commit 2567ecb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Delete all but the latest published version of every AWS Lambda function in the
current deployment.
Delete the published versions of every AWS Lambda function in the current
deployment, leaving only the unpublished version ($LATEST) of each.
"""

import logging
Expand All @@ -23,7 +23,7 @@ def main():
require(config.terraform_component == '',
'This script cannot be run with a Terraform component selected',
config.terraform_component)
Lambdas().delete_stale_function_versions()
Lambdas().delete_published_function_versions()


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion src/azul/lambdas.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def reset_lambda_roles(self):
else:
break

def delete_stale_function_versions(self):
def delete_published_function_versions(self):
"""
Delete all but the latest published version of every AWS Lambda function
in the current deployment.
Expand Down
10 changes: 5 additions & 5 deletions terraform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ import_resources: rename_resources
plan: import_resources
terraform plan

.PHONY: delete_stale_function_versions
delete_stale_function_versions: import_resources check_python
python $(project_root)/scripts/delete_stale_function_versions.py
.PHONY: delete_published_function_versions
delete_published_function_versions: import_resources check_python
python $(project_root)/scripts/delete_published_function_versions.py

.PHONY: apply
apply: delete_stale_function_versions
apply: delete_published_function_versions
ifeq ($(AZUL_PRIVATE_API),1)
# For private API we need the VPC endpoints to be created first so that the
# aws_lb_target_group_attachment can iterate over the network_interface_ids.
Expand All @@ -57,7 +57,7 @@ endif
terraform apply

.PHONY: auto_apply
auto_apply: delete_stale_function_versions
auto_apply: delete_published_function_versions
ifeq ($(AZUL_PRIVATE_API),1)
# See `apply` above
terraform apply -auto-approve -target aws_vpc_endpoint.indexer -target aws_vpc_endpoint.service
Expand Down

0 comments on commit 2567ecb

Please sign in to comment.