Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 0 additions & 36 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

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__ = '0.16.0'
__version__ = '0.16.1'
9 changes: 9 additions & 0 deletions samcli/commands/local/lib/sam_function_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
import six

from samcli.commands.local.cli_common.user_exceptions import InvalidLayerVersionArn
from .exceptions import InvalidLayerReference
from .provider import FunctionProvider, Function, LayerVersion
from .sam_base_provider import SamBaseProvider
Expand Down Expand Up @@ -238,6 +239,14 @@ def _parse_layer_info(list_of_layers, resources):
"""
layers = []
for layer in list_of_layers:
if layer == 'arn:aws:lambda:::awslayer:AmazonLinux1803':
LOG.debug('Skipped arn:aws:lambda:::awslayer:AmazonLinux1803 as the containers are AmazonLinux1803')
continue

if layer == 'arn:aws:lambda:::awslayer:AmazonLinux1703':
raise InvalidLayerVersionArn('Building and invoking locally only supports AmazonLinux1803. See '
'https://aws.amazon.com/blogs/compute/upcoming-updates-to-the-aws-lambda-execution-environment/ for more detials.') # noqa: E501

# If the layer is a string, assume it is the arn
if isinstance(layer, six.string_types):
layers.append(LayerVersion(layer, None))
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/buildcmd/test_build_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,9 @@ class TestBuildCommand_NodeFunctions(BuildIntegBase):
FUNCTION_LOGICAL_ID = "Function"

@parameterized.expand([
("nodejs4.3", False),
("nodejs6.10", False),
("nodejs8.10", False),
("nodejs10.x", False),
("nodejs4.3", "use_container"),
("nodejs6.10", "use_container"),
("nodejs8.10", "use_container"),
("nodejs10.x", "use_container")
Expand Down
26 changes: 26 additions & 0 deletions tests/unit/commands/local/lib/test_sam_function_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from mock import patch
from parameterized import parameterized

from samcli.commands.local.cli_common.user_exceptions import InvalidLayerVersionArn
from samcli.commands.local.lib.provider import Function, LayerVersion
from samcli.commands.local.lib.sam_function_provider import SamFunctionProvider
from samcli.commands.local.lib.exceptions import InvalidLayerReference
Expand Down Expand Up @@ -424,6 +425,31 @@ def test_raise_on_invalid_layer_resource(self, resources, layer_reference):
with self.assertRaises(InvalidLayerReference):
SamFunctionProvider._parse_layer_info([layer_reference], resources)

@parameterized.expand([
({
"Function": {
"Type": "AWS::Serverless::Function",
"Properties": {
}
}
}, "arn:aws:lambda:::awslayer:AmazonLinux1703")
])
def test_raise_on_AmazonLinux1703_layer_provided(self, resources, layer_reference):
with self.assertRaises(InvalidLayerVersionArn):
SamFunctionProvider._parse_layer_info([layer_reference], resources)

def test_must_ignore_opt_in_AmazonLinux1803_layer(self):
resources = {}

list_of_layers = ["arn:aws:lambda:region:account-id:layer:layer-name:1",
"arn:aws:lambda:::awslayer:AmazonLinux1803"]
actual = SamFunctionProvider._parse_layer_info(list_of_layers, resources)

for (actual_layer, expected_layer) in zip(actual, [LayerVersion(
"arn:aws:lambda:region:account-id:layer:layer-name:1",
None)]):
self.assertEquals(actual_layer, expected_layer)

def test_layers_created_from_template_resources(self):
resources = {
"Layer": {
Expand Down