Skip to content

Commit 4960606

Browse files
authored
Merge pull request #3675 from aws/release-v1.92.0
Release 1.92.0 (to main)
2 parents 0388e20 + 0561992 commit 4960606

File tree

165 files changed

+5351
-1927
lines changed

Some content is hidden

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

165 files changed

+5351
-1927
lines changed

.cfnlintrc.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,16 @@ ignore_templates:
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]
133133
- tests/translator/output/**/function_with_recursive_loop.json # Invalid Property Resources/RecursiveLoopParameterFunction/Properties/RecursiveLoop
134+
- tests/translator/output/**/function_with_sourcekmskeyarn.json # Invalid Property Resources/SourceKMSKeyArnParameterFunction/Properties/SourceKMSKeyArn
134135
- tests/translator/output/**/function_with_tracing.json # Obsolete DependsOn on resource
135136
- tests/translator/output/**/api_with_propagate_tags.json # TODO: Intentional error transform tests. Will be updated.
136137
- tests/translator/output/**/function_with_intrinsics_resource_attribute.json # CFN now supports intrinsics in DeletionPolicy
138+
- tests/translator/output/**/function_with_snapstart.json # Snapstart intentionally not attached to a lambda version which causes lint issues
139+
- tests/translator/output/**/managed_policies_everything.json # intentionally contains wrong arns
137140
ignore_checks:
138141
- E2531 # Deprecated runtime; not relevant for transform tests
142+
- E2533 # Another deprecated runtime; not relevant for transform tests
139143
- W2531 # EOL runtime; not relevant for transform tests
140144
- E3001 # Invalid or unsupported Type; common in transform tests since they focus on SAM resources
141145
- W2001 # Parameter not used
146+
- E3006 # Resource type check; we have some Foo Bar resources

