Skip to content

Commit d100983

Browse files
authored
Merge pull request #3167 from aws/release-v1.67.0
Release 1.67.0 (to main)
2 parents 8bfcb92 + b9e5adc commit d100983

File tree

45 files changed

+4892
-2056
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4892
-2056
lines changed

integration/helpers/deployer/exceptions/exceptions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ def __init__(self, stack_name, msg):
3838
super().__init__(message=message_fmt.format(stack_name=self.stack_name, msg=msg))
3939

4040

41+
class TerminationProtectionUpdateFailedError(UserException):
42+
def __init__(self, stack_name, msg):
43+
self.stack_name = stack_name
44+
self.msg = msg
45+
46+
message_fmt = "Failed to update termination protection of the stack: {stack_name}, {msg}"
47+
48+
super().__init__(message=message_fmt.format(stack_name=self.stack_name, msg=msg))
49+
50+
4151
class DeployStackOutPutFailedError(UserException):
4252
def __init__(self, stack_name, msg):
4353
self.stack_name = stack_name

integration/helpers/stack.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import botocore
44

55
from integration.helpers.deployer.deployer import Deployer
6-
from integration.helpers.deployer.exceptions.exceptions import ThrottlingError
6+
from integration.helpers.deployer.exceptions.exceptions import TerminationProtectionUpdateFailedError, ThrottlingError
77
from integration.helpers.deployer.utils.retry import retry_with_exponential_backoff_and_jitter
88
from integration.helpers.resource import generate_suffix
99
from integration.helpers.template import transform_template
@@ -54,6 +54,7 @@ def _deploy_stack(self, output_file_path, update, parameters=None):
5454
self.deployer.wait_for_execute(self.stack_name, "UPDATE" if update else "CREATE")
5555

5656
self._get_stack_description()
57+
self._udpate_termination_protection()
5758
self.stack_resources = self.cfn_client.list_stack_resources(StackName=self.stack_name)
5859

5960
@retry_with_exponential_backoff_and_jitter(ThrottlingError, 5, 360)
@@ -65,6 +66,12 @@ def _get_stack_description(self):
6566
raise ThrottlingError(stack_name=self.stack_name, msg=str(ex))
6667
raise
6768

69+
def _udpate_termination_protection(self, enable=True):
70+
try:
71+
self.cfn_client.update_termination_protection(EnableTerminationProtection=enable, StackName=self.stack_name)
72+
except botocore.exceptions.ClientError as ex:
73+
raise TerminationProtectionUpdateFailedError(stack_name=self.stack_name, msg=str(ex))
74+
6875
@staticmethod
6976
def _generate_output_file_path(file_path, output_dir):
7077
# add a folder name before file name to avoid possible collisions between

requirements/dev.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ mypy~=1.1.0
2929
boto3-stubs[appconfig,serverlessrepo]>=1.19.5,==1.*
3030
types-PyYAML~=6.0
3131
types-jsonschema~=3.2
32+
33+
# Check package version (backport importlib.metadata for python 3.7)
34+
# https://docs.python.org/3/library/importlib.metadata.html
35+
importlib_metadata; python_version < '3.8'

samtranslator/__init__.py

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

samtranslator/internal/data/aws_managed_policies.json

Lines changed: 558 additions & 0 deletions
Large diffs are not rendered by default.

samtranslator/internal/schema_source/aws_serverless_function.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ class ScheduleV2EventProperties(BaseModel):
466466
ScheduleExpressionTimezone: Optional[PassThroughProp] = schedulev2eventproperties("ScheduleExpressionTimezone")
467467
StartDate: Optional[PassThroughProp] = schedulev2eventproperties("StartDate")
468468
State: Optional[PassThroughProp] = schedulev2eventproperties("State")
469+
OmitName: Optional[bool] # TODO: add doc
469470

470471

471472
class ScheduleV2Event(BaseModel):

samtranslator/internal/schema_source/aws_serverless_statemachine.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ class ScheduleV2EventProperties(BaseModel):
7272
ScheduleExpressionTimezone: Optional[PassThroughProp] = scheduleeventv2properties("ScheduleExpressionTimezone")
7373
StartDate: Optional[PassThroughProp] = scheduleeventv2properties("StartDate")
7474
State: Optional[PassThroughProp] = scheduleeventv2properties("State")
75+
OmitName: Optional[bool] # TODO: add doc
7576

7677

7778
class ScheduleV2Event(BaseModel):

samtranslator/internal/schema_source/sam-docs.json

Lines changed: 6 additions & 5 deletions
Large diffs are not rendered by default.

samtranslator/model/eventbridge_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ def validate_dlq_config(source_logical_id, dead_letter_config): # type: ignore[
3030
is_type_defined = "Type" in dead_letter_config
3131
if is_arn_defined and is_type_defined:
3232
raise InvalidEventException(
33-
source_logical_id, "You can either define 'Arn' or 'Type' property of DeadLetterConfig"
33+
source_logical_id, "You can either define 'Arn' or 'Type' property of DeadLetterConfig."
3434
)
3535
if is_type_defined and dead_letter_config.get("Type") not in supported_types:
3636
raise InvalidEventException(
3737
source_logical_id,
38-
"The only valid value for 'Type' property of DeadLetterConfig is 'SQS'",
38+
"The only valid value for 'Type' property of DeadLetterConfig is 'SQS'.",
3939
)
4040
if not is_arn_defined and not is_type_defined:
41-
raise InvalidEventException(source_logical_id, "No 'Arn' or 'Type' property provided for DeadLetterConfig")
41+
raise InvalidEventException(source_logical_id, "No 'Arn' or 'Type' property provided for DeadLetterConfig.")
4242

4343
@staticmethod
4444
def get_dlq_queue_arn_and_resources(cw_event_source, source_arn, attributes): # type: ignore[no-untyped-def]

samtranslator/model/eventsources/push.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ def _get_merged_definitions(
971971
- otherwise include key-value pairs from both definitions
972972
"""
973973
merged_definition_body = source_definition_body.copy()
974-
source_body_paths = merged_definition_body.get("paths", {})
974+
source_body_paths = merged_definition_body.get("paths") or {}
975975

976976
try:
977977
path_method_body = dict_deep_get(source_body_paths, [self.Path, self.Method]) or {}

0 commit comments

Comments
 (0)