region-info: Fact.regions behavior does not match description. #27260
Labels
@aws-cdk/region-info
Related to AWS Region information
bug
This issue is a bug.
documentation
This is a problem with documentation.
effort/small
Small work item – less than a day of effort
p2
Describe the bug
In fact.ts
aws-cdk/packages/aws-cdk-lib/region-info/lib/fact.ts
Lines 7 to 14 in ab52bb5
the description of
regions
it states it returns any region that has at least one fact registered. This is untrue, it is only listing from the fixed list defined inAWS_REGIONS
from aws-entities.ts.Either the description needs to be updated, or the logic needs to pull the list of regions from
this.database
instead of theAWS_REGIONS
export.Expected Behavior
Fact.regions
and save the array ascall1
AWS_REGIONS
Fact.regions
ascall2
call2
array would include the name of my newly added region and thecall1
array would not.Current Behavior
Fact.regions
and save the array ascall1
AWS_REGIONS
Fact.regions
ascall2
call2
array is identical to thecall1
array.Reproduction Steps
Possible Solution
Switch the code from
Array.from(AWS_REGIONS)
toArray.from(Object.keys(this.database))
or update the documentation to say it is a fixed list based onAWS_REGIONS
in aws-entities.tsAdditional Information/Context
No response
CDK CLI Version
2.95.0 (build cfa7e88)
Framework Version
No response
Node.js Version
v18.17.1
OS
OSX 13.5.2 (22G91)
Language
Typescript
Language Version
TypeScript (4.3.0)
Other information
You can reach out to me on the Amazon internal slack as
@chamsco
The text was updated successfully, but these errors were encountered: