Skip to content

Commit ecac7fb

Browse files
authored
Merge branch 'develop' into patch-2
2 parents 3216a1b + 2959621 commit ecac7fb

File tree

177 files changed

+16368
-1060
lines changed

Some content is hidden

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

177 files changed

+16368
-1060
lines changed

.cfnlintrc.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ ignore_templates:
144144
- tests/translator/output/**/function_with_metrics_config.json
145145
- tests/translator/output/**/function_with_self_managed_kafka_and_schema_registry.json # cfnlint is not updated to recognize the SchemaRegistryConfig property
146146
- tests/translator/output/**/function_with_msk_with_schema_registry_config.json # cfnlint is not updated to recognize the SchemaRegistryConfig property
147+
- tests/translator/output/**/*capacity_provider*.json # TODO: Remove this once CFN updates
148+
- tests/translator/output/**/function_with_tenancy_config.json # cfnlint is not updated to recognize the TenancyConfig property
149+
- tests/translator/output/**/function_with_tenancy_and_api_event.json # cfnlint is not updated to recognize the TenancyConfig property
150+
- tests/translator/output/**/function_with_tenancy_and_httpapi_event.json # cfnlint is not updated to recognize the TenancyConfig property
151+
- tests/translator/output/**/function_with_tenancy_config_global.json # cfnlint is not updated to recognize the TenancyConfig property
152+
- tests/translator/output/**/*durable_config*.json # TODO: Remove this once Durable Function is launched in CFN
147153

148154
ignore_checks:
149155
- E2531 # Deprecated runtime; not relevant for transform tests

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
### Checklist
88

