Skip to content

Commit 0388e20

Browse files
authoredAug 19, 2024
Merge pull request #3639 from aws/release-v1.91.0
Release 1.91.0 (to main)
2 parents 690bfff + ed46c9e commit 0388e20

20 files changed

+571
-119
lines changed
 

‎.cfnlintrc.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ ignore_templates:
130130
- tests/translator/output/**/managed_policies_minimal.json # Intentionally has non-existent managed policy name
131131
- tests/translator/output/**/function_with_mq.json # Property "EventSourceArn" can Fn::GetAtt to a resource of types [AWS::DynamoDB::GlobalTable, AWS::DynamoDB::Table, AWS::Kinesis::Stream, AWS::Kinesis::StreamConsumer, AWS::SQS::Queue]
132132
- tests/translator/output/**/function_with_mq_using_autogen_role.json # Property "EventSourceArn" can Fn::GetAtt to a resource of types [AWS::DynamoDB::GlobalTable, AWS::DynamoDB::Table, AWS::Kinesis::Stream, AWS::Kinesis::StreamConsumer, AWS::SQS::Queue]
133+
- tests/translator/output/**/function_with_recursive_loop.json # Invalid Property Resources/RecursiveLoopParameterFunction/Properties/RecursiveLoop
133134
- tests/translator/output/**/function_with_tracing.json # Obsolete DependsOn on resource
134135
- tests/translator/output/**/api_with_propagate_tags.json # TODO: Intentional error transform tests. Will be updated.
135136
- tests/translator/output/**/function_with_intrinsics_resource_attribute.json # CFN now supports intrinsics in DeletionPolicy

‎integration/helpers/base_test.py

+7
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,13 @@ def verify_options_request(self, url, expected_status_code, headers=None):
567567
)
568568
return response
569569

570+
@retry(
571+
stop=stop_after_attempt(5),
572+
wait=wait_exponential(multiplier=1, min=16, max=64) + wait_random(0, 1),
573+
retry=retry_if_exception_type(StatusCodeError),
574+
after=after_log(LOG, logging.WARNING),
575+
reraise=True,
576+
)
570577
def verify_post_request(self, url: str, body_obj, expected_status_code: int, headers=None):
571578
"""Return response to POST request and verify matches expected status code."""
572579
response = self.do_post_request_with_logging(url, body_obj, headers)

‎integration/single/test_basic_api.py

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import logging
3+
import time
34
from unittest.case import skipIf
45

56
from tenacity import after_log, retry_if_exception_type, stop_after_attempt, wait_exponential, wait_random
@@ -129,8 +130,14 @@ def test_state_machine_with_api_single_quotes_input(self):
129130
api_endpoint = stack_output.get("ApiEndpoint")
130131

131132
input_json = {"f'oo": {"hello": "'wor'l'd'''"}}
133+
134+
# This will be the wait time before triggering the APIGW request
135+
time.sleep(10)
136+
132137
response = self.verify_post_request(api_endpoint, input_json, 200)
133138

139+
LOG.log(msg=f"retry times {self.verify_get_request_response.retry.statistics}", level=logging.WARNING)
140+
134141
execution_arn = response.json()["executionArn"]
135142
execution = self.client_provider.sfn_client.describe_execution(executionArn=execution_arn)
136143
execution_input = json.loads(execution["input"])

‎samtranslator/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.90.0"
1+
__version__ = "1.91.0"

‎samtranslator/internal/schema_source/aws_serverless_function.py

+3
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ class ScheduleV2Event(BaseModel):
512512
SnapStart = Optional[PassThroughProp] # TODO: check the type
513513
RuntimeManagementConfig = Optional[PassThroughProp] # TODO: check the type
514514
LoggingConfig = Optional[PassThroughProp] # TODO: add documentation
515+
RecursiveLoop = Optional[PassThroughProp]
515516

516517

