Skip to content

Accept any SSM parameter and List types with warning for undocumented types#4361

Merged
kddejong merged 2 commits intoaws-cloudformation:mainfrom
kddejong:fix/parameter/types
Feb 23, 2026
Merged

Accept any SSM parameter and List types with warning for undocumented types#4361
kddejong merged 2 commits intoaws-cloudformation:mainfrom
kddejong:fix/parameter/types

Conversation

@kddejong
Copy link
Copy Markdown
Contributor

@kddejong kddejong commented Feb 5, 2026

CloudFormation accepts any AWS::SSM::Parameter::Value<> and List<> pattern but only validates specific documented types. Changed validation to accept all patterns instead of maintaining a hardcoded enum list.

Added W2002 warning rule to alert users when using parameter types that aren't officially documented by CloudFormation, as these won't be validated by CloudFormation.

Changes:

  • Modified parameter type schema to use anyOf with patterns
  • Created W2002 CfnLintKeyword rule for unsupported type warnings
  • Added comprehensive tests for new behavior

Fixes the need for PR #4359 and future similar requests.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kddejong kddejong force-pushed the fix/parameter/types branch from 643d0b5 to 451a763 Compare February 5, 2026 19:43
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.55%. Comparing base (0bbabc9) to head (f063ad2).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4361   +/-   ##
=======================================
  Coverage   93.54%   93.55%           
=======================================
  Files         418      421    +3     
  Lines       14145    14206   +61     
  Branches     2817     2823    +6     
=======================================
+ Hits        13232    13290   +58     
- Misses        567      568    +1     
- Partials      346      348    +2     
Flag Coverage Δ
unittests 93.53% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kddejong kddejong force-pushed the fix/parameter/types branch 2 times, most recently from 84bdf03 to 86ee527 Compare February 5, 2026 21:10
… types

CloudFormation accepts any AWS::SSM::Parameter::Value<*> and List<*>
pattern but only validates specific documented types. Changed validation
to accept all patterns instead of maintaining a hardcoded enum list.

Added W2002 warning rule to alert users when using parameter types that
aren't officially documented by CloudFormation, as these won't be
validated by CloudFormation.

Changes:
- Modified parameter type schema to use anyOf with patterns
- Created W2002 CfnLintKeyword rule for unsupported type warnings
- Added comprehensive tests for new behavior

Fixes the need for PR aws-cloudformation#4359 and future similar requests.
Moved Type validation from JSON schema to CfnLintKeyword rule to provide
a clean, readable error message instead of verbose anyOf schema failures.

The rule accepts documented types from VALID_PARAMETER_TYPES and also
accepts any AWS::SSM::Parameter::Value<*> or List<*> pattern (which
triggers W2002 warning for undocumented types).

Changes:
- Converted Types rule to CfnLintKeyword with custom validation
- Simplified schema to only check Type is a string
- Added comprehensive tests for E2002 rule
- Error message now shows sorted list of valid types
@kddejong kddejong force-pushed the fix/parameter/types branch from 8fea876 to f063ad2 Compare February 23, 2026 19:38
@kddejong kddejong merged commit 718a23a into aws-cloudformation:main Feb 23, 2026
20 checks passed
@kddejong kddejong deleted the fix/parameter/types branch February 23, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant