Skip to content

fix(scripts): only collect orderable options for available RDS versions - #4946

Merged
kddejong merged 3 commits into
aws-cloudformation:mainfrom
kddejong:fix/rds-orderable-options-cev
Oct 27, 2026
Merged

kddejong merged 3 commits into
aws-cloudformation:mainfrom
kddejong:fix/rds-orderable-options-cev

Conversation

@kddejong

@kddejong kddejong commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

scripts/update_schemas_from_aws_api.py has aborted on every scheduled run since 2026-10-22:

INFO - Starting RDS DB options collection for engine 'sqlserver-dev-ee'
...
  File "scripts/update_schemas_from_aws_api.py", line 452, in rds_api
    for page in rds_client.get_paginator(
        "describe_orderable_db_instance_options"
    ).paginate(Engine=engine, EngineVersion=engine_version):
botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the
DescribeOrderableDBInstanceOptions operation: A custom engine version is required for SQL Server
engine sqlserver-dev-ee. Create a custom engine version for the template version 15.00.4455.2.v1

Root cause

DescribeDBEngineVersions already labels these versions. It returns a Status field, and
rds_api() branches on only one of its values:

status = version.get("Status", "available")

if status == "deprecated":
    ...deprecated_results...
else:
    # Track available versions for DB instance options
    ...available_results...

The else is the bug. Anything that is not deprecated is treated as available and enrolled in
available_results, which is what drives the second loop's DescribeOrderableDBInstanceOptions
calls. A third status exists, and it means precisely "you cannot enumerate this without creating a
CEV first".

Measured across all 23 engines in _ENGINE_SUPPORTED, us-east-1, 2026-10-27 — every value
DescribeDBEngineVersions returned, with IncludeAll=True:

Status versions
available 691
deprecated 659
requires-custom-engine-version 18

Only three statuses exist. The 18 are exactly sqlserver-dev-ee (13) and sqlserver-dev-se (5) —
the two engines that fail, and nothing else.

This branch has always swallowed a non-deprecated status; it became an abort when #4830
(9cb4896, fixes #4822) added neptune, sqlserver-dev-ee and sqlserver-dev-se to
_ENGINE_SUPPORTED so E3690/E3691 would stop rejecting engines CloudFormation accepts. That list
does double duty — it filters the version enums and feeds the orderable-options loop — so the
addition enrolled two engines in a call that cannot serve them. There is no Fixes # line because
no issue was filed.

Corroborating: sqlserver-dev-ee is absent from
src/cfnlint/data/schemas/extensions/aws_rds_dbinstance/db_instance_class.json, so that loop has
never produced data for it.

The fix

-            else:
+            elif status == "available":
                 # Track available versions for DB instance options
                 if engine not in available_results:

One line. The engine/version enums are untouched — results still receives all three statuses, so
sqlserver-dev-* keeps appearing in engine_version.json exactly as it does today. Only the
orderable-options collection narrows, and it narrows to the versions AWS says are orderable.

An earlier revision of this branch did this with a -dev- engine-name predicate, a skip-code
frozenset and a try/except ClientError — 48 lines inferring from the engine name what the API
already states in a field. That is reverted here. A naming predicate also has to be re-guessed
every time AWS ships a new family; a status check does not.

Verification

Against us-east-1, 2026-10-27, running the script end to end:

tree result
pristine upstream/main aborts — InvalidParameterValue ... A custom engine version is required for SQL Server engine sqlserver-dev-ee
this branch exit=0, every engine through to the Elasticache stage, ~12 min

Stubbed tests, following the importlib + patch.object pattern of the neighbouring
test_update_specs_from_pricing.py:

pytest test/unit/module/maintenance/     # 7 passed (2 new)
pytest test                              # 16 failed, 3231 passed
pre-commit run --all-files               # all hooks pass

The 16 failures are pre-existing and identical by name to a pristine upstream/main worktree
(16 failed / 3229 passed; the +2 are the new tests). All are missing optional deps — pydot,
junit-xml, jschema-to-python.

The two tests:

  • test_requires_custom_engine_version_is_not_collected — a requires-custom-engine-version
    version never reaches DescribeOrderableDBInstanceOptions. This fails on pristine
    upstream/main
    , where sqlserver-dev-ee is requested, so it is the reproduction rather than a
    restatement of the new code.
  • test_available_and_deprecated_versions_are_unchanged — available and deprecated still route
    where they did, and all three statuses still reach the engine/version enums. Passes on both trees
    by design; it is the guard against over-correcting.

No file under src/cfnlint/data/ is modified, so no -m data run is needed.

Not fixed here: the shared dict

results_db_instance_class = dict.fromkeys(available_results.keys(), dict()) passes one dict as
the value for every key, so all engines share it and each ends up with every other engine's minor
versions. It is a real and separate bug, it is not what causes this abort, and #4870 fixes it.
Left alone here so the two do not conflict.

update_schemas_from_aws_api.py has aborted on every scheduled run since
sqlserver-dev-ee and sqlserver-dev-se joined _ENGINE_SUPPORTED. That list
does double duty: it gates the engine version data and, through
available_results, it also gates DescribeOrderableDBInstanceOptions. That
operation refuses the SQL Server development engines with
InvalidParameterValue unless the calling account owns a custom engine
version built from the template version, so one engine took down the whole
data refresh.

Skip the engines whose orderable options need an account owned CEV, and
treat a per-request InvalidParameterValue or InvalidParameterCombination on
that operation as a warning for that engine version rather than a fatal
error, so a family AWS adds later degrades instead of aborting. Credential,
throttling and service errors still propagate.
@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.69%. Comparing base (edc9d45) to head (1055697).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4946   +/-   ##
=======================================
  Coverage   94.69%   94.69%           
=======================================
  Files         442      442           
  Lines       16083    16083           
  Branches     3119     3119           
=======================================
  Hits        15229    15229           
  Misses        470      470           
  Partials      384      384           
Flag Coverage Δ
unittests 94.68% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

DescribeDBEngineVersions returns three Status values, not two. The
available/deprecated branch let requires-custom-engine-version fall
through into available_results, so DescribeOrderableDBInstanceOptions
was called for sqlserver-dev-ee and sqlserver-dev-se, which it cannot
serve, and the refresh aborted.

Replaces the engine-name predicate and the ClientError handler added
earlier on this branch with the status AWS already reports.
@kddejong kddejong changed the title fix(scripts): skip RDS engines that need a custom engine version fix(scripts): only collect orderable options for available RDS versions Oct 27, 2026
@kddejong
kddejong marked this pull request as ready for review October 27, 2026 22:51
@kddejong
kddejong merged commit 14c6dd2 into aws-cloudformation:main Oct 27, 2026
21 of 22 checks passed
@kddejong
kddejong deleted the fix/rds-orderable-options-cev branch October 27, 2026 23:08
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.

E3690/E3691: Engine rejects neptune, sqlserver-dev-ee, sqlserver-dev-se

1 participant