-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
CFn: Improve parameter value validation #13124
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
Conversation
Test Results - Preflight, Unit22 124 tests ±0 20 386 ✅ ±0 6m 45s ⏱️ +13s Results for commit 1df46cc3. ± Comparison against base commit aa8c1ba. ♻️ This comment has been updated with latest results. |
Test Results (amd64) - Acceptance7 tests ±0 5 ✅ ±0 3m 8s ⏱️ -8s Results for commit 1df46cc3. ± Comparison against base commit aa8c1ba. ♻️ This comment has been updated with latest results. |
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 34m 49s ⏱️ - 1h 23m 41s Results for commit 1df46cc3. ± Comparison against base commit aa8c1ba. This pull request removes 4097 and adds 1 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 47m 19s ⏱️ Results for commit 1df46cc3. ♻️ This comment has been updated with latest results. |
Test Results - Alternative Providers558 tests 329 ✅ 23m 33s ⏱️ Results for commit 1df46cc3. ♻️ This comment has been updated with latest results. |
650d49f to
1df46cc
Compare
| res = aws_client.cloudformation.create_stack( | ||
| TemplateBody=json.dumps(template), | ||
| StackName=f"stack-{short_uid()}", | ||
| Parameters=[{"ParameterKey": "MyFoo", "ParameterValue": ""}], | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL: This is valid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup on AWS it's only rejected by the AWS resource provider, not the CFn engine. I think it's quite often used as a condition for sort of the False value (i.e.
Conditions:
Foo:
Fn::Equals:
- !Ref: MyParameter
- ""
Motivation
While investigating user errors with the new CloudFormation engine, I saw some examples of
This is raised because of our parameter value detection. When the user provides a falsy value (like the empty string) to a parameter, we incorreclty skip over this "given value" (since it's falsey) and try to load the default value. If this is also not present then we raise this exception.
Changes
Nonefrom everything else)