aws_iam: any
parameter type in AccountPrinciple constructor
#20288
Labels
@aws-cdk/aws-iam
Related to AWS Identity and Access Management
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Describe the bug
The AccountPrinciple class as found in: https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-iam/lib/principals.ts#L395 has a construct that takes a single argument which is the
accountId
the type of this 'account id' parameter isany
. Can this parameter be changed to be of typestring
instead?Expected Behavior
I expect the following piece of code to give a Type error on the first parameter.
Current Behavior
Currently, TypeScript does not complain about the code below.
Reproduction Steps
Possible Solution
To fix this we can simply replace
any
withstring
in the constructor parameter of theAccountPrinciple
class in: https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-iam/lib/principals.ts#L395But first, we should double check there isn't any reasoning behind this being of type
any
.Additional Information/Context
No response
CDK CLI Version
2.16.0 (build 4c77925)
Framework Version
No response
Node.js Version
v14.18.0
OS
MacOS
Language
Typescript
Language Version
3.9.7
Other information
No response
The text was updated successfully, but these errors were encountered: