Skip to content

Commit ce9a905

Browse files
authored
Merge pull request #2362 from aws/release/v1.44.0
Release/v1.44.0 (to main)
2 parents 0eebbec + e35a468 commit ce9a905

18 files changed

+459
-4
lines changed

docs/globals.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Currently, the following resources and properties are being supported:
7171
ReservedConcurrentExecutions:
7272
EventInvokeConfig:
7373
Architectures:
74+
EphemeralStorage:
7475
7576
Api:
7677
# Properties of AWS::Serverless::Api
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[
2+
{ "LogicalResourceId":"MyLambdaFunction", "ResourceType":"AWS::Lambda::Function" },
3+
{ "LogicalResourceId":"MyLambdaFunctionRole", "ResourceType":"AWS::IAM::Role" }
4+
]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Resources:
2+
MyLambdaFunction:
3+
Type: AWS::Serverless::Function
4+
Properties:
5+
Handler: index.handler
6+
Runtime: nodejs12.x
7+
CodeUri: ${codeuri}
8+
MemorySize: 128
9+
EphemeralStorage:
10+
Size: 1024
11+
Policies:
12+
- AWSLambdaRole
13+
- AmazonS3ReadOnlyAccess
14+
Environment:
15+
Variables:
16+
Name: Value
17+
Name2: Value2

integration/single/test_basic_function.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,22 @@ def test_basic_function_with_tracing(self):
204204
"PassThrough",
205205
"Expecting tracing config mode to be set to PassThrough.",
206206
)
207+
208+
@parameterized.expand(
209+
[
210+
"single/function_with_ephemeral_storage",
211+
]
212+
)
213+
def test_function_with_ephemeral_storage(self, file_name):
214+
"""
215+
Creates a basic function with ephemeral storage
216+
"""
217+
self.create_and_verify_stack(file_name)
218+
219+
function_id = self.get_physical_id_by_logical_id("MyLambdaFunction")
220+
221+
function_configuration_result = self.client_provider.lambda_client.get_function_configuration(
222+
FunctionName=function_id
223+
)
224+
225+
self.assertEqual(function_configuration_result.get("EphemeralStorage", {}).get("Size", 0), 1024)

samtranslator/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.43.0"
1+
__version__ = "1.44.0"

samtranslator/model/lambda_.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class LambdaFunction(Resource):
2727
"CodeSigningConfigArn": PropertyType(False, is_str()),
2828
"ImageConfig": PropertyType(False, is_type(dict)),
2929
"Architectures": PropertyType(False, list_of(one_of(is_str(), is_type(dict)))),
30+
"EphemeralStorage": PropertyType(False, is_type(dict)),
3031
}
3132

3233
runtime_attrs = {"name": lambda self: ref(self.logical_id), "arn": lambda self: fnGetAtt(self.logical_id, "Arn")}

samtranslator/model/sam_resources.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ class SamFunction(SamResourceMacro):
8383
"ReservedConcurrentExecutions": PropertyType(False, any_type()),
8484
"Layers": PropertyType(False, list_of(one_of(is_str(), is_type(dict)))),
8585
"EventInvokeConfig": PropertyType(False, is_type(dict)),
86+
"EphemeralStorage": PropertyType(False, is_type(dict)),
8687
# Intrinsic functions in value of Alias property are not supported, yet
8788
"AutoPublishAlias": PropertyType(False, one_of(is_str())),
8889
"AutoPublishCodeSha256": PropertyType(False, one_of(is_str())),
@@ -426,6 +427,7 @@ def _construct_lambda_function(self):
426427
lambda_function.ImageConfig = self.ImageConfig
427428
lambda_function.PackageType = self.PackageType
428429
lambda_function.Architectures = self.Architectures
430+
lambda_function.EphemeralStorage = self.EphemeralStorage
429431

430432
if self.Tracing:
431433
lambda_function.TracingConfig = {"Mode": self.Tracing}

samtranslator/plugins/globals/globals.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Globals(object):
4242
"FileSystemConfigs",
4343
"CodeSigningConfigArn",
4444
"Architectures",
45+
"EphemeralStorage",
4546
],
4647
# Everything except
4748
# DefinitionBody: because its hard to reason about merge of Swagger dictionaries
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Parameters:
2+
EphemeralStorageSizeRef:
3+
Type: Number
4+
Resources:
5+
MinimalFunction:
6+
Type: 'AWS::Serverless::Function'
7+
Properties:
8+
CodeUri: s3://sam-demo-bucket/hello.zip
9+
Handler: hello.handler
10+
Runtime: python2.7
11+
EphemeralStorage:
12+
Size: 1024
13+
FunctionWithIntrinsicRef:
14+
Type: 'AWS::Serverless::Function'
15+
Properties:
16+
CodeUri: s3://sam-demo-bucket/hello.zip
17+
Handler: hello.handler
18+
Runtime: python2.7
19+
EphemeralStorage:
20+
Size: !Ref EphemeralStorageSizeRef

tests/translator/input/globals_for_function.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Globals:
2424
ReservedConcurrentExecutions: 50
2525
Architectures:
2626
- x86_64
27+
EphemeralStorage:
28+
Size: 1024
2729

2830
Resources:
2931
MinimalFunction:

0 commit comments

Comments
 (0)