Skip to content

Commit 44562dc

Browse files
authoredMay 16, 2024
Merge pull request #3594 from aws/release-v1.89.0
Release 1.89.0 (to main)
2 parents e7ab742 + 1268fd6 commit 44562dc

21 files changed

+22414
-3650
lines changed
 

‎integration/resources/templates/combination/connector_sfn_to_sns_write.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Resources:
1919

2020
MyTopic:
2121
Type: AWS::SNS::Topic
22+
Properties:
23+
KmsMasterKeyId: alias/aws/sns
2224

2325
MyConnector:
2426
Type: AWS::Serverless::Connector

‎integration/resources/templates/combination/function_with_alias_and_event_sources.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ Resources:
9191
Type: AWS::Kinesis::Stream
9292
Properties:
9393
ShardCount: 1
94+
StreamEncryption:
95+
EncryptionType: KMS
96+
KeyId: alias/aws/kinesis
9497

9598
# What an irony the I can't use AWS::Serverless::SimpleTable here because it doesn't support streams specification
9699
MyTable:

‎integration/resources/templates/combination/function_with_all_event_types.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ Resources:
132132
Condition: MyCondition
133133
Properties:
134134
ShardCount: 1
135+
StreamEncryption:
136+
EncryptionType: KMS
137+
KeyId: alias/aws/kinesis
135138

136139
MyDynamoDB:
137140
UpdateReplacePolicy: Delete

‎integration/resources/templates/combination/function_with_all_event_types_condition_false.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ Resources:
113113
Condition: MyCondition
114114
Properties:
115115
ShardCount: 1
116+
StreamEncryption:
117+
EncryptionType: KMS
118+
KeyId: alias/aws/kinesis
116119

117120
MyDynamoDB:
118121
Type: AWS::DynamoDB::Table

‎integration/resources/templates/combination/function_with_kinesis.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,8 @@ Resources:
4848
Type: AWS::Kinesis::Stream
4949
Properties:
5050
ShardCount: 1
51+
StreamEncryption:
52+
EncryptionType: KMS
53+
KeyId: alias/aws/kinesis
5154
Metadata:
5255
SamTransformTest: true

‎integration/resources/templates/combination/function_with_kinesis_intrinsics.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,8 @@ Resources:
8080
Type: AWS::Kinesis::Stream
8181
Properties:
8282
ShardCount: 1
83+
StreamEncryption:
84+
EncryptionType: KMS
85+
KeyId: alias/aws/kinesis
8386
Metadata:
8487
SamTransformTest: true

‎integration/resources/templates/single/basic_function_with_sns_dlq.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ Resources:
1212

1313
MyTopic:
1414
Type: AWS::SNS::Topic
15+
Properties:
16+
KmsMasterKeyId: alias/aws/sns
1517
Metadata:
1618
SamTransformTest: true

‎samtranslator/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.88.0"
1+
__version__ = "1.89.0"

‎samtranslator/model/api/api_generator.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from dataclasses import dataclass
44
from typing import Any, Dict, List, Optional, Set, Tuple, Union, cast
55

6+
from samtranslator.feature_toggle.feature_toggle import FeatureToggle
67
from samtranslator.metrics.method_decorator import cw_timer
78
from samtranslator.model import Resource
89
from samtranslator.model.apigateway import (
@@ -40,6 +41,8 @@
4041

4142
LOG = logging.getLogger(__name__)
4243

44+
FEATURE_FLAG_NORMALIZED_OPENAPI_VERSION = "normalized_open_api_version"
45+
4346
_CORS_WILDCARD = "'*'"
4447
CorsProperties = namedtuple(
4548
"CorsProperties", ["AllowMethods", "AllowHeaders", "AllowOrigin", "MaxAge", "AllowCredentials"]
@@ -205,6 +208,7 @@ def __init__( # noqa: PLR0913
205208
mode: Optional[Intrinsicable[str]] = None,
206209
api_key_source_type: Optional[Intrinsicable[str]] = None,
207210
always_deploy: Optional[bool] = False,
211+
feature_toggle: Optional[FeatureToggle] = None,
208212
):
209213
"""Constructs an API Generator class that generates API Gateway resources
210214
@@ -261,6 +265,7 @@ def __init__( # noqa: PLR0913
261265
self.mode = mode
262266
self.api_key_source_type = api_key_source_type
263267
self.always_deploy = always_deploy
268+
self.feature_toggle = feature_toggle
264269

265270
def _construct_rest_api(self) -> ApiGatewayRestApi:
266271
"""Constructs and returns the ApiGateway RestApi.
@@ -1125,11 +1130,15 @@ def _openapi_postprocess(self, definition_body: Dict[str, Any]) -> Dict[str, Any
11251130
if definition_body.get("swagger") is not None:
11261131
return definition_body
11271132

1128-
if definition_body.get("openapi") is not None and self.open_api_version is None:
1129-
self.open_api_version = definition_body.get("openapi")
1133+
if self.feature_toggle and self.feature_toggle.is_enabled(FEATURE_FLAG_NORMALIZED_OPENAPI_VERSION):
1134+
normalized_open_api_version = definition_body.get("openapi", self.open_api_version)
1135+
elif definition_body.get("openapi") is not None and self.open_api_version is None:
1136+
normalized_open_api_version = definition_body.get("openapi")
1137+
else:
1138+
normalized_open_api_version = self.open_api_version
11301139

1131-
if self.open_api_version and SwaggerEditor.safe_compare_regex_with_string(
1132-
SwaggerEditor._OPENAPI_VERSION_3_REGEX, self.open_api_version
1140+
if normalized_open_api_version and SwaggerEditor.safe_compare_regex_with_string(
1141+
SwaggerEditor._OPENAPI_VERSION_3_REGEX, normalized_open_api_version
11331142
):
11341143
if definition_body.get("securityDefinitions"):
11351144
components = definition_body.get("components", Py27Dict())

‎samtranslator/model/sam_resources.py

+2
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,7 @@ def to_cloudformation(self, **kwargs) -> List[Resource]: # type: ignore[no-unty
12941294
shared_api_usage_plan = kwargs.get("shared_api_usage_plan")
12951295
template_conditions = kwargs.get("conditions")
12961296
route53_record_set_groups = kwargs.get("route53_record_set_groups", {})
1297+
feature_toggle = kwargs.get("feature_toggle")
12971298

12981299
api_generator = ApiGenerator(
12991300
self.logical_id,
@@ -1330,6 +1331,7 @@ def to_cloudformation(self, **kwargs) -> List[Resource]: # type: ignore[no-unty
13301331
mode=self.Mode,
13311332
api_key_source_type=self.ApiKeySourceType,
13321333
always_deploy=self.AlwaysDeploy,
1334+
feature_toggle=feature_toggle,
13331335
)
13341336

13351337
generated_resources = api_generator.to_cloudformation(redeploy_restapi_parameters, route53_record_set_groups)

0 commit comments

Comments
 (0)
Failed to load comments.