Skip to content

Commit 7341594

Browse files
authored
Merge branch 'develop' into develop
2 parents d66aa22 + 8de1ca9 commit 7341594

14 files changed

+581
-302
lines changed

integration/resources/templates/combination/api_with_authorizers_max.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ Resources:
125125
Type: AWS::IAM::Role
126126
Properties:
127127
ManagedPolicyArns:
128-
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
129-
- arn:aws:iam::aws:policy/service-role/AWSLambdaRole
128+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
129+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaRole
130130
AssumeRolePolicyDocument:
131131
Version: '2012-10-17'
132132
Statement:

integration/resources/templates/combination/api_with_authorizers_max_openapi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ Resources:
138138
Type: AWS::IAM::Role
139139
Properties:
140140
ManagedPolicyArns:
141-
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
142-
- arn:aws:iam::aws:policy/service-role/AWSLambdaRole
141+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
142+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaRole
143143
AssumeRolePolicyDocument:
144144
Version: '2012-10-17'
145145
Statement:

integration/resources/templates/combination/function_with_mq.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ Resources:
101101
secretsmanager:GetSecretValue]
102102
Effect: Allow
103103
Resource: '*'
104-
ManagedPolicyArns: [arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole]
104+
ManagedPolicyArns:
105+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
105106
Tags:
106107
- {Value: SAM, Key: lambda:createdBy}
107108

integration/resources/templates/combination/function_with_msk.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ Resources:
2727
logs:CreateLogStream, logs:PutLogEvents]
2828
Effect: Allow
2929
Resource: '*'
30-
ManagedPolicyArns: [arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole]
30+
ManagedPolicyArns:
31+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
3132
Tags:
3233
- {Value: SAM, Key: lambda:createdBy}
3334

integration/resources/templates/combination/function_with_msk_trigger_and_s3_onfailure_events_destinations.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ Resources:
2727
logs:CreateLogStream, logs:PutLogEvents, s3:ListBucket]
2828
Effect: Allow
2929
Resource: '*'
30-
ManagedPolicyArns: [arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole]
30+
ManagedPolicyArns:
31+
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
3132
Tags:
3233
- {Value: SAM, Key: lambda:createdBy}
3334

integration/resources/templates/single/state_machine_with_api.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Resources:
1919
Type: AWS::Serverless::StateMachine
2020
Properties:
2121
Policies:
22-
- arn:aws:iam::aws:policy/AWSLambda_FullAccess
22+
- !Sub arn:${AWS::Partition}:iam::aws:policy/AWSLambda_FullAccess
2323
Definition:
2424
StartAt: One
2525
States:

samtranslator/model/api/api_generator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,9 @@ def _add_cors(self) -> None:
750750
properties = CorsProperties(AllowOrigin=self.cors) # type: ignore[call-arg]
751751
elif isinstance(self.cors, dict):
752752
# Make sure keys in the dict are recognized
753-
if not all(key in CorsProperties._fields for key in self.cors):
754-
raise InvalidResourceException(self.logical_id, INVALID_ERROR)
753+
for key in self.cors:
754+
if key not in CorsProperties._fields:
755+
raise InvalidResourceException(self.logical_id, f"Invalid key '{key}' for 'Cors' property.")
755756

756757
properties = CorsProperties(**self.cors)
757758

samtranslator/model/api/http_api_generator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,9 @@ def _add_cors(self) -> None:
187187

188188
elif isinstance(self.cors_configuration, dict):
189189
# Make sure keys in the dict are recognized
190-
if not all(key in CorsProperties._fields for key in self.cors_configuration):
191-
raise InvalidResourceException(self.logical_id, "Invalid value for 'Cors' property.")
190+
for key in self.cors_configuration:
191+
if key not in CorsProperties._fields:
192+
raise InvalidResourceException(self.logical_id, f"Invalid key '{key}' for 'Cors' property.")
192193

193194
properties = CorsProperties(**self.cors_configuration)
194195

samtranslator/schema/schema.json

Lines changed: 81 additions & 85 deletions
Large diffs are not rendered by default.

schema_source/cloudformation-docs.json

Lines changed: 363 additions & 117 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)