Skip to content

Commit d21db43

Browse files
committed
fixup! Fix: Race between layer and Lambda update (#5927)
1 parent 8c61ad0 commit d21db43

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

scripts/delete_stale_function_versions.py renamed to scripts/delete_published_function_versions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
2-
Delete all but the latest published version of every AWS Lambda function in the
3-
current deployment.
2+
Delete the published versions of every AWS Lambda function in the current
3+
deployment, leaving only the unpublished version ($LATEST) of each.
44
"""
55

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

2828

2929
if __name__ == '__main__':

src/azul/lambdas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def reset_lambda_roles(self):
202202
else:
203203
break
204204

205-
def delete_stale_function_versions(self):
205+
def delete_published_function_versions(self):
206206
"""
207207
Delete all but the latest published version of every AWS Lambda function
208208
in the current deployment.

terraform/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ import_resources: rename_resources
4343
plan: import_resources
4444
terraform plan
4545

46-
.PHONY: delete_stale_function_versions
47-
delete_stale_function_versions: import_resources check_python
48-
python $(project_root)/scripts/delete_stale_function_versions.py
46+
.PHONY: delete_published_function_versions
47+
delete_published_function_versions: import_resources check_python
48+
python $(project_root)/scripts/delete_published_function_versions.py
4949

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

5959
.PHONY: auto_apply
60-
auto_apply: delete_stale_function_versions
60+
auto_apply: delete_published_function_versions
6161
ifeq ($(AZUL_PRIVATE_API),1)
6262
# See `apply` above
6363
terraform apply -auto-approve -target aws_vpc_endpoint.indexer -target aws_vpc_endpoint.service

0 commit comments

Comments
 (0)