Skip to content

Commit 19f475e

Browse files
authored
Merge pull request #2807 from aws/release-v1.58.0
Release 1.58.0 (to main)
2 parents f7ec351 + 239d060 commit 19f475e

File tree

168 files changed

+6637
-3160
lines changed

Some content is hidden

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

168 files changed

+6637
-3160
lines changed

.cfnlintrc.yaml

Lines changed: 3 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -2,115 +2,47 @@ templates:
22
- tests/translator/output/**/*.json
33
ignore_templates:
44
- tests/translator/output/**/error_*.json # Fail by design
5-
- tests/translator/output/**/api_cache.json
6-
- tests/translator/output/**/api_description.json
7-
- tests/translator/output/**/api_endpoint_configuration.json
8-
- tests/translator/output/**/api_endpoint_configuration_with_vpcendpoint.json
95
- tests/translator/output/**/api_http_paths_with_if_condition.json
106
- tests/translator/output/**/api_http_paths_with_if_condition_no_value_else_case.json
117
- tests/translator/output/**/api_http_paths_with_if_condition_no_value_then_case.json
128
- tests/translator/output/**/api_http_with_default_iam_authorizer.json
13-
- tests/translator/output/**/api_request_model.json
14-
- tests/translator/output/**/api_request_model_openapi_3.json
15-
- tests/translator/output/**/api_request_model_with_validator.json
16-
- tests/translator/output/**/api_request_model_with_validator_openapi_3.json
179
- tests/translator/output/**/api_rest_paths_with_if_condition_openapi.json
1810
- tests/translator/output/**/api_rest_paths_with_if_condition_openapi_no_value_else_case.json
1911
- tests/translator/output/**/api_rest_paths_with_if_condition_openapi_no_value_then_case.json
2012
- tests/translator/output/**/api_rest_paths_with_if_condition_swagger.json
2113
- tests/translator/output/**/api_rest_paths_with_if_condition_swagger_no_value_else_case.json
2214
- tests/translator/output/**/api_rest_paths_with_if_condition_swagger_no_value_then_case.json
23-
- tests/translator/output/**/api_swagger_integration_with_ref_intrinsic_api_id.json
24-
- tests/translator/output/**/api_swagger_integration_with_string_api_id.json
25-
- tests/translator/output/**/api_with_access_log_setting.json
2615
- tests/translator/output/**/api_with_any_method_in_swagger.json
27-
- tests/translator/output/**/api_with_apikey_default_override.json
28-
- tests/translator/output/**/api_with_apikey_required.json
29-
- tests/translator/output/**/api_with_apikey_required_openapi_3.json
30-
- tests/translator/output/**/api_with_apikey_source.json
31-
- tests/translator/output/**/api_with_auth_all_maximum.json
32-
- tests/translator/output/**/api_with_auth_all_maximum_openapi_3.json
33-
- tests/translator/output/**/api_with_auth_all_minimum.json
34-
- tests/translator/output/**/api_with_auth_all_minimum_openapi.json
3516
- tests/translator/output/**/api_with_auth_and_conditions_all_max.json
36-
- tests/translator/output/**/api_with_auth_no_default.json
37-
- tests/translator/output/**/api_with_auth_with_default_scopes.json
38-
- tests/translator/output/**/api_with_auth_with_default_scopes_openapi.json
39-
- tests/translator/output/**/api_with_aws_account_blacklist.json
40-
- tests/translator/output/**/api_with_aws_account_whitelist.json
41-
- tests/translator/output/**/api_with_aws_iam_auth_overrides.json
4217
- tests/translator/output/**/api_with_basic_custom_domain.json
4318
- tests/translator/output/**/api_with_basic_custom_domain_http.json
4419
- tests/translator/output/**/api_with_basic_custom_domain_intrinsics.json
4520
- tests/translator/output/**/api_with_basic_custom_domain_intrinsics_http.json
4621
- tests/translator/output/**/api_with_binary_media_types.json
4722
- tests/translator/output/**/api_with_binary_media_types_definition_body.json
4823
- tests/translator/output/**/api_with_canary_setting.json
49-
- tests/translator/output/**/api_with_cors.json
50-
- tests/translator/output/**/api_with_cors_and_auth_no_preflight_auth.json
51-
- tests/translator/output/**/api_with_cors_and_auth_preflight_auth.json
5224
- tests/translator/output/**/api_with_cors_and_conditions_no_definitionbody.json
53-
- tests/translator/output/**/api_with_cors_and_only_credentials_false.json
54-
- tests/translator/output/**/api_with_cors_and_only_headers.json
55-
- tests/translator/output/**/api_with_cors_and_only_maxage.json
56-
- tests/translator/output/**/api_with_cors_and_only_methods.json
57-
- tests/translator/output/**/api_with_cors_and_only_origins.json
58-
- tests/translator/output/**/api_with_cors_no_definitionbody.json
59-
- tests/translator/output/**/api_with_cors_openapi_3.json
6025
- tests/translator/output/**/api_with_custom_base_path.json
6126
- tests/translator/output/**/api_with_custom_domain_route53.json
6227
- tests/translator/output/**/api_with_custom_domain_route53_hosted_zone_name.json
6328
- tests/translator/output/**/api_with_custom_domain_route53_hosted_zone_name_http.json
6429
- tests/translator/output/**/api_with_custom_domain_route53_http.json
6530
- tests/translator/output/**/api_with_custom_domain_route53_multiple_intrinsic_hostedzoneid.json
66-
- tests/translator/output/**/api_with_default_aws_iam_auth.json
67-
- tests/translator/output/**/api_with_default_aws_iam_auth_and_no_auth_route.json
68-
- tests/translator/output/**/api_with_disable_api_execute_endpoint.json
69-
- tests/translator/output/**/api_with_disable_api_execute_endpoint_openapi_3.json
70-
- tests/translator/output/**/api_with_fail_on_warnings.json
71-
- tests/translator/output/**/api_with_gateway_responses.json
72-
- tests/translator/output/**/api_with_gateway_responses_all.json
73-
- tests/translator/output/**/api_with_gateway_responses_all_openapi_3.json
74-
- tests/translator/output/**/api_with_gateway_responses_implicit.json
75-
- tests/translator/output/**/api_with_gateway_responses_minimal.json
76-
- tests/translator/output/**/api_with_gateway_responses_string_status_code.json
7731
- tests/translator/output/**/api_with_identity_intrinsic.json
7832
- tests/translator/output/**/api_with_if_conditional_with_resource_policy.json
79-
- tests/translator/output/**/api_with_incompatible_stage_name.json
80-
- tests/translator/output/**/api_with_ip_range_blacklist.json
81-
- tests/translator/output/**/api_with_ip_range_whitelist.json
82-
- tests/translator/output/**/api_with_method_aws_iam_auth.json
83-
- tests/translator/output/**/api_with_method_settings.json
84-
- tests/translator/output/**/api_with_minimum_compression_size.json
85-
- tests/translator/output/**/api_with_mode.json
86-
- tests/translator/output/**/api_with_open_api_version.json
87-
- tests/translator/output/**/api_with_open_api_version_2.json
88-
- tests/translator/output/**/api_with_openapi_definition_body_no_flag.json
89-
- tests/translator/output/**/api_with_path_parameters.json
90-
- tests/translator/output/**/api_with_resource_policy.json
9133
- tests/translator/output/**/api_with_resource_policy_global.json
92-
- tests/translator/output/**/api_with_resource_policy_global_implicit.json
93-
- tests/translator/output/**/api_with_resource_refs.json
94-
- tests/translator/output/**/api_with_security_definition_and_components.json
95-
- tests/translator/output/**/api_with_security_definition_and_no_components.json
9634
- tests/translator/output/**/api_with_security_definition_and_none_components.json
97-
- tests/translator/output/**/api_with_source_vpc_blacklist.json
9835
- tests/translator/output/**/api_with_source_vpc_whitelist.json
99-
- tests/translator/output/**/api_with_swagger_and_openapi_with_auth.json
100-
- tests/translator/output/**/api_with_swagger_authorizer_none.json
10136
- tests/translator/output/**/api_with_usageplans.json
10237
- tests/translator/output/**/api_with_usageplans_intrinsics.json
10338
- tests/translator/output/**/api_with_usageplans_shared_attributes_three.json
10439
- tests/translator/output/**/api_with_usageplans_shared_attributes_two.json
10540
- tests/translator/output/**/api_with_usageplans_shared_no_side_effect_1.json
10641
- tests/translator/output/**/api_with_usageplans_shared_no_side_effect_2.json
107-
- tests/translator/output/**/api_with_xray_tracing.json
10842
- tests/translator/output/**/application_with_intrinsics.json
10943
- tests/translator/output/**/basic_function_withimageuri.json
11044
- tests/translator/output/**/basic_layer.json
111-
- tests/translator/output/**/cloudwatch_logs_with_ref.json
11245
- tests/translator/output/**/cloudwatchevent_intrinsics.json
113-
- tests/translator/output/**/cloudwatchlog.json
11446
- tests/translator/output/**/congito_userpool_with_sms_configuration.json
11547
- tests/translator/output/**/connector_bucket_to_function.json
11648
- tests/translator/output/**/connector_dependson_replace.json
@@ -125,14 +57,9 @@ ignore_templates:
12557
- tests/translator/output/**/connector_sfn_to_function.json
12658
- tests/translator/output/**/connector_sns_to_function.json
12759
- tests/translator/output/**/connector_table_to_function.json
128-
- tests/translator/output/**/depends_on.json
12960
- tests/translator/output/**/eventbridgerule_with_dlq.json
130-
- tests/translator/output/**/explicit_api.json
131-
- tests/translator/output/**/explicit_api_openapi_3.json
132-
- tests/translator/output/**/explicit_api_with_invalid_events_config.json
13361
- tests/translator/output/**/function_event_conditions.json
13462
- tests/translator/output/**/function_with_alias_and_code_sha256.json
135-
- tests/translator/output/**/function_with_alias_and_event_sources.json
13663
- tests/translator/output/**/function_with_alias_intrinsics.json
13764
- tests/translator/output/**/function_with_condition.json
13865
- tests/translator/output/**/function_with_conditional_managed_policy.json
@@ -149,7 +76,6 @@ ignore_templates:
14976
- tests/translator/output/**/function_with_deployment_preference_multiple_combinations_conditions_with_passthrough.json
15077
- tests/translator/output/**/function_with_deployment_preference_multiple_combinations_conditions_without_passthrough.json
15178
- tests/translator/output/**/function_with_deployment_preference_passthrough_condition_with_supported_intrinsics.json
152-
- tests/translator/output/**/function_with_disabled_traffic_hook.json
15379
- tests/translator/output/**/function_with_dlq.json
15480
- tests/translator/output/**/function_with_event_dest.json
15581
- tests/translator/output/**/function_with_event_dest_basic.json
@@ -160,53 +86,38 @@ ignore_templates:
16086
- tests/translator/output/**/function_with_globals_role_path.json
16187
- tests/translator/output/**/function_with_intrinsic_architecture.json
16288
- tests/translator/output/**/function_with_kmskeyarn.json
163-
- tests/translator/output/**/function_with_many_layers.json
164-
- tests/translator/output/**/function_with_msk.json
165-
- tests/translator/output/**/function_with_request_parameters.json
16689
- tests/translator/output/**/function_with_resource_refs.json
16790
- tests/translator/output/**/function_with_role_and_role_path.json
16891
- tests/translator/output/**/function_with_role_path.json
169-
- tests/translator/output/**/global_handle_path_level_parameter.json
170-
- tests/translator/output/**/globals_for_api.json
17192
- tests/translator/output/**/http_api_custom_iam_auth.json
17293
- tests/translator/output/**/http_api_existing_openapi.json
17394
- tests/translator/output/**/http_api_existing_openapi_conditions.json
17495
- tests/translator/output/**/http_api_explicit_stage.json
17596
- tests/translator/output/**/http_api_global_iam_auth_enabled.json
176-
- tests/translator/output/**/http_api_lambda_auth.json
177-
- tests/translator/output/**/http_api_lambda_auth_full.json
17897
- tests/translator/output/**/http_api_local_iam_auth_enabled.json
179-
- tests/translator/output/**/http_api_multiple_authorizers.json
18098
- tests/translator/output/**/http_api_with_cors.json
18199
- tests/translator/output/**/implicit_and_explicit_api_with_conditions.json
182-
- tests/translator/output/**/implicit_api.json
183-
- tests/translator/output/**/implicit_api_deletion_policy_precedence.json
184100
- tests/translator/output/**/implicit_api_with_auth_and_conditions_max.json
185101
- tests/translator/output/**/implicit_api_with_many_conditions.json
186-
- tests/translator/output/**/implicit_api_with_serverless_rest_api_resource.json
187102
- tests/translator/output/**/implicit_http_api_with_many_conditions.json
188103
- tests/translator/output/**/intrinsic_functions.json
189-
- tests/translator/output/**/iot_rule.json
190104
- tests/translator/output/**/kinesis_intrinsics.json
191105
- tests/translator/output/**/layers_all_properties.json
192106
- tests/translator/output/**/layers_with_intrinsics.json
193-
- tests/translator/output/**/no_implicit_api_with_serverless_rest_api_resource.json
194107
- tests/translator/output/**/s3_create_remove.json
195108
- tests/translator/output/**/s3_intrinsics.json
196109
- tests/translator/output/**/schema_validation_1.json
197110
- tests/translator/output/**/self_managed_kafka_with_intrinsics.json
198-
- tests/translator/output/**/state_machine_with_api_authorizer.json
199-
- tests/translator/output/**/state_machine_with_api_authorizer_maximum.json
111+
- tests/translator/output/**/sqs_with_scaling_config.json # Invalid Property Resources/SQSFunctionMySqsQueue/Properties/ScalingConfig
200112
- tests/translator/output/**/state_machine_with_condition.json
201113
- tests/translator/output/**/state_machine_with_condition_and_events.json
202114
- tests/translator/output/**/state_machine_with_eb_dlq_target_id.json
203115
- tests/translator/output/**/state_machine_with_event_schedule_state.json
204116
- tests/translator/output/**/state_machine_with_schedule.json
205117
- tests/translator/output/**/state_machine_with_schedule_dlq_retry_policy.json
118+
- tests/translator/output/**/globals_for_function.json # RuntimeManagementConfig
119+
- tests/translator/output/**/function_with_runtime_config.json # RuntimeManagementConfig
206120
ignore_checks:
207121
- E2531 # Deprecated runtime; not relevant for transform tests
208122
- W2531 # EOL runtime; not relevant for transform tests
209123
- E3001 # Invalid or unsupported Type; common in transform tests since they focus on SAM resources
210-
include_checks:
211-
# Informational rules not enabled by default: https://github.com/aws-cloudformation/cfn-lint/blob/7219faeabe48063e68e1a3e63f0301c5b337d36e/README.md#info-rules
212-
- I3042 # Hardcoded ARN partition/account