9+
- [ ] Review the [generative AI contribution guidelines](https://github.com/aws/serverless-application-model/blob/develop/CONTRIBUTING.md#ai-usage)
910
- [ ] Adheres to the [development guidelines](https://github.com/aws/serverless-application-model/blob/develop/DEVELOPMENT_GUIDE.md#development-guidelines)
1011
- [ ] Add/update [transform tests](https://github.com/aws/serverless-application-model/blob/develop/DEVELOPMENT_GUIDE.md#unit-testing-with-multiple-python-versions)
1112
- [ ] Using correct values

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ transparent and open process for evolving AWS SAM.
77

88
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary information to effectively respond to your bug report or contribution.
99

10+
## AI Usage
11+
12+
While using generative AI is allowed when contributing to this project, please keep the following points in mind:
13+
14+
* Review all code yourself before you submit it.
15+
* Understand all the code you have submitted in order to answer any questions the maintainers could have when reviewing your PR.
16+
* Avoid being overly verbose in code and testing - extra code can be hard to review.
17+
* For example, avoid writing unit tests that duplicate existing ones, or test libraries that you're using.
18+
* Keep PR descriptions, comments, and follow ups concise.
19+
* Ensure AI-generated code meets the same quality standards as human-written code.
20+
1021
## Integrating AWS SAM into your tool
1122

1223
We encourage you to modify SAM to integrate it with other frameworks and deployment providers from the community for building serverless applications. If you're building a new tool that will use AWS SAM, let us know how we can help!

integration/combination/test_function_with_msk.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,20 @@ def test_function_with_msk_trigger_and_s3_onfailure_events_destinations(self):
4141
"combination/function_with_msk_trigger_and_s3_onfailure_events_destinations", parameters
4242
)
4343

44-
def test_function_with_msk_trigger_and_confluent_schema_registry(self):
44+
def test_function_with_msk_trigger_and_premium_features(self):
4545
companion_stack_outputs = self.companion_stack_outputs
4646
parameters = self.get_parameters(companion_stack_outputs)
4747
cluster_name = "MskCluster4-" + generate_suffix()
4848
parameters.append(self.generate_parameter("MskClusterName4", cluster_name))
49-
self._common_validations_for_MSK(
49+
self._common_validations_for_MSK("combination/function_with_msk_trigger_and_premium_features", parameters)
50+
event_source_mapping_result = self._common_validations_for_MSK(
5051
"combination/function_with_msk_trigger_and_confluent_schema_registry", parameters
5152
)
53+
# Verify error handling properties are correctly set
54+
self.assertTrue(event_source_mapping_result.get("BisectBatchOnFunctionError"))
55+
self.assertEqual(event_source_mapping_result.get("MaximumRecordAgeInSeconds"), 3600)
56+
self.assertEqual(event_source_mapping_result.get("MaximumRetryAttempts"), 3)
57+
self.assertEqual(event_source_mapping_result.get("FunctionResponseTypes"), ["ReportBatchItemFailures"])
5258

5359
def _common_validations_for_MSK(self, file_name, parameters):
5460
self.create_and_verify_stack(file_name, parameters)
@@ -74,6 +80,7 @@ def _common_validations_for_MSK(self, file_name, parameters):
7480

7581
self.assertEqual(event_source_mapping_function_arn, lambda_function_arn)
7682
self.assertEqual(event_source_mapping_kafka_cluster_arn, msk_cluster_arn)
83+
return event_source_mapping_result
7784

7885
def get_parameters(self, dictionary):
7986
parameters = []

integration/combination/test_function_with_self_managed_kafka.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class TestFunctionWithSelfManagedKafka(BaseTest):
1616
@pytest.mark.flaky(reruns=5)
1717
@parameterized.expand(
1818
[
19-
"combination/function_with_self_managed_kafka",
2019
"combination/function_with_self_managed_kafka_intrinsics",
2120
]
2221
)
@@ -30,3 +29,29 @@ def test_function_with_self_managed_kafka(self, file_name):
3029
event_source_mapping_result = lambda_client.get_event_source_mapping(UUID=event_source_mapping_id)
3130
event_source_mapping_function_arn = event_source_mapping_result["FunctionArn"]
3231
self.assertEqual(event_source_mapping_function_arn, lambda_function_arn)
32+
33+
@parameterized.expand(["combination/function_with_self_managed_kafka"])
34+
def test_function_with_self_managed_kafka_with_provisioned_mode(self, file_name):
35+
self.create_and_verify_stack(file_name)
36+
# Get the notification configuration and make sure Lambda Function connection is added
37+
lambda_client = self.client_provider.lambda_client
38+
function_name = self.get_physical_id_by_type("AWS::Lambda::Function")
39+
lambda_function_arn = lambda_client.get_function_configuration(FunctionName=function_name)["FunctionArn"]
40+
event_source_mapping_id = self.get_physical_id_by_type("AWS::Lambda::EventSourceMapping")
41+
event_source_mapping_result = lambda_client.get_event_source_mapping(UUID=event_source_mapping_id)
42+
event_source_mapping_function_arn = event_source_mapping_result["FunctionArn"]
43+
self.assertEqual(event_source_mapping_function_arn, lambda_function_arn)
44+
45+
# Verify error handling properties are correctly set
46+
self.assertTrue(event_source_mapping_result.get("BisectBatchOnFunctionError"))
47+
self.assertEqual(event_source_mapping_result.get("MaximumRecordAgeInSeconds"), 3600)
48+
self.assertEqual(event_source_mapping_result.get("MaximumRetryAttempts"), 3)
49+
self.assertEqual(event_source_mapping_result.get("FunctionResponseTypes"), ["ReportBatchItemFailures"])
50+
# Uncomment this once SDK is updated.
51+
# provisioned_poller_config = event_source_mapping_result["ProvisionedPollerConfig"]
52+
# actual_poller_group_name = provisioned_poller_config["PollerGroupName"]
53+
# self.assertEqual(
54+
# actual_poller_group_name,
55+
# "test1",
56+
# f"Expected PollerGroupName to be 'test1' but got '{actual_poller_group_name}'",
57+
# )
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
{
3+
"LogicalResourceId": "MyApi",
4+
"ResourceType": "AWS::ApiGateway::RestApi"
5+
},
6+
{
7+
"LogicalResourceId": "MyApiDeployment",
8+
"ResourceType": "AWS::ApiGateway::Deployment"
9+
},
10+
{
11+
"LogicalResourceId": "MyApiProdStage",
12+
"ResourceType": "AWS::ApiGateway::Stage"
13+
},
14+
{
15+
"LogicalResourceId": "ApiGatewayDomainName",
16+
"ResourceType": "AWS::ApiGateway::DomainName"
17+
},
18+
{
19+
"LogicalResourceId": "MyApiBasePathMapping",
20+
"ResourceType": "AWS::ApiGateway::BasePathMapping"
21+
}
22+
]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{
3+
"LogicalResourceId": "MyApi",
4+
"ResourceType": "AWS::ApiGateway::RestApi"
5+
},
6+
{
7+
"LogicalResourceId": "MyApiDeployment",
8+
"ResourceType": "AWS::ApiGateway::Deployment"
9+
},
10+
{
11+
"LogicalResourceId": "MyApiProdStage",
12+
"ResourceType": "AWS::ApiGateway::Stage"
13+
}
14+
]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"LogicalResourceId": "MyLambdaFunction",
4+
"ResourceType": "AWS::Lambda::Function"
5+
},
6+
{
7+
"LogicalResourceId": "MyLambdaFunctionRole",
8+
"ResourceType": "AWS::IAM::Role"
9+
}
10+
]

integration/resources/templates/combination/api_with_authorizer_override_api_auth.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ Resources:
5151
Type: AWS::Serverless::Function
5252
Properties:
5353
InlineCode: |
54-
exports.handler = async (event, context, callback) => {
54+
exports.handler = async (event, context) => {
5555
return {
5656
statusCode: 200,
5757
body: 'Success'
5858
}
5959
}
6060
Handler: index.handler
61-
Runtime: nodejs16.x
61+
Runtime: nodejs22.x
6262
Events:
6363
LambdaRequest:
6464
Type: Api
@@ -94,9 +94,9 @@ Resources:
9494
Type: AWS::Serverless::Function
9595
Properties:
9696
Handler: index.handler
97-
Runtime: nodejs16.x
97+
Runtime: nodejs22.x
9898
InlineCode: |
99-
exports.handler = async (event, context, callback) => {
99+
exports.handler = async (event, context) => {
100100
const auth = event.queryStringParameters.authorization
101101
const policyDocument = {
102102
Version: '2012-10-17',

0 commit comments

Comments
 (0)