Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
b428871
Merge pull request #809 from awslabs/develop
sanathkr Nov 29, 2018
b493394
Merge pull request #815 from awslabs/develop
jfuss Nov 30, 2018
7e08351
Merge pull request #856 from awslabs/develop
jfuss Dec 12, 2018
afce048
Merge pull request #882 from awslabs/develop
sriram-mv Dec 21, 2018
b23d425
Merge pull request #980 from awslabs/develop
jfuss Feb 5, 2019
7ddb5e4
Merge pull request #1031 from awslabs/develop
sanathkr Mar 1, 2019
d88100f
Merge pull request #1051 from awslabs/develop
jfuss Mar 11, 2019
c861d49
Merge pull request #1077 from awslabs/develop
sriram-mv Mar 25, 2019
f01b6d5
Merge pull request #1083 from awslabs/develop
sriram-mv Mar 26, 2019
21be617
Merge pull request #1089 from awslabs/develop
sriram-mv Mar 27, 2019
0c421c1
Merge pull request #1132 from awslabs/develop
sriram-mv Apr 16, 2019
f834f5c
Merge pull request #1168 from awslabs/develop
sriram-mv May 13, 2019
a681eb4
Merge pull request #1184 from awslabs/develop
jfuss May 20, 2019
dc81449
Merge pull request #1208 from awslabs/develop
awood45 Jun 4, 2019
dad3ab8
Merge pull request #1258 from awslabs/develop
sriram-mv Jul 10, 2019
bdc7abf
Merge pull request #1290 from awslabs/develop
sriram-mv Jul 31, 2019
d7d2822
Merge pull request #1342 from awslabs/develop
sanathkr Aug 20, 2019
2090431
Revert "release: 0.20.0"
sanathkr Aug 21, 2019
06b3ef9
Merge pull request #1351 from awslabs/revert-1342-develop
sanathkr Aug 21, 2019
e218d29
chore: Update version to 0.20.1
sanathkr Aug 21, 2019
6df4970
Merge pull request #1352 from sanathkr/rollback/v0.20.1
sanathkr Aug 21, 2019
18908c1
Revert "Revert "release: 0.20.0"" (#1377)
sriram-mv Aug 27, 2019
0943b37
Merge pull request #1374 from awslabs/develop
sriram-mv Aug 27, 2019
1802ed8
Merge pull request #1413 from awslabs/develop
sanathkr Sep 17, 2019
5caeb32
Merge pull request #1475 from awslabs/develop
jfuss Oct 23, 2019
380183e
Merge pull request #1493 from awslabs/develop
awood45 Oct 30, 2019
f183dbb
Merge pull request #1511 from awslabs/develop
sanathkr Nov 6, 2019
11b80b6
Merge pull request #1520 from awslabs/develop
jfuss Nov 14, 2019
647ef14
Merge pull request #1570 from awslabs/develop
jfuss Nov 21, 2019
dc6f42f
Merge pull request #1583 from awslabs/develop
jfuss Nov 25, 2019
c8642d2
Merge pull request #1594 from awslabs/develop
jfuss Nov 25, 2019
39f1915
Merge pull request #1598 from awslabs/develop
c2tarun Nov 26, 2019
69daba3
Merge pull request #1626 from awslabs/develop
jfuss Dec 2, 2019
71e5959
Merge pull request #1633 from awslabs/develop
sanathkr Dec 3, 2019
a047015
Merge pull request #1637 from awslabs/develop
sriram-mv Dec 4, 2019
dbf1a96
Merge pull request #1669 from awslabs/develop
jfuss Dec 17, 2019
80eb2b3
Merge pull request #1692 from awslabs/develop
awood45 Dec 23, 2019
1202adc
Merge pull request #1714 from awslabs/develop
sanathkr Jan 8, 2020
cdb9400
Merge pull request #1772 from awslabs/develop
awood45 Feb 5, 2020
cd4de76
Merge pull request #1803 from awslabs/develop
jfuss Feb 20, 2020
e78cc63
Merge pull request #1809 from awslabs/develop
sriram-mv Feb 21, 2020
858fa6b
Merge pull request #1852 from awslabs/develop
awood45 Mar 6, 2020
38b19fb
Merge pull request #1870 from awslabs/develop
jfuss Mar 17, 2020
1926da2
Merge from awslabs/aws-sam-cli/develop
aws-sam-cli-bot Mar 23, 2020
b87c6aa
Merge from awslabs/aws-sam-cli/develop
aws-sam-cli-bot Mar 24, 2020
032b933
Merge from awslabs/aws-sam-cli/develop
aws-sam-cli-bot Mar 25, 2020
ffdf899
Merge from awslabs/aws-sam-cli/develop
aws-sam-cli-bot Mar 31, 2020
8ceaf87
Merge from awslabs/aws-sam-cli/develop
aws-sam-cli-bot Apr 29, 2020
2f46818
Merge from awslabs/aws-sam-cli/develop
aws-sam-cli-bot May 14, 2020
1d73bca
Merge from awslabs/aws-sam-cli/develop
aws-sam-cli-bot May 19, 2020
66b5c95
Merge from awslabs/aws-sam-cli/develop
aws-sam-cli-bot May 21, 2020
d52cf74
Merge from awslabs/aws-sam-cli/develop
aws-sam-cli-bot May 27, 2020
380d646
Merge from awslabs/aws-sam-cli/develop
aws-sam-cli-bot Jun 16, 2020
aa21a2d
Merge from awslabs/aws-sam-cli/develop
aws-sam-cli-bot Jul 21, 2020
79a6dc2
Merge from awslabs/aws-sam-cli/develop
aws-sam-cli-bot Aug 12, 2020
70f485c
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Sep 4, 2020
a16acc5
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Sep 23, 2020
600efd9
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Sep 24, 2020
1929761
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Sep 24, 2020
2469558
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Oct 2, 2020
6bd4d6a
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Oct 7, 2020
3fa56b3
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Oct 8, 2020
32e7f76
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Oct 8, 2020
4ee7df6
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Oct 8, 2020
f04074d
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Oct 8, 2020
00ffebf
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Oct 29, 2020
c66c42e
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Nov 6, 2020
b8a5495
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Nov 10, 2020
e887725
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Nov 12, 2020
2557968
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Nov 20, 2020
559e4a5
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Nov 24, 2020
695cff9
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Dec 1, 2020
20ec051
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Dec 1, 2020
5c635a4
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Dec 1, 2020
66e22c4
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Dec 3, 2020
cab4101
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Dec 17, 2020
09f7b54
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Dec 17, 2020
1915d19
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jan 30, 2021
4e3f445
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Feb 4, 2021
a24d7f8
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Feb 9, 2021
6a21402
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Feb 11, 2021
535775b
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Feb 19, 2021
2b20f65
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Feb 25, 2021
2e7a2a3
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Feb 26, 2021
5879b26
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Mar 3, 2021
f94c5d5
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Mar 4, 2021
e53b730
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Mar 15, 2021
86f88cb
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Mar 16, 2021
f1a231f
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Apr 6, 2021
2ce6ee0
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Apr 22, 2021
18ac2e9
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jun 2, 2021
1ec81ce
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jun 7, 2021
c1e1b45
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jul 1, 2021
ec9fd6c
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jul 6, 2021
e725cc3
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jul 21, 2021
40b3de8
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jul 21, 2021
41f5701
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jul 22, 2021
5290329
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Aug 17, 2021
ddd8fe0
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Aug 19, 2021
0103565
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Sep 2, 2021
6da12d3
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Sep 8, 2021
03c5d7f
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Sep 24, 2021
7d84b12
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Sep 30, 2021
62d03ec
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Oct 26, 2021
d8e16f6
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Oct 26, 2021
5621ff3
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Nov 3, 2021
c6f5bc4
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Nov 24, 2021
6ae4da5
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jan 6, 2022
97babcb
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Feb 16, 2022
86a3b21
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Feb 18, 2022
e5d303d
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Feb 23, 2022
e64e815
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Feb 24, 2022
1e20a80
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Mar 1, 2022
5722288
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Mar 21, 2022
f877018
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Mar 24, 2022
491851e
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Mar 28, 2022
4bbe64b
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Apr 5, 2022
3089a79
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Apr 6, 2022
729bd1a
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Apr 7, 2022
3a57b7a
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Apr 27, 2022
1248aa1
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot May 3, 2022
e7c0ba6
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot May 9, 2022
d7e0c43
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot May 12, 2022
a17ca8a
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot May 31, 2022
7e2d795
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jun 8, 2022
becc8c4
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jun 9, 2022
d2ded65
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jun 29, 2022
1e14386
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Aug 12, 2022
66ca249
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Aug 17, 2022
831d546
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Sep 1, 2022
1c9a2a5
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Sep 6, 2022
b5c47a6
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Sep 16, 2022
bd96b79
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Sep 27, 2022
2b310c8
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Oct 6, 2022
473a726
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Oct 13, 2022
63a53ea
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Oct 27, 2022
883abbc
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Nov 10, 2022
bfdfd3a
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Nov 14, 2022
34d82ed
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Nov 15, 2022
6f7dc0b
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Nov 17, 2022
58a3e3e
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Nov 29, 2022
d37cb0e
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Dec 19, 2022
668c8b7
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jan 4, 2023
578f7af
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jan 4, 2023
355db4c
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jan 11, 2023
62b37bd
Merge from aws/aws-sam-cli/develop
aws-sam-cli-bot Jan 12, 2023
b5531a1
Revert "fix: change permissions on package universally (#4462)"
jfuss Jan 20, 2023
c0840c7
Revert "fix: use resource type instead of resource id for deciding zi…
jfuss Jan 20, 2023
0a20917
bump version to 1.70.1
mndeveci Jan 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samcli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
SAM CLI version
"""

__version__ = "1.70.0"
__version__ = "1.70.1"
3 changes: 1 addition & 2 deletions samcli/lib/package/packageable_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ def do_export(self, resource_id, resource_dict, parent_dir):
should_sign_package = self.code_signer.should_sign_package(resource_id)
artifact_extension = "zip" if should_sign_package else None
uploaded_url = upload_local_artifacts(
self.RESOURCE_TYPE,
resource_id,
resource_dict,
self.PROPERTY_NAME,
Expand Down Expand Up @@ -326,7 +325,7 @@ def do_export(self, resource_id, resource_dict, parent_dir):
"""

artifact_s3_url = upload_local_artifacts(
self.RESOURCE_TYPE, resource_id, resource_dict, self.PROPERTY_NAME, parent_dir, self.uploader
resource_id, resource_dict, self.PROPERTY_NAME, parent_dir, self.uploader
)

parsed_url = S3Uploader.parse_s3_url(
Expand Down
76 changes: 22 additions & 54 deletions samcli/lib/package/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Utilities involved in Packaging.
"""
import functools
import logging
import os
import platform
Expand All @@ -11,15 +10,14 @@
import zipfile
import contextlib
from contextlib import contextmanager
from typing import Dict, Optional, Callable, cast
from typing import Dict, Optional, cast

import jmespath

from samcli.commands.package.exceptions import ImageNotFoundError, InvalidLocalPathError
from samcli.lib.package.ecr_utils import is_ecr_url
from samcli.lib.package.s3_uploader import S3Uploader
from samcli.lib.utils.hash import dir_checksum
from samcli.lib.utils.resources import LAMBDA_LOCAL_RESOURCES

LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -121,7 +119,6 @@ def upload_local_image_artifacts(resource_id, resource_dict, property_name, pare


def upload_local_artifacts(
resource_type: str,
resource_id: str,
resource_dict: Dict,
property_name: str,
Expand All @@ -141,7 +138,6 @@ def upload_local_artifacts(

If path is already a path to S3 object, this method does nothing.

:param resource_type: Type of the CloudFormation resource
:param resource_id: Id of the CloudFormation resource
:param resource_dict: Dictionary containing resource definition
:param property_name: Property name of CloudFormation resource where this
Expand Down Expand Up @@ -170,14 +166,9 @@ def upload_local_artifacts(

local_path = make_abs_path(parent_dir, local_path)

# Or, pointing to a folder. Zip the folder and upload (zip_method is changed based on resource type)
# Or, pointing to a folder. Zip the folder and upload
if is_local_folder(local_path):
return zip_and_upload(
local_path,
uploader,
extension,
zip_method=make_zip_with_lambda_permissions if resource_type in LAMBDA_LOCAL_RESOURCES else make_zip,
)
return zip_and_upload(local_path, uploader, extension)

# Path could be pointing to a file. Upload the file
if is_local_file(local_path):
Expand All @@ -193,13 +184,13 @@ def resource_not_packageable(resource_dict):
return False


def zip_and_upload(local_path: str, uploader: S3Uploader, extension: Optional[str], zip_method: Callable) -> str:
with zip_folder(local_path, zip_method=zip_method) as (zip_file, md5_hash):
def zip_and_upload(local_path: str, uploader: S3Uploader, extension: Optional[str]) -> str:
with zip_folder(local_path) as (zip_file, md5_hash):
return uploader.upload_with_dedup(zip_file, precomputed_md5=md5_hash, extension=extension)


@contextmanager
def zip_folder(folder_path, zip_method):
def zip_folder(folder_path):
"""
Zip the entire folder and return a file to the zip. Use this inside
a "with" statement to cleanup the zipfile after it is used.
Expand All @@ -208,8 +199,6 @@ def zip_folder(folder_path, zip_method):
----------
folder_path : str
The path of the folder to zip
zip_method : Callable
Callable function that takes in a file name and source_path and zips accordingly.

Yields
------
Expand All @@ -221,15 +210,15 @@ def zip_folder(folder_path, zip_method):
md5hash = dir_checksum(folder_path, followlinks=True)
filename = os.path.join(tempfile.gettempdir(), "data-" + md5hash)

zipfile_name = zip_method(filename, folder_path)
zipfile_name = make_zip(filename, folder_path)
try:
yield zipfile_name, md5hash
finally:
if os.path.exists(zipfile_name):
os.remove(zipfile_name)


def make_zip_with_permissions(file_name, source_root, file_permissions, dir_permissions):
def make_zip(file_name, source_root):
"""
Create a zip file from the source directory

Expand All @@ -239,10 +228,6 @@ def make_zip_with_permissions(file_name, source_root, file_permissions, dir_perm
The basename of the zip file, without .zip
source_root : str
The path to the source directory
file_permissions : int
The permissions set for files within the source_root
dir_permissions : int
The permissions set for directories within the source_root
Returns
-------
str
Expand All @@ -257,45 +242,28 @@ def make_zip_with_permissions(file_name, source_root, file_permissions, dir_perm
for filename in files:
full_path = os.path.join(root, filename)
relative_path = os.path.relpath(full_path, source_root)
with open(full_path, "rb") as data:
file_bytes = data.read()
info = zipfile.ZipInfo(relative_path)
# Context: Nov 2020
# Set external attr with Unix 0755 permission
# Originally set to 0005 in the discussion below
# https://github.com/aws/aws-sam-cli/pull/2193#discussion_r513110608
# Changed to 0755 due to a regression in https://github.com/aws/aws-sam-cli/issues/2344
# Final PR: https://github.com/aws/aws-sam-cli/pull/2356/files
if file_permissions and dir_permissions:
# Clear external attr
if platform.system().lower() == "windows":
with open(full_path, "rb") as data:
file_bytes = data.read()
info = zipfile.ZipInfo(relative_path)
# Clear external attr set for Windows
info.external_attr = 0
# Set external attr with Unix 0755 permission
# Originally set to 0005 in the discussion below
# https://github.com/aws/aws-sam-cli/pull/2193#discussion_r513110608
# Changed to 0755 due to a regression in https://github.com/aws/aws-sam-cli/issues/2344
# Mimicking Unix permission bits and recommanded permission bits
# in the Lambda Trouble Shooting Docs
info.external_attr = 0o100755 << 16
# Set host OS to Unix
info.create_system = 3
info.external_attr = dir_permissions << 16 if info.is_dir() else file_permissions << 16
zf.writestr(info, file_bytes, compress_type=compression_type)
else:
zf.write(full_path, relative_path)
else:
zf.write(full_path, relative_path)

return zipfile_name


make_zip = functools.partial(
make_zip_with_permissions,
file_permissions=0o100755 if platform.system().lower() == "windows" else None,
dir_permissions=0o100755 if platform.system().lower() == "windows" else None,
)
# Context: Nov 2022
# NOTE(sriram-mv): Modify permissions regardless of the Operating system, since
# AWS Lambda requires following permissions as referenced in docs:
# https://aws.amazon.com/premiumsupport/knowledge-center/lambda-deployment-package-errors/
# For backward compatibility with windows, setting the permissions to be 755.
make_zip_with_lambda_permissions = functools.partial(
make_zip_with_permissions,
file_permissions=0o100755 if platform.system().lower() == "windows" else 0o100644,
dir_permissions=0o100755,
)


def copy_to_temp_dir(filepath):
tmp_dir = tempfile.mkdtemp()
dst = os.path.join(tmp_dir, os.path.basename(filepath))
Expand Down
4 changes: 2 additions & 2 deletions samcli/lib/sync/flows/auto_dependency_layer_sync_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from samcli.lib.bootstrap.nested_stack.nested_stack_builder import NestedStackBuilder
from samcli.lib.bootstrap.nested_stack.nested_stack_manager import NestedStackManager
from samcli.lib.build.build_graph import BuildGraph
from samcli.lib.package.utils import make_zip_with_lambda_permissions
from samcli.lib.package.utils import make_zip
from samcli.lib.providers.provider import Function, Stack
from samcli.lib.providers.sam_function_provider import SamFunctionProvider
from samcli.lib.sync.exceptions import (
Expand Down Expand Up @@ -85,7 +85,7 @@ def gather_resources(self) -> None:
self._get_compatible_runtimes()[0],
)
zip_file_path = os.path.join(tempfile.gettempdir(), "data-" + uuid.uuid4().hex)
self._zip_file = make_zip_with_lambda_permissions(zip_file_path, self._artifact_folder)
self._zip_file = make_zip(zip_file_path, self._artifact_folder)
self._local_sha = file_checksum(cast(str, self._zip_file), hashlib.sha256())

def _get_dependent_functions(self) -> List[Function]:
Expand Down
4 changes: 2 additions & 2 deletions samcli/lib/sync/flows/layer_sync_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from contextlib import ExitStack

from samcli.lib.build.app_builder import ApplicationBuilder
from samcli.lib.package.utils import make_zip_with_lambda_permissions
from samcli.lib.package.utils import make_zip
from samcli.lib.providers.provider import ResourceIdentifier, Stack, get_resource_by_id, Function, LayerVersion
from samcli.lib.providers.sam_function_provider import SamFunctionProvider
from samcli.lib.sync.exceptions import MissingPhysicalResourceError, NoLayerVersionsFoundError
Expand Down Expand Up @@ -235,7 +235,7 @@ def gather_resources(self) -> None:
self._artifact_folder = builder.build().artifacts.get(self._layer_identifier)

zip_file_path = os.path.join(tempfile.gettempdir(), f"data-{uuid.uuid4().hex}")
self._zip_file = make_zip_with_lambda_permissions(zip_file_path, self._artifact_folder)
self._zip_file = make_zip(zip_file_path, self._artifact_folder)
LOG.debug("%sCreated artifact ZIP file: %s", self.log_prefix, self._zip_file)
self._local_sha = file_checksum(cast(str, self._zip_file), hashlib.sha256())

Expand Down
4 changes: 2 additions & 2 deletions samcli/lib/sync/flows/zip_function_sync_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from samcli.lib.package.s3_uploader import S3Uploader
from samcli.lib.utils.colors import Colored
from samcli.lib.utils.hash import file_checksum
from samcli.lib.package.utils import make_zip_with_lambda_permissions
from samcli.lib.package.utils import make_zip

from samcli.lib.build.app_builder import ApplicationBuilder
from samcli.lib.sync.sync_flow import ResourceAPICall, ApiCallTypes
Expand Down Expand Up @@ -99,7 +99,7 @@ def gather_resources(self) -> None:
self._artifact_folder = build_result.artifacts.get(self._function_identifier)

zip_file_path = os.path.join(tempfile.gettempdir(), "data-" + uuid.uuid4().hex)
self._zip_file = make_zip_with_lambda_permissions(zip_file_path, self._artifact_folder)
self._zip_file = make_zip(zip_file_path, self._artifact_folder)
LOG.debug("%sCreated artifact ZIP file: %s", self.log_prefix, self._zip_file)
self._local_sha = file_checksum(cast(str, self._zip_file), hashlib.sha256())

Expand Down
7 changes: 0 additions & 7 deletions samcli/lib/utils/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,6 @@
AWS_CLOUDFORMATION_STACK: "TemplateURL",
}

LAMBDA_LOCAL_RESOURCES = [
AWS_LAMBDA_FUNCTION,
AWS_LAMBDA_LAYERVERSION,
AWS_SERVERLESS_FUNCTION,
AWS_SERVERLESS_LAYERVERSION,
]


def get_packageable_resource_paths():
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/sync/test_sync_adl.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_sync_watch_code(self):
)
read_until_string(
self.watch_process,
"\x1b[32mFinished syncing Layer HelloWorldFunction",
"\x1b[32mFinished syncing Function Layer Reference Sync HelloWorldFunction.\x1b[0m\n",
timeout=60,
)
self._confirm_lambda_error(lambda_functions[0])
Expand Down
2 changes: 1 addition & 1 deletion tests/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def read_until_string(process: Popen, expected_output: str, timeout: int = 5) ->
"""

def _compare_output(output, _: List[str]) -> bool:
return bool(expected_output in output)
return bool(output == expected_output)

try:
read_until(process, _compare_output, timeout)
Expand Down
Loading