DEVELOPMENT_GUIDE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ We format our code using [Black](https://github.com/python/black) and verify the
5959
during PR checks. Black will be installed automatically with `make init`.
6060

6161
After installing, you can run our formatting through our Makefile by `make format` or integrating Black directly in your favorite IDE (instructions
62-
can be found [here](https://black.readthedocs.io/en/stable/editor_integration.html))
62+
can be found [here](https://black.readthedocs.io/en/stable/integrations/editors.html))
6363

6464
##### (Workaround) Integrating Black directly in your favorite IDE
65-
Since black is installed in virtualenv, when you follow [this instruction](https://black.readthedocs.io/en/stable/editor_integration.html), `which black` might give you this
65+
Since black is installed in virtualenv, when you follow [this instruction](https://black.readthedocs.io/en/stable/integrations/editors.html), `which black` might give you this
6666

6767
```bash
6868
(sam38) $ where black

bin/add_transform_test.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,13 @@ def get_input_file_path() -> Path:
6868

6969

7070
def copy_input_file_to_transform_test_dir(input_file_path: Path, transform_test_input_path: Path) -> None:
71-
shutil.copyfile(input_file_path, transform_test_input_path)
72-
print(f"Transform Test input file generated {transform_test_input_path}")
71+
try:
72+
shutil.copyfile(input_file_path, transform_test_input_path)
73+
print(f"Transform Test input file generated {transform_test_input_path}")
74+
except shutil.SameFileError:
75+
print(f"Source and destination are the same file: {input_file_path}")
76+
except Exception as e:
77+
raise e
7378

7479

7580
def verify_input_template(input_file_path: Path) -> None:
@@ -99,7 +104,9 @@ def main() -> None:
99104
verify_input_template(input_file_path)
100105

101106
transform_test_input_path = TRANSFORM_TEST_DIR / "input" / (file_basename + ".yaml")
102-
copy_input_file_to_transform_test_dir(input_file_path, transform_test_input_path)
107+
# check if the template is not already in the transform test input dir
108+
if input_file_path != transform_test_input_path:
109+
copy_input_file_to_transform_test_dir(input_file_path, transform_test_input_path)
103110

104111
generate_transform_test_output_files(transform_test_input_path, file_basename)
105112

bin/run_cfn_lint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [ ! -d "${VENV}" ]; then
99
python3 -m venv "${VENV}"
1010
fi
1111

12-
"${VENV}/bin/python" -m pip install cfn-lint==0.75.0 --upgrade --quiet
12+
"${VENV}/bin/python" -m pip install cfn-lint --upgrade --quiet
1313
# update cfn schema
1414
"${VENV}/bin/cfn-lint" -u
1515
"${VENV}/bin/cfn-lint" --format parseable

integration/resources/templates/combination/all_policy_templates.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Resources:
88
Properties:
99
CodeUri: ${codeuri}
1010
Handler: hello.handler
11-
Runtime: python3.8
11+
Runtime: python3.11
1212
Policies:
1313

1414
- SQSPollerPolicy:
@@ -123,7 +123,7 @@ Resources:
123123
Properties:
124124
CodeUri: ${codeuri}
125125
Handler: hello.handler
126-
Runtime: python3.8
126+
Runtime: python3.11
127127
Policies:
128128

129129
- SESEmailTemplateCrudPolicy: {}
@@ -187,7 +187,7 @@ Resources:
187187
Properties:
188188
CodeUri: ${codeuri}
189189
Handler: hello.handler
190-
Runtime: python3.8
190+
Runtime: python3.11
191191
Policies:
192192
- ElasticMapReduceModifyInstanceFleetPolicy:
193193
ClusterId: name

integration/resources/templates/combination/api_with_authorizers_invokefunction_set_none.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Resources:
1212
InlineCode: |
1313
print("hello")
1414
Handler: index.handler
15-
Runtime: python3.8
15+
Runtime: python3.11
1616
Events:
1717
API3:
1818
Type: Api

integration/resources/templates/combination/api_with_authorizers_max.yaml

+2-2
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

+2-2
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/connector_function_to_location_place_index.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Resources:
99
TriggerFunction:
1010
Type: AWS::Serverless::Function
1111
Properties:
12-
Runtime: python3.8
12+
Runtime: python3.11
1313
Handler: index.handler
1414
InlineCode: |
1515
import boto3

integration/resources/templates/combination/depends_on.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Resources:
1212
Role:
1313
Fn::GetAtt: LambdaRole.Arn
1414
Handler: lambda_function.lambda_handler
15-
Runtime: python3.8
15+
Runtime: python3.11
1616
Timeout: 15
1717
CodeUri: ${codeuri}
1818

integration/resources/templates/combination/function_with_custom_code_deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Resources:
1010
Properties:
1111
CodeUri: ${codeuri}
1212
Handler: index.handler
13-
Runtime: python3.8
13+
Runtime: python3.11
1414

1515
AutoPublishAlias: Live
1616

integration/resources/templates/combination/function_with_deployment_basic.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Resources:
55
Properties:
66
CodeUri: ${codeuri}
77
Handler: index.handler
8-
Runtime: python3.8
8+
Runtime: python3.11
99

1010
AutoPublishAlias: Live
1111

integration/resources/templates/combination/function_with_deployment_default_role_managed_policy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Resources:
44
Properties:
55
CodeUri: ${codeuri}
66
Handler: index.handler
7-
Runtime: python3.8
7+
Runtime: python3.11
88
AutoPublishAlias: Live
99
DeploymentPreference:
1010
Type: Canary10Percent5Minutes

integration/resources/templates/combination/function_with_deployment_globals.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Resources:
1616
Properties:
1717
CodeUri: ${codeuri}
1818
Handler: index.handler
19-
Runtime: python3.8
19+
Runtime: python3.11
2020
AutoPublishAlias: Live
2121

2222
DeploymentRole:

integration/resources/templates/combination/function_with_http_api.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Resources:
33
Type: AWS::Serverless::Function
44
Properties:
55
Handler: index.handler
6-
Runtime: python3.8
6+
Runtime: python3.11
77
InlineCode: |
88
def handler(event, context):
99
return {'body': 'Hello World!', 'statusCode': 200}

integration/resources/templates/combination/function_with_http_api_default_path.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Resources:
33
Type: AWS::Serverless::Function
44
Properties:
55
Handler: index.handler
6-
Runtime: python3.8
6+
Runtime: python3.11
77
InlineCode: |
88
def handler(event, context):
99
return {'body': 'Hello World!', 'statusCode': 200}

integration/resources/templates/combination/function_with_implicit_http_api.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Resources:
44
Type: AWS::Serverless::Function
55
Properties:
66
Handler: index.handler
7-
Runtime: python3.8
7+
Runtime: python3.11
88
InlineCode: |
99
def handler(event, context):
1010
return {'body': 'Hello World!', 'statusCode': 200}

integration/resources/templates/combination/function_with_mq.yaml

+2-1
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

+2-1
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

+2-1
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/combination/function_with_policy_templates.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Resources:
1414
Properties:
1515
CodeUri: ${codeuri}
1616
Handler: hello.handler
17-
Runtime: python3.8
17+
Runtime: python3.11
1818
Policies:
1919
- SQSPollerPolicy:
2020
QueueName:

integration/resources/templates/combination/function_with_resource_refs.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ Resources:
1010
Properties:
1111
CodeUri: ${codeuri}
1212
Handler: hello.handler
13-
Runtime: python3.8
13+
Runtime: python3.11
1414
AutoPublishAlias: Live
1515

1616
MyOtherFunction:
1717
Type: AWS::Serverless::Function
1818
Properties:
1919
CodeUri: ${codeuri}
20-
Runtime: python3.8
20+
Runtime: python3.11
2121
Handler: hello.handler
2222
Environment:
2323
Variables:

integration/resources/templates/combination/http_api_with_auth.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Resources:
33
Type: AWS::Serverless::Function
44
Properties:
55
Handler: index.handler
6-
Runtime: python3.8
6+
Runtime: python3.11
77
InlineCode: |
88
def handler(event, context):
99
return {'body': 'Hello World!', 'statusCode': 200}

integration/resources/templates/combination/http_api_with_auth_updated.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Resources:
33
Type: AWS::Serverless::Function
44
Properties:
55
Handler: index.handler
6-
Runtime: python3.8
6+
Runtime: python3.11
77
InlineCode: |
88
def handler(event, context):
99
return {'body': 'Hello World!', 'statusCode': 200}

integration/resources/templates/combination/http_api_with_fail_on_warnings_and_default_stage_name.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Resources:
1616
InlineCode: |
1717
def handler(event, context):
1818
print("Hello, world!")
19-
Runtime: python3.8
19+
Runtime: python3.11
2020
Architectures:
2121
- x86_64
2222
Events:

integration/resources/templates/combination/state_machine_with_policy_templates.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Resources:
2424
Properties:
2525
CodeUri: ${codeuri}
2626
Handler: hello.handler
27-
Runtime: python3.8
27+
Runtime: python3.11
2828

2929
MyQueue:
3030
Type: AWS::SQS::Queue

integration/resources/templates/single/basic_api_with_mode.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Resources:
99
Type: AWS::Serverless::Function
1010
Properties:
1111
Handler: index.handler
12-
Runtime: python3.8
12+
Runtime: python3.11
1313
AutoPublishAlias: live
1414
InlineCode: |
1515
import json
@@ -31,6 +31,6 @@ Resources:
3131

3232
Outputs:
3333
ApiEndpoint:
34-
Value: !Sub "https://${MyApi}.execute-api.${AWS::Region}.amazonaws.com/MyNewStageName"
34+
Value: !Sub "https://${MyApi}.execute-api.${AWS::Region}.${AWS::URLSuffix}/MyNewStageName"
3535
Metadata:
3636
SamTransformTest: true

integration/resources/templates/single/basic_api_with_mode_update.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Resources:
99
Type: AWS::Serverless::Function
1010
Properties:
1111
Handler: index.handler
12-
Runtime: python3.8
12+
Runtime: python3.11
1313
AutoPublishAlias: live
1414
InlineCode: |
1515
def handler(event, context):

integration/resources/templates/single/function_with_deployment_preference_alarms_intrinsic_if.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Resources:
99
Properties:
1010
CodeUri: ${codeuri}
1111
Handler: hello.handler
12-
Runtime: python3.8
12+
Runtime: python3.11
1313
AutoPublishAlias: live
1414
DeploymentPreference:
1515
Type: Linear10PercentEvery3Minutes

integration/resources/templates/single/function_with_role_path.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Resources:
44
Properties:
55
CodeUri: ${codeuri}
66
Handler: hello.handler
7-
Runtime: python3.8
7+
Runtime: python3.11
88
RolePath: /foo/bar/
99
Metadata:
1010
SamTransformTest: true

integration/resources/templates/single/state_machine_with_api.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ Resources:
1414
print(event)
1515
return "do nothing"
1616
Handler: index.handler
17-
Runtime: python3.8
17+
Runtime: python3.11
1818
Post:
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/__init__.py

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

samtranslator/internal/schema_source/aws_serverless_function.py

+3
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ class ScheduleV2Event(BaseModel):
513513
RuntimeManagementConfig = Optional[PassThroughProp] # TODO: check the type
514514
LoggingConfig = Optional[PassThroughProp] # TODO: add documentation
515515
RecursiveLoop = Optional[PassThroughProp]
516+
SourceKMSKeyArn = Optional[PassThroughProp]
516517

517518

518519
class Properties(BaseModel):
@@ -640,6 +641,7 @@ class Properties(BaseModel):
640641
VpcConfig: Optional[VpcConfig] = prop("VpcConfig")
641642
LoggingConfig: Optional[PassThroughProp] # TODO: add documentation
642643
RecursiveLoop: Optional[PassThroughProp] # TODO: add documentation
644+
SourceKMSKeyArn: Optional[PassThroughProp] # TODO: add documentation
643645

644646

645647
class Globals(BaseModel):
@@ -699,6 +701,7 @@ class Globals(BaseModel):
699701
RuntimeManagementConfig: Optional[RuntimeManagementConfig] = prop("RuntimeManagementConfig")
700702
LoggingConfig: Optional[PassThroughProp] # TODO: add documentation
701703
RecursiveLoop: Optional[PassThroughProp] # TODO: add documentation
704+
SourceKMSKeyArn: Optional[PassThroughProp] # TODO: add documentation
702705

703706

704707
class Resource(ResourceAttributes):

samtranslator/internal/schema_source/aws_serverless_statemachine.py

+1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ class Properties(BaseModel):
174174
Type: Optional[PassThroughProp] = properties("Type")
175175
AutoPublishAlias: Optional[PassThroughProp]
176176
DeploymentPreference: Optional[PassThroughProp]
177+
UseAliasAsEventTarget: Optional[bool]
177178

178179

179180
class Resource(ResourceAttributes):

0 commit comments

Comments
 (0)