517518
class Properties(BaseModel):
@@ -638,6 +639,7 @@ class Properties(BaseModel):
638639
VersionDescription: Optional[PassThroughProp] = prop("VersionDescription")
639640
VpcConfig: Optional[VpcConfig] = prop("VpcConfig")
640641
LoggingConfig: Optional[PassThroughProp] # TODO: add documentation
642+
RecursiveLoop: Optional[PassThroughProp] # TODO: add documentation
641643

642644

643645
class Globals(BaseModel):
@@ -696,6 +698,7 @@ class Globals(BaseModel):
696698
SnapStart: Optional[SnapStart] = prop("SnapStart")
697699
RuntimeManagementConfig: Optional[RuntimeManagementConfig] = prop("RuntimeManagementConfig")
698700
LoggingConfig: Optional[PassThroughProp] # TODO: add documentation
701+
RecursiveLoop: Optional[PassThroughProp] # TODO: add documentation
699702

700703

701704
class Resource(ResourceAttributes):

‎samtranslator/model/lambda_.py

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class LambdaFunction(Resource):
3535
"EphemeralStorage": GeneratedProperty(),
3636
"RuntimeManagementConfig": GeneratedProperty(),
3737
"LoggingConfig": GeneratedProperty(),
38+
"RecursiveLoop": GeneratedProperty(),
3839
}
3940

4041
Code: Dict[str, Any]
@@ -62,6 +63,7 @@ class LambdaFunction(Resource):
6263
EphemeralStorage: Optional[Dict[str, Any]]
6364
RuntimeManagementConfig: Optional[Dict[str, Any]]
6465
LoggingConfig: Optional[Dict[str, Any]]
66+
RecursiveLoop: Optional[str]
6567

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

‎samtranslator/model/sam_resources.py

+3
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ class SamFunction(SamResourceMacro):
179179
"FunctionUrlConfig": PropertyType(False, IS_DICT),
180180
"RuntimeManagementConfig": PassThroughProperty(False),
181181
"LoggingConfig": PassThroughProperty(False),
182+
"RecursiveLoop": PassThroughProperty(False),
182183
}
183184

184185
FunctionName: Optional[Intrinsicable[str]]
@@ -221,6 +222,7 @@ class SamFunction(SamResourceMacro):
221222
SnapStart: Optional[Dict[str, Any]]
222223
FunctionUrlConfig: Optional[Dict[str, Any]]
223224
LoggingConfig: Optional[Dict[str, Any]]
225+
RecursiveLoop: Optional[str]
224226

225227
event_resolver = ResourceTypeResolver(
226228
samtranslator.model.eventsources,
@@ -605,6 +607,7 @@ def _construct_lambda_function(self, intrinsics_resolver: IntrinsicsResolver) ->
605607

606608
lambda_function.RuntimeManagementConfig = self.RuntimeManagementConfig # type: ignore[attr-defined]
607609
lambda_function.LoggingConfig = self.LoggingConfig
610+
lambda_function.RecursiveLoop = self.RecursiveLoop
608611
self._validate_package_type(lambda_function)
609612
return lambda_function
610613

‎samtranslator/plugins/globals/globals.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class Globals:
5454
"FunctionUrlConfig",
5555
"RuntimeManagementConfig",
5656
"LoggingConfig",
57+
"RecursiveLoop",
5758
],
5859
# Everything except
5960
# DefinitionBody: because its hard to reason about merge of Swagger dictionaries
@@ -98,7 +99,7 @@ class Globals:
9899
}
99100
# unreleased_properties *must be* part of supported_properties too
100101
unreleased_properties: Dict[str, List[str]] = {
101-
SamResourceType.Function.value: ["RuntimeManagementConfig"],
102+
SamResourceType.Function.value: ["RuntimeManagementConfig", "RecursiveLoop"],
102103
}
103104

104105
def __init__(self, template: Dict[str, Any]) -> None:

0 commit comments

Comments
 (0)
Failed to load comments.