Skip to content

Release 1.92.0 (to main) #3675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
174f42a
chore(schema): update (#3631)
github-actions[bot] Aug 6, 2024
249dc32
fix: Add the property UseAliasAsEventTarget to AWS::Serverless::State…
scorbiere Aug 12, 2024
2aef955
chore(schema): update (#3635)
github-actions[bot] Aug 14, 2024
463d5eb
chore: Update Runtime to Python3.11 (#3634)
jfuss Aug 14, 2024
0628fb0
Merge branch 'develop' into tmp_manual_pypi_main_branch
paulhcsun Aug 15, 2024
dd8056a
Merge pull request #3638 from aws/tmp_manual_pypi_main_branch
paulhcsun Aug 15, 2024
5e55b37
Merge branch 'develop' into tmp/1724090200/main
aaythapa Aug 19, 2024
1de5aa3
Merge pull request #3640 from aws/tmp/1724090200/main
aaythapa Aug 19, 2024
806998f
chore(schema): update (#3642)
github-actions[bot] Aug 20, 2024
15dc964
chore(schema): update (#3643)
github-actions[bot] Aug 27, 2024
119e2a2
chore(schema): update (#3646)
github-actions[bot] Sep 5, 2024
ab1d699
fix: update cfn-lint versions and match tests (#3651)
aaythapa Sep 11, 2024
6aadbdf
chore(schema): update (#3650)
github-actions[bot] Sep 11, 2024
a257e44
chore(schema): update (#3655)
github-actions[bot] Sep 17, 2024
edf208e
chore(schema): update (#3658)
github-actions[bot] Oct 1, 2024
d5ca10d
fix: modify error message to show which cors key is invalid (#3659)
aaythapa Oct 3, 2024
25158f1
chore(schema): update (#3660)
github-actions[bot] Oct 8, 2024
8de1ca9
chore: Fix Managed Policy ARNs with hardcoded partition in tests (#3662)
samson-keung Oct 10, 2024
c029c63
chore: Fix hardcoded endpoint domain in test template (#3663)
samson-keung Oct 15, 2024
453a3bf
feat: support SourceKMSKeyArn
aaythapa Nov 9, 2024
9f5426b
chore: bump version to 1.92.0
aws-sam-cli-bot Nov 9, 2024
0561992
fix graph ql tests
aaythapa Nov 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .cfnlintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,16 @@ ignore_templates:
- 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]
- 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]
- tests/translator/output/**/function_with_recursive_loop.json # Invalid Property Resources/RecursiveLoopParameterFunction/Properties/RecursiveLoop
- tests/translator/output/**/function_with_sourcekmskeyarn.json # Invalid Property Resources/SourceKMSKeyArnParameterFunction/Properties/SourceKMSKeyArn
- tests/translator/output/**/function_with_tracing.json # Obsolete DependsOn on resource
- tests/translator/output/**/api_with_propagate_tags.json # TODO: Intentional error transform tests. Will be updated.
- tests/translator/output/**/function_with_intrinsics_resource_attribute.json # CFN now supports intrinsics in DeletionPolicy
- tests/translator/output/**/function_with_snapstart.json # Snapstart intentionally not attached to a lambda version which causes lint issues
- tests/translator/output/**/managed_policies_everything.json # intentionally contains wrong arns
ignore_checks:
- E2531 # Deprecated runtime; not relevant for transform tests
- E2533 # Another deprecated runtime; not relevant for transform tests
- W2531 # EOL runtime; not relevant for transform tests
- E3001 # Invalid or unsupported Type; common in transform tests since they focus on SAM resources
- W2001 # Parameter not used
- E3006 # Resource type check; we have some Foo Bar resources
4 changes: 2 additions & 2 deletions DEVELOPMENT_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ We format our code using [Black](https://github.com/python/black) and verify the
during PR checks. Black will be installed automatically with `make init`.

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

##### (Workaround) Integrating Black directly in your favorite IDE
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
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

```bash
(sam38) $ where black
Expand Down
13 changes: 10 additions & 3 deletions bin/add_transform_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ def get_input_file_path() -> Path:


def copy_input_file_to_transform_test_dir(input_file_path: Path, transform_test_input_path: Path) -> None:
shutil.copyfile(input_file_path, transform_test_input_path)
print(f"Transform Test input file generated {transform_test_input_path}")
try:
shutil.copyfile(input_file_path, transform_test_input_path)
print(f"Transform Test input file generated {transform_test_input_path}")
except shutil.SameFileError:
print(f"Source and destination are the same file: {input_file_path}")
except Exception as e:
raise e


def verify_input_template(input_file_path: Path) -> None:
Expand Down Expand Up @@ -99,7 +104,9 @@ def main() -> None:
verify_input_template(input_file_path)

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

generate_transform_test_output_files(transform_test_input_path, file_basename)

Expand Down
2 changes: 1 addition & 1 deletion bin/run_cfn_lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ ! -d "${VENV}" ]; then
python3 -m venv "${VENV}"
fi

"${VENV}/bin/python" -m pip install cfn-lint==0.75.0 --upgrade --quiet
"${VENV}/bin/python" -m pip install cfn-lint --upgrade --quiet
# update cfn schema
"${VENV}/bin/cfn-lint" -u
"${VENV}/bin/cfn-lint" --format parseable
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Resources:
Properties:
CodeUri: ${codeuri}
Handler: hello.handler
Runtime: python3.8
Runtime: python3.11
Policies:

- SQSPollerPolicy:
Expand Down Expand Up @@ -123,7 +123,7 @@ Resources:
Properties:
CodeUri: ${codeuri}
Handler: hello.handler
Runtime: python3.8
Runtime: python3.11
Policies:

- SESEmailTemplateCrudPolicy: {}
Expand Down Expand Up @@ -187,7 +187,7 @@ Resources:
Properties:
CodeUri: ${codeuri}
Handler: hello.handler
Runtime: python3.8
Runtime: python3.11
Policies:
- ElasticMapReduceModifyInstanceFleetPolicy:
ClusterId: name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Resources:
InlineCode: |
print("hello")
Handler: index.handler
Runtime: python3.8
Runtime: python3.11
Events:
API3:
Type: Api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
- arn:aws:iam::aws:policy/service-role/AWSLambdaRole
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaRole
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ Resources:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
- arn:aws:iam::aws:policy/service-role/AWSLambdaRole
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaRole
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Resources:
TriggerFunction:
Type: AWS::Serverless::Function
Properties:
Runtime: python3.8
Runtime: python3.11
Handler: index.handler
InlineCode: |
import boto3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Resources:
Role:
Fn::GetAtt: LambdaRole.Arn
Handler: lambda_function.lambda_handler
Runtime: python3.8
Runtime: python3.11
Timeout: 15
CodeUri: ${codeuri}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Resources:
Properties:
CodeUri: ${codeuri}
Handler: index.handler
Runtime: python3.8
Runtime: python3.11

AutoPublishAlias: Live

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Resources:
Properties:
CodeUri: ${codeuri}
Handler: index.handler
Runtime: python3.8
Runtime: python3.11

AutoPublishAlias: Live

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Resources:
Properties:
CodeUri: ${codeuri}
Handler: index.handler
Runtime: python3.8
Runtime: python3.11
AutoPublishAlias: Live
DeploymentPreference:
Type: Canary10Percent5Minutes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Resources:
Properties:
CodeUri: ${codeuri}
Handler: index.handler
Runtime: python3.8
Runtime: python3.11
AutoPublishAlias: Live

DeploymentRole:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: python3.8
Runtime: python3.11
InlineCode: |
def handler(event, context):
return {'body': 'Hello World!', 'statusCode': 200}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: python3.8
Runtime: python3.11
InlineCode: |
def handler(event, context):
return {'body': 'Hello World!', 'statusCode': 200}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: python3.8
Runtime: python3.11
InlineCode: |
def handler(event, context):
return {'body': 'Hello World!', 'statusCode': 200}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ Resources:
secretsmanager:GetSecretValue]
Effect: Allow
Resource: '*'
ManagedPolicyArns: [arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole]
ManagedPolicyArns:
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Tags:
- {Value: SAM, Key: lambda:createdBy}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ Resources:
logs:CreateLogStream, logs:PutLogEvents]
Effect: Allow
Resource: '*'
ManagedPolicyArns: [arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole]
ManagedPolicyArns:
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Tags:
- {Value: SAM, Key: lambda:createdBy}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ Resources:
logs:CreateLogStream, logs:PutLogEvents, s3:ListBucket]
Effect: Allow
Resource: '*'
ManagedPolicyArns: [arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole]
ManagedPolicyArns:
- !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
Tags:
- {Value: SAM, Key: lambda:createdBy}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Resources:
Properties:
CodeUri: ${codeuri}
Handler: hello.handler
Runtime: python3.8
Runtime: python3.11
Policies:
- SQSPollerPolicy:
QueueName:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Resources:
Properties:
CodeUri: ${codeuri}
Handler: hello.handler
Runtime: python3.8
Runtime: python3.11
AutoPublishAlias: Live

MyOtherFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ${codeuri}
Runtime: python3.8
Runtime: python3.11
Handler: hello.handler
Environment:
Variables:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: python3.8
Runtime: python3.11
InlineCode: |
def handler(event, context):
return {'body': 'Hello World!', 'statusCode': 200}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: python3.8
Runtime: python3.11
InlineCode: |
def handler(event, context):
return {'body': 'Hello World!', 'statusCode': 200}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Resources:
InlineCode: |
def handler(event, context):
print("Hello, world!")
Runtime: python3.8
Runtime: python3.11
Architectures:
- x86_64
Events:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Resources:
Properties:
CodeUri: ${codeuri}
Handler: hello.handler
Runtime: python3.8
Runtime: python3.11

MyQueue:
Type: AWS::SQS::Queue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: python3.8
Runtime: python3.11
AutoPublishAlias: live
InlineCode: |
import json
Expand All @@ -31,6 +31,6 @@ Resources:

Outputs:
ApiEndpoint:
Value: !Sub "https://${MyApi}.execute-api.${AWS::Region}.amazonaws.com/MyNewStageName"
Value: !Sub "https://${MyApi}.execute-api.${AWS::Region}.${AWS::URLSuffix}/MyNewStageName"
Metadata:
SamTransformTest: true
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: python3.8
Runtime: python3.11
AutoPublishAlias: live
InlineCode: |
def handler(event, context):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Resources:
Properties:
CodeUri: ${codeuri}
Handler: hello.handler
Runtime: python3.8
Runtime: python3.11
AutoPublishAlias: live
DeploymentPreference:
Type: Linear10PercentEvery3Minutes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Resources:
Properties:
CodeUri: ${codeuri}
Handler: hello.handler
Runtime: python3.8
Runtime: python3.11
RolePath: /foo/bar/
Metadata:
SamTransformTest: true
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ Resources:
print(event)
return "do nothing"
Handler: index.handler
Runtime: python3.8
Runtime: python3.11
Post:
Type: AWS::Serverless::StateMachine
Properties:
Policies:
- arn:aws:iam::aws:policy/AWSLambda_FullAccess
- !Sub arn:${AWS::Partition}:iam::aws:policy/AWSLambda_FullAccess
Definition:
StartAt: One
States:
Expand Down
2 changes: 1 addition & 1 deletion samtranslator/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.91.0"
__version__ = "1.92.0"
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ class ScheduleV2Event(BaseModel):
RuntimeManagementConfig = Optional[PassThroughProp] # TODO: check the type
LoggingConfig = Optional[PassThroughProp] # TODO: add documentation
RecursiveLoop = Optional[PassThroughProp]
SourceKMSKeyArn = Optional[PassThroughProp]


class Properties(BaseModel):
Expand Down Expand Up @@ -640,6 +641,7 @@ class Properties(BaseModel):
VpcConfig: Optional[VpcConfig] = prop("VpcConfig")
LoggingConfig: Optional[PassThroughProp] # TODO: add documentation
RecursiveLoop: Optional[PassThroughProp] # TODO: add documentation
SourceKMSKeyArn: Optional[PassThroughProp] # TODO: add documentation


class Globals(BaseModel):
Expand Down Expand Up @@ -699,6 +701,7 @@ class Globals(BaseModel):
RuntimeManagementConfig: Optional[RuntimeManagementConfig] = prop("RuntimeManagementConfig")
LoggingConfig: Optional[PassThroughProp] # TODO: add documentation
RecursiveLoop: Optional[PassThroughProp] # TODO: add documentation
SourceKMSKeyArn: Optional[PassThroughProp] # TODO: add documentation


class Resource(ResourceAttributes):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ class Properties(BaseModel):
Type: Optional[PassThroughProp] = properties("Type")
AutoPublishAlias: Optional[PassThroughProp]
DeploymentPreference: Optional[PassThroughProp]
UseAliasAsEventTarget: Optional[bool]


class Resource(ResourceAttributes):
Expand Down
Loading