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 is any. Can this parameter be changed to be of type string instead?
Expected Behavior
I expect the following piece of code to give a Type error on the first parameter.
new aws_iam.AccountPrincipal({ hello: 'world' }); // This is currently valid, and should not be, it should throw a TypeError
new aws_iam.AccountPrincipal('0123456789012'); // This is valid, and should be
Current Behavior
Currently, TypeScript does not complain about the code below.
new aws_iam.AccountPrincipal({ hello: 'world' }); // This is currently valid, and should not be, it should throw a TypeError
new aws_iam.AccountPrincipal('0123456789012'); // This is valid, and should be
Reproduction Steps
import { aws_iam } from 'aws-cdk-lib';
new aws_iam.AccountPrincipal('0123456789012');
new aws_iam.AccountPrincipal({ hello: 'world' });
Possible Solution
To fix this we can simply replace any with string in the constructor parameter of the AccountPrinciple class in: https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-iam/lib/principals.ts#L395
But 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
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
accountIdthe type of this 'account id' parameter isany. Can this parameter be changed to be of typestringinstead?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
anywithstringin the constructor parameter of theAccountPrincipleclass 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