Skip to content

Commit

Permalink
fix(aws-s3-deployment): clean up tempfiles after deployment (#1367)
Browse files Browse the repository at this point in the history
It can get filled up and errors out with "no disk space left" if the lambda function is warm
  • Loading branch information
dnakov authored and rix0rrr committed Jan 15, 2019
1 parent 28a423d commit e291d37
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-s3-deployment/lambda/src/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import json
import traceback
import logging
import shutil
from uuid import uuid4

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

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

#---------------------------------------------------------------------------------------------------
# executes an "aws" cli command
Expand Down

0 comments on commit e291d37

Please sign in to comment.