DEVELOPMENT_GUIDE.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Environment setup
2626
-----------------
2727
### 1. Install Python versions
2828

29-
Our officially supported Python versions are 3.6, 3.7 and 3.8.
29+
Our officially supported Python versions are 3.7, 3.8, 3.9 and 3.10.
3030
Our CI/CD pipeline is setup to run unit tests against Python 3 versions. Make sure you test it before sending a Pull Request.
3131
See [Unit testing with multiple Python versions](#unit-testing-with-multiple-python-versions).
3232

@@ -40,11 +40,12 @@ easily setup multiple Python versions. For
4040
1. Install PyEnv -
4141
`curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash`
4242
1. Restart shell so the path changes take effect - `exec $SHELL`
43-
1. `pyenv install 3.6.12`
44-
1. `pyenv install 3.7.9`
45-
1. `pyenv install 3.8.6`
46-
1. Make Python versions available in the project:
47-
`pyenv local 3.6.12 3.7.9 3.8.6`
43+
1. `pyenv install 3.7.16`
44+
1. `pyenv install 3.8.16`
45+
1. `pyenv install 3.9.16`
46+
1. `pyenv install 3.10.9`
47+
3. Make Python versions available in the project:
48+
`pyenv local 3.7.16 3.8.16 3.9.16 3.10.9`
4849

4950
Note: also make sure the following lines were written into your `.bashrc` (or `.zshrc`, depending on which shell you are using):
5051
```
@@ -120,10 +121,10 @@ Run `make test` or `make test-fast`. Once all tests pass make sure to run
120121

121122
### Unit testing with multiple Python versions
122123

123-
Currently, our officially supported Python versions are 3.6, 3.7 and 3.8. For the most
124-
part, code that works in Python3.6 will work in Python3.7 and Python3.8. You only run into problems if you are
125-
trying to use features released in a higher version (for example features introduced into Python3.7
126-
will not work in Python3.6). If you want to test in many versions, you can create a virtualenv for
124+
Currently, our officially supported Python versions are 3.7, 3.8, 3.9 and 3.10. For the most
125+
part, code that works in Python3.7 will work in Pythons 3.8, 3.9 and 3.10. You only run into problems if you are
126+
trying to use features released in a higher version (for example features introduced into Python3.10
127+
will not work in Python3.9). If you want to test in many versions, you can create a virtualenv for
127128
each version and flip between them (sourcing the activate script). Typically, we run all tests in
128129
one python version locally and then have our ci (appveyor) run all supported versions.
129130

@@ -158,7 +159,7 @@ Integration tests are covered in detail in the [INTEGRATION_TESTS.md file](INTEG
158159
## Development guidelines
159160

160161
1. **Do not resolve [intrinsic functions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html).** Adding [`AWS::LanguageExtensions`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-languageextension-transform.html) before the `AWS::Serverless-2016-10-31` transform resolves most of them (see https://github.com/aws/serverless-application-model/issues/2533). For new properties, use [`Property`](https://github.com/aws/serverless-application-model/blob/c5830b63857f52e540fec13b29f029458edc539a/samtranslator/model/__init__.py#L36-L45) or [`PassThroughProperty`](https://github.com/aws/serverless-application-model/blob/dd79f535500158baa8e367f081d6a12113497e45/samtranslator/model/__init__.py#L48-L56) instead of [`PropertyType`](https://github.com/aws/serverless-application-model/blob/c39c2807bbf327255de8abed8b8150b18c60f053/samtranslator/model/__init__.py#L13-L33).
161-
2. **Do not break backward compatibility.** As rule of thumb, a specific SAM template should always transform into the same CloudFormation template. Do not change logical IDs. Add opt-in properties for breaking changes. There are some exceptions, such as changes that do not impact resources (e.g. [`Metadata`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html)) or abstractions that can by design change over time.
162+
2. **Do not break backward compatibility.** A specific SAM template should always transform into the same CloudFormation template. A template that has previously deployed successfully should continue to do so. Do not change logical IDs. Add opt-in properties for breaking changes. There are some exceptions, such as changes that do not impact resources (e.g. [`Metadata`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html)) or abstractions that can by design change over time.
162163
3. **Stick as close as possible to the underlying CloudFormation properties.** This includes both property names and values. This ensures we can pass values to CloudFormation and let it handle any intrinsic functions. In some cases, it also allows us to pass all properties as-is to a resource, which means customers can always use the newest properties, and we don’t spend effort maintaining a duplicate set of properties.
163164
4. **Only validate what’s necessary.** Do not validate properties if they’re passed directly to the underlying CloudFormation resource.
164165
5. **Add [type hints](https://peps.python.org/pep-0484/) to new code.** Strict typing was enabled in https://github.com/aws/serverless-application-model/pull/2558 by sprinkling [`# type: ignore`](https://peps.python.org/pep-0484/#compatibility-with-other-uses-of-function-annotations) across the existing code. Don't do that for new code. Avoid `# type: ignore`s at all cost. Instead, add types to new functions, and ideally add types to existing code it uses as well.

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ integ-test:
1919

2020
black:
2121
black setup.py samtranslator/* tests/* integration/* bin/*.py
22-
bin/json-format.py --write tests integration
22+
bin/json-format.py --write tests integration samtranslator/policy_templates_data
2323
bin/yaml-format.py --write tests
2424
bin/yaml-format.py --write integration --add-test-metadata
2525

@@ -29,7 +29,7 @@ black-check:
2929
diff -u samtranslator/schema/schema.json .tmp_schema.json
3030
rm .tmp_schema.json
3131
black --check setup.py samtranslator/* tests/* integration/* bin/*.py
32-
bin/json-format.py --check tests integration
32+
bin/json-format.py --check tests integration samtranslator/policy_templates_data
3333
bin/yaml-format.py --check tests
3434
bin/yaml-format.py --check integration --add-test-metadata
3535

@@ -38,6 +38,8 @@ lint:
3838
mypy --strict samtranslator bin
3939
# Linter performs static analysis to catch latent bugs
4040
pylint --rcfile .pylintrc samtranslator
41+
# cfn-lint to make sure generated CloudFormation makes sense
42+
bin/run_cfn_lint.sh
4143

4244
prepare-companion-stack:
4345
pytest -v --no-cov integration/setup -m setup

0 commit comments

Comments
 (0)