Skip to content

Commit aaf4329

Browse files
authored
Release 1.61.0 (to main) #3011
Release 1.61.0 (to main)
2 parents 1b96427 + d173c29 commit aaf4329

File tree

147 files changed

+34659
-8613
lines changed

Some content is hidden

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

147 files changed

+34659
-8613
lines changed

.cfnlintrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ ignore_templates:
120120
- tests/translator/output/**/state_machine_with_schedule_dlq_retry_policy.json
121121
- tests/translator/output/**/globals_for_function.json # RuntimeManagementConfig
122122
- tests/translator/output/**/function_with_runtime_config.json # RuntimeManagementConfig
123+
- tests/translator/output/**/managed_policies_minimal.json # Intentionally has non-existent managed policy name
123124
ignore_checks:
124125
- E2531 # Deprecated runtime; not relevant for transform tests
125126
- W2531 # EOL runtime; not relevant for transform tests

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ branch = True
33
omit =
44
# Schema tested by `make check-black`
55
samtranslator/schema/*
6+
samtranslator/internal/schema_source/*
67
[report]
78
exclude_lines =
89
pragma: no cover

DEVELOPMENT_GUIDE.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,16 @@ Integration tests are covered in detail in the [INTEGRATION_TESTS.md file](INTEG
158158

159159
## Development guidelines
160160

161-
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+
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).
162162
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.
163163
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.
164164
4. **Only validate what’s necessary.** Do not validate properties if they’re passed directly to the underlying CloudFormation resource.
165165
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.
166+
6. **Do not use [`PropertyType`](https://github.com/aws/serverless-application-model/blob/c39c2807bbf327255de8abed8b8150b18c60f053/samtranslator/model/__init__.py#L13-L33) for new [`Resource`](https://github.com/aws/serverless-application-model/blob/13604cd2d9671cd6e774e5bfd610a03d82a08d76/samtranslator/model/__init__.py#L68) properties.**
167+
168+
For new properties of SAM resources, 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). This avoids [sneaky bugs](https://github.com/aws/serverless-application-model/pull/2495#discussion_r976715242) and ensures valid templates do not cause transform failures.
169+
170+
For new properties of CloudFormation resources, use [`GeneratedProperty`](https://github.com/aws/serverless-application-model/blob/79452f69bc1fcf918b8625c2f9005c74ab874801/samtranslator/model/__init__.py#L74-L82). It performs no runtime validation, reducing the risk of valid values causing transform failures.
166171

167172
Code conventions
168173
----------------

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ recursive-include samtranslator/validator/sam_schema *.json
88
include samtranslator/policy_templates_data/policy_templates.json
99
include samtranslator/policy_templates_data/schema.json
1010
include samtranslator/model/connector_profiles/profiles.json
11+
include samtranslator/internal/data/aws_managed_policies.json
12+
include samtranslator/internal/schema_source/sam-docs.json
1113
include README.md
1214
include THIRD_PARTY_LICENSES
1315

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ black:
2626
black-check:
2727
# Checking latest schema was generated (run `make schema` if this fails)
2828
mkdir -p .tmp
29-
python -m schema_source.schema --sam-schema .tmp/sam.schema.json --cfn-schema schema_source/cloudformation.schema.json --unified-schema .tmp/schema.json
29+
python -m samtranslator.internal.schema_source.schema --sam-schema .tmp/sam.schema.json --cfn-schema schema_source/cloudformation.schema.json --unified-schema .tmp/schema.json
3030
diff -u schema_source/sam.schema.json .tmp/sam.schema.json
3131
diff -u samtranslator/schema/schema.json .tmp/schema.json
3232
black --check setup.py samtranslator tests integration bin schema_source
@@ -60,14 +60,14 @@ fetch-schema-data:
6060

6161
update-schema-data:
6262
# Parse docs
63-
bin/parse_docs.py .tmp/aws-sam-developer-guide/doc_source > schema_source/docs.json
63+
bin/parse_docs.py .tmp/aws-sam-developer-guide/doc_source > samtranslator/internal/schema_source/sam-docs.json
6464
bin/parse_docs.py --cfn .tmp/aws-cloudformation-user-guide/doc_source > schema_source/cloudformation-docs.json
6565

6666
# Add CloudFormation docs to CloudFormation schema
6767
python bin/add_docs_cfn_schema.py --schema .tmp/cloudformation.schema.json --docs schema_source/cloudformation-docs.json > schema_source/cloudformation.schema.json
6868

6969
schema:
70-
python -m schema_source.schema --sam-schema schema_source/sam.schema.json --cfn-schema schema_source/cloudformation.schema.json --unified-schema samtranslator/schema/schema.json
70+
python -m samtranslator.internal.schema_source.schema --sam-schema schema_source/sam.schema.json --cfn-schema schema_source/cloudformation.schema.json --unified-schema samtranslator/schema/schema.json
7171

7272
# Update all schema data and schemas
7373
schema-all: fetch-schema-data update-schema-data schema

bin/parse_docs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ def main() -> None:
8989
if args.cfn and not re.match(r"^\w+::\w+::\w+( \w+)?$", title):
9090
continue
9191
page = title if args.cfn else path.stem
92-
for name, description in parse(text):
92+
for name, raw_description in parse(text):
9393
if page not in props:
9494
props[page] = {}
95-
description = remove_first_line(description) # Remove property name; already in the schema title
95+
description = remove_first_line(raw_description) # Remove property name; already in the schema title
9696
description = fix_markdown_code_link(description)
9797
prefix = (
9898
"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/"

bin/sam-translate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def transform_template(input_file_path, output_file_path): # type: ignore[no-un
106106
sam_template = yaml_parse(f) # type: ignore[no-untyped-call]
107107

108108
try:
109-
cloud_formation_template = transform(sam_template, {}, ManagedPolicyLoader(iam_client)) # type: ignore[no-untyped-call]
109+
cloud_formation_template = transform(sam_template, {}, ManagedPolicyLoader(iam_client))
110110
cloud_formation_template_prettified = json.dumps(cloud_formation_template, indent=1)
111111

112112
with open(output_file_path, "w") as f:

docs/globals.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Currently, the following resources and properties are being supported:
8181
Auth:
8282
Name:
8383
DefinitionUri:
84+
MergeDefinitions:
8485
CacheClusterEnabled:
8586
CacheClusterSize:
8687
Variables:

integration/combination/test_connectors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def tearDown(self):
2626

2727
@parameterized.expand(
2828
[
29+
("combination/connector_appsync_to_table",),
2930
("combination/connector_function_to_function",),
3031
("combination/connector_restapi_to_function",),
3132
("combination/connector_httpapi_to_function",),

integration/config/service_names.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@
3535
EVENT_INVOKE_CONFIG = "EventInvokeConfig"
3636
EPHEMERAL_STORAGE = "EphemeralStorage"
3737
API_KEY = "ApiKey"
38+
APP_SYNC = "AppSync"

0 commit comments

Comments
 (0)