Skip to content

Commit e291d37

Browse files
dnakovrix0rrr
authored andcommitted
fix(aws-s3-deployment): clean up tempfiles after deployment (#1367)
It can get filled up and errors out with "no disk space left" if the lambda function is warm
1 parent 28a423d commit e291d37

File tree

1 file changed

+2
-0
lines changed
  • packages/@aws-cdk/aws-s3-deployment/lambda/src

1 file changed

+2
-0
lines changed

packages/@aws-cdk/aws-s3-deployment/lambda/src/index.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import json
66
import traceback
77
import logging
8+
import shutil
89
from uuid import uuid4
910

1011
from botocore.vendored import requests
@@ -111,6 +112,7 @@ def s3_deploy(s3_source_zip, s3_dest):
111112

112113
# sync from "contents" to destination
113114
aws_command("s3", "sync", "--delete", contents_dir, s3_dest)
115+
shutil.rmtree(workdir)
114116

115117
#---------------------------------------------------------------------------------------------------
116118
# executes an "aws" cli command

0 commit comments

Comments
 